Due to the following warning:
CMake Error at test/CMakeLists.txt:29 (get_target_property):
The LOCATION property may not be read from target \"my_exe\". Use t
Here is a quick and easy way to print the value of a generator expression:
add_custom_target(print
${CMAKE_COMMAND} -E echo $<1:hello> $<0:world>
)
In this example, if you run cmake .
and then make print
, you will see "hello" (without the quotation marks) in the output.
However, if you just use message($<1:hello> $<0:world>)
, you will see "$<1:hello> $<0:world>
" as output (again, without the quotation marks).