title: How to add .asm code to the build correctly?
body: <p>I write program in NASM and want use the cmake as a build engine.</p>
  
  <p>At now I use it in the following way:</p>
  
  <pre><code>execute_process (
      COMMAND C:/NASM/x32/nasm.exe -f bin launch.asm -o ${CMAKE_CURRENT_BINARY_DIR}/Launch
      WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
  )
  </code></pre>
  
  <p>But there are one issue: the build of the launch.asm happens all time even if it dont change. How to avoid it and hav build only if launch.as changed?</p>
  
  <p><strong>UPD1</strong>: as write <strong>vre</strong> below I make following cmake file - </p>
  
  <pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.12.0)
  project(Launch LANGUAGES ASM_NASM)
  
  enable_language(ASM_NASM)
  SET(ASM_DIALECT "-NASM")
  set(CMAKE_ASM_NASM_FLAGS "-f bin")
  
  add_executable(${PROJECT_NAME} launch.asm)
  set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE NASM) 
  </code></pre>
  
  <p>I generate sources with following strings:</p>
  
  <pre><code>cmake .. -G"Visual Studio 15 2017"
  cmake --build . --target ALL_BUILD
  </code></pre>
  
  <p>And I receive issues:</p>
  
  <ol>
  <li>When I generate source - there are appears following errors:</li>
  </ol>
  
  <blockquote>
    <p>CMake Error: Error required internal CMake variable not set, cmake may
    not be built correctly. 
    Missing variable is: CMAKE_EXE_LINKER_FLAGS</p>
    
    <p>CMake Error: Error required internal CMake variable not set, cmake may
    not be built correctly. 
    Missing variable is:
    CMAKE_EXE_LINKER_FLAGS_DEBUG </p>
    
    <p>CMake Error: Error required internal
    CMake variable not set, cmake may not be built correctly.
    ....</p>
  </blockquote>
  
  <ol start="2">
  <li>NASM launch incorrectly - I want generate bin, but there are add win32</li>
  </ol>
  
  <blockquote>
    <p>_NASM:   Assembling launch.asm   cmd.exe /D /C "C:\Users\AeroSun\AppData\Local\Temp\tmp0a9e10beedeb4b9986b66e79724488ee.cmd"
    "C:/NASM/x64/nasm.exe" -o Launch.dir\Debug\launch.obj -fwin32
    -DCMAKE_INTDIR="Debug" -f bin "L:\DevProj\Astra\src\Ker   nel\Launch\Ix86x64\launch.asm"</p>
  </blockquote>
  
  <ol start="3">
  <li>Finally it generate .obj file and break on linkage step, but I need just bin file</li>
  </ol>
  
  <blockquote>
    <p>Launch.dir\Debug\launch.obj : fatal error LNK1107</p>
  </blockquote>
  
  <p>So the main question - can cmake work with assembler? If so is exist somewhere minimal <strong><em>workable</em></strong> example?</p>