title: cmake: Create a hex-file with an AVR compiler
body: <p>I hope someone is able to help me:
  I try to use the cmake plugin in a jenkins server to create a hex file, but i don't know my fault.</p>
  
  <p>I also try to run the example of this site: <a href="http://robot-develop.org/archives/2952" rel="nofollow">http://robot-develop.org/archives/2952</a> but if i use the "make" command, i get this error message:
   make: *** No targets specifed and no makefile found. Stop</p>
  
  <p>Here is my code:</p>
  
  <p>CMakeLists.txt:</p>
  
  <pre><code>cmake_minimum_required (VERSION 2.6.0)
  INCLUDE("C:/Users/name/Desktop/example/Code/test_crosscompile.cmake")
  INCLUDE("C:/Users/name/Desktop/example/Code/macro.cmake")
  project (Code)
  MESSAGE(STATUS "\n --------------------------------&gt;Creating Test-Projekt...")
  IF( NOT CMAKE_BUILD_TYPE )
  SET( CMAKE_BUILD_TYPE Release ... FORCE )
  ENDIF()
  SET(MAIN_FILE
      class.c)
  # add the executable
  add_executable(Code ${MAIN_FILE})
  #makro
  AVR_CREATE_HEX(class)
  </code></pre>
  
  <p>makro.cmake:</p>
  
  <pre><code># create avr hex
  MACRO(AVR_CREATE_HEX name)
  ADD_CUSTOM_COMMAND(TARGET ${name} POST_BUILD COMMAND avr-objcopy ARGS -O ihex -R.eeprom ${name}     "C:/Users/name/Desktop/example/Code/class.hex")
  MESSAGE(STATUS "\n ----------JONAS----------------------&gt;Macro")
  ENDMACRO(AVR_CREATE_HEX)
  </code></pre>
  
  <p>test_crosscompile.cmake:</p>
  
  <pre><code>SET(CMAKE_SYSTEM_NAME "Windows")
  SET(CMAKE_C_COMPILER avr-gcc)
  SET(CMAKE_CXX_COMPILER avr-g++)
  SET(CSTANDARD "-std=gnu99")
  SET(CDEBUG "-gstabs")
  SET(CWARN "-Wall -Wstrict-prototypes")
  SET(CTUNING "-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums")
  SET(COPT "-Os")
  SET(CMCU "-mmcu=atmega32")
  SET(CDEFS "-DF_CPU=12000000UL")
  SET(CFLAGS "${CMCU} ${CDEBUG} ${CDEFS} ${CINCS} ${COPT} ${CWARN} ${CSTANDARD} ${CEXTRA}")
  SET(CXXFLAGS "${CMCU} ${CDEFS} ${CINCS} ${COPT}")
  SET(CMAKE_C_FLAGS  ${CFLAGS})
  SET(CMAKE_CXX_FLAGS ${CXXFLAGS})
  </code></pre>
  
  <p>I use the cmake GUI, but i don't know how to use it. 
  I try as generator visual studio 10 (specify toolchain file for cross compiling), but it generates no makefile or hex file. 
  If i choose MinGW Makefiles as the generator, i get the error:
  The C compiler "C:/WinAVR-20100110/bin/avr-gcc.exe" is not able to compile
    a simple test program.</p>
  
  <p>I hope somebody can help me, THANKS!</p>