[CMake] Possible bug: <config>_OUTPUT_NAME not used as target property LOCATION

Laurentiu Nicolae Laurentiu.Nicolae at quintiq.com
Tue May 16 12:43:45 EDT 2006


Hi cmake hackers,

My project requires the generation of DLLs and executables with
different postfixes for different configurations. Therefore I am setting
the <config_OUTPUT_NAME accordingly. However, when I try to add a
post-build step to the build (as described in the manual), the LOCATION
property of the target is set to the original generated name, regardless
of the configuration. I can of course work around this by setting the
prefixes by hand in the post-build command, but I believe this to be a
bug. The reason being: if I am using the <config>_OUTPUT_NAME options,
the LOCATION property becomes rather useless, because it points to
something that may not be there any more.

CMakeLists.txt excerpt:

    SET_TARGET_PROPERTIES ( ${ProjectName} PROPERTIES DEBUG_OUTPUT_NAME
         "${ProjectName}D" )
    SET_TARGET_PROPERTIES ( ${ProjectName} PROPERTIES
RELWITHDEBINFO_OUTPUT_NAME "${ProjectName}Q" )
    SET_TARGET_PROPERTIES ( ${ProjectName} PROPERTIES
RELEASE_OUTPUT_NAME        "${ProjectName}R" )


  GET_TARGET_PROPERTY ( DllLocation "${ProjectName}" LOCATION )
  ADD_CUSTOM_COMMAND ( TARGET "${ProjectName}"
                       POST_BUILD
                       COMMAND ${CMAKE_COMMAND}
                       ARGS -E copy "${DllLocation}" "${QOutputPath}"
                     )


Cheers,
Laurentiu

--
Laurentiu Nicolae
Senior Software Engineer
Quintiq

Tel: +31 (0)73 691 07 39
Fax: +31 (0)73 691 07 54
Laurentiu.Nicolae at quintiq.com 
www.quintiq.com 

------------------------------------------------------------------------------------------
This message contains information that may be privileged or
confidential and is the property of Quintiq. It is only intended for the
person to whom it is addressed. If you are not the intended recipient,
you are not authorized to read, print, retain, copy disseminate,
distribute or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all
copies of this message. Please note that e-mails are susceptible to
change.


More information about the CMake mailing list