Hi

My understanding is that cmake will automatically set the compiler flags based 
on CMAKE_BUILD_TYPE.  I am wondering whether there is a clean way of specifying 
debug / release 'extra' libraries such that cmake will select the appropriate 
library at link time?

Currently I use this code to link to the open source 'SystemC' library:

if( USE_SYSTEMC )
    if( CMAKE_BUILD_TYPE STREQUAL "Release" )
        target_link_libraries( zodiac ${SYSTEMCLIB_R} )
    endif( CMAKE_BUILD_TYPE STREQUAL "Release" )
    if( CMAKE_BUILD_TYPE STREQUAL "Debug" )
        target_link_libraries( zodiac ${SYSTEMCLIB_D} )
    endif( CMAKE_BUILD_TYPE STREQUAL "Debug" )
endif( USE_SYSTEMC )

Is there a cleaner way of doing this?

Best regards

David

_______________________________________________
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