Gotcha, Iosif,

thanks for clearing that up for me. To summarize, I should ...

On 26.10.2015 12:51, Iosif Neitzke wrote:
> [...]
> add_library( somelib ${CMAKE_CURRENT_BINARY_DIR}/Header.hpp
> ${CMAKE_CURRENT_BINARY_DIR}/Header.cpp source.cpp )

...add the generated files as to the target.

That leads me to another question, though (hopefully the last): If
source.cpp depends on Header.hpp, is it guaranteed that Header.hpp will
be generated before the compiler tries to compile source.cpp? Does the
list order of the files inside add_library() matter?

Cheers,
Martin
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to