[CMake] Generate *.cpp/*.hpp with add_custom_command, reference these in add_library in another subdirectory/CMakeLists?

Martin Zenzes martin.zenzes at dfki.de
Mon Jan 13 06:40:55 EST 2014


On 01/13/2014 10:11 AM, Nils Gladitz wrote:
> On 01/13/2014 09:55 AM, Martin Zenzes wrote:
>>
>> One little quick follow-on-question. After doing:
>>     set(GENERATED_CPP /path/to/not/yet/created/cpp/file.cpp)
>> this does not work as expected:
>>     set_property(SOURCE ${GENERATED_CPP} PROPERTY GENERATED)
>> while this will works as expected:
>>     set_source_files_properties(${GENERATED_CPP} PROPERTIES GENERATED)
>>
>> bug?
>>
>
> I think neither should work since you are missing a property value but
> either
>     set_property(SOURCE ${GENERATED_CPP} PROPERTY GENERATED ON)
> or
>     set_source_files_properties(${GENERATED_CPP} PROPERTIES GENERATED ON)
> should work.
>
> Nils
yes... not the first time that I stumbled over this... ;-)

-- 
   M.Sc. Martin Zenzes
   Space Robotics

  Hauptgeschäftsstelle Standort Bremen:
  DFKI GmbH
  Robotics Innovation Center
  Robert-Hooke-Straße 5
  28359 Bremen, Germany

   Phone: +49 (0) 421 178 45 - 6658
   Fax:   +49 (0) 421 178 45 - 4150
   E-Mail: martin.zenzes at dfki.de

  Weitere Informationen: http://www.dfki.de/robotik
  -----------------------------------------------------------------------
  Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
  Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
  Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
  (Vorsitzender) Dr. Walter Olthoff
  Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
  Amtsgericht Kaiserslautern, HRB 2313
  Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
  USt-Id.Nr.:    DE 148646973
  Steuernummer:  19/673/0060/3
  -----------------------------------------------------------------------



More information about the CMake mailing list