I am new to cmake and having a lot of fun. I want a variable to contain a path, depending on whether or not I am in a debug or release configuration. My code looks like this:
set( LIBRARY_DIR
$<$<CONFIG:DEBUG>: "${CMAKE_SOURCE_DIR}/lib/debug">
$<$<CONFIG:RELEASE>:"${CMAKE_SOURCE_DIR}/lib/release">) # Directory is debug/release dependent
message (STATUS "Directory is ${LIBRARY_DIR}")
However, the message I get out is surprising:
Directory is $<$<CONFIG:Debug>:;C:/path/lib/debug;>;$<$<CONFIG:Release>:"C:/path/lib/release"
It's as though my generators aren't getting resolved at all, and are being interpreted as string literals. This seems weird to me, but as I said, I'm new to cmake and this is all strange to me. Have I made any obvious mistakes?