Hello,

I'm trying to find a work around since target_link_libraries cannot be used per-configuration. I know that out-of-build could solve my problem, but my team is currently migrating from Visual Studio to cmake, so I need something which "feel" more like Visual Studio.

My current project has around 20 configurations (debug, release, many many more, mostly combination of debug_something, release_something, etc.) and some of those configuration requires to include special external libraries, some not. Since I cannot classify all my configurations as debug or release, solution like target_link_libraries (target my_library debug|optimized) did not work.

To put it simply, what I'm trying to achieve is something like:

add_executable (exec)
add_library (my_lib)

set_target_properties (exec PROPERTIES COMPILE_DEFINITIONS_CONFIG1 USING_MY_LIB) set_target_properties (exec PROPERTIES COMPILE_DEFINITIONS_CONFIG2 NOT_USING_MY_LIB)

# should only link the library under CONFIG1
target_link_libraries (exec my_library)

Thank you,
Ben.

_______________________________________________
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to