Hello,

following "modern cmake" conventions I want to create a library where every 
single file is compiled with an individual define (-D_fileX_, required for a 
macro which integrates code into every translation unit).

So following this

    add_library(mylib SHARED file1.c file2.c)
    target_link_libraries(mylib PUBLIC otherlib)

I'd like to iterate over all "mylib" source file targets and modify them so 
that the compiler is called like this:

    cc -c -o file1.o file1.cc -D_file1_define_
    cc -c -o file1.o file2.cc -D_file2_define_
    etc.

Is this possible?


Regards

GPF
-- 

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:
https://cmake.org/mailman/listinfo/cmake

Reply via email to