Generator Expression Support in set_target_properties
I'd like to build the static library version of my library with a 'lib' prefix and can't seem to figure out how to get the generator expression below to work. Any help?
set_target_properties(${PROJECT_NAME}
PROPERTIES
DEBUG_POSTFIX "d"
$<$<STREQUAL:${BUILD_SHARED_LIBS},OFF>:PREFIX "lib">
)
Since I can't get this to work. I've tried creating a variable (e.g. set(MY_PREFIX "PREFIX "lib"")) and using it in the generator expresion but no luck. My workaround is to give up on the generator expression and just add the following code.
if(NOT BUILD_SHARED_LIBS)
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "lib")
endif()
It would be great if I didn't have to add the extra lines of code. Thanks for your help.
Edited by Dan H