On 08.09.2014 23:27, James Bigler wrote:
Is there an equivalent command to link_directories that support generator expressions?

link_directories( $<$<CONFIG:Debug>:${PROG_LIBRARY_DIRS_RELWITHDEBCRT}> )
    link_directories( $<NOT:$<CONFIG:Debug>>:${PROG_LIBRARY_DIRS}> )

Basically I want to use PROG_LIBRARY_DIRS_RELWITHDEBCRT for Debug builds and PROG_LIBRARY_DIRS for everything else.

I'm sure I can go and use set_target_properties or something like that, but I was wondering if there was some way I could make this work, before I have to do a much larger change.


The documentation for link_directories() notes that the command is rarely necessary since target_link_libraries() takes absolute paths. target_link_libraries() itself understands generator expressions.

What is your use case for link_directories()?

If absolutely need be a viable though I guess not portable and possibly frowned upon workaround might be something like:

target_link_libraries(foo PRIVATE -Lfoo/$<CONFIG>/bar) # assumes -L adds a linker directory

Given that target_link_libraries() also allows (non library) linker options.

Nils
--

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