[CMake] Determining a library name at configure time

Bill Newcomb bnewcomb at nvidia.com
Fri Sep 18 14:42:22 EDT 2015


Suppose I add a library in my project:

add_library(foo STATIC foo.c bar.c)

Is there a way I can get the name of the generated library file at 
configure time?  LIBRARY_OUTPUT_NAME and OUTPUT_NAME for the target do 
not seem to be set:

get_target_property(libname foo LIBRARY_OUTPUT_NAME)
message(STATUS "libname is ${libname}

...
-- libname is libname-NOTFOUND
...

Thanks,
B.

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------


More information about the CMake mailing list