mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-29 18:51:05 -05:00
ENH: Allow more specification of target file names
This creates target properties ARCHIVE_OUTPUT_NAME, LIBRARY_OUTPUT_NAME, and RUNTIME_OUTPUT_NAME, and per-configuration equivalent properties ARCHIVE_OUTPUT_NAME_<CONFIG>, LIBRARY_OUTPUT_NAME_<CONFIG>, and RUNTIME_OUTPUT_NAME_<CONFIG>. They allow specification of target output file names on a per-type, per-configuration basis. For example, a .dll and its .lib import library may have different base names. For consistency and to avoid ambiguity, the old <CONFIG>_OUTPUT_NAME property is now also available as OUTPUT_NAME_<CONFIG>. See issue #8920.
This commit is contained in:
@@ -36,6 +36,15 @@ set_property(TARGET testLib3 PROPERTY LINK_INTERFACE_LIBRARIES "")
|
||||
set_property(TARGET testLib3 PROPERTY VERSION 1.2)
|
||||
set_property(TARGET testLib3 PROPERTY SOVERSION 3)
|
||||
|
||||
# Test <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME[_<CONFIG>] properties.
|
||||
set_property(TARGET testLib3 PROPERTY RUNTIME_OUTPUT_NAME_DEBUG testLib3dll-d)
|
||||
set_property(TARGET testLib3 PROPERTY RUNTIME_OUTPUT_NAME_RELEASE testLib3dll-r)
|
||||
set_property(TARGET testLib3 PROPERTY RUNTIME_OUTPUT_NAME testLib3dll)
|
||||
set_property(TARGET testLib3 PROPERTY LIBRARY_OUTPUT_NAME_DEBUG testLib3lib-d)
|
||||
set_property(TARGET testLib3 PROPERTY LIBRARY_OUTPUT_NAME_RELEASE testLib3lib-r)
|
||||
set_property(TARGET testLib3 PROPERTY LIBRARY_OUTPUT_NAME testLib3lib)
|
||||
set_property(TARGET testLib3 PROPERTY ARCHIVE_OUTPUT_NAME testLib3import)
|
||||
|
||||
add_library(testLib4 SHARED testLib4.c)
|
||||
set_property(TARGET testLib4 PROPERTY FRAMEWORK 1)
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ IF(STAGE2)
|
||||
)
|
||||
SET(t1NAMES test1 test1${CMAKE_DEBUG_POSTFIX} test1rel)
|
||||
SET(t2NAMES test2 test2${CMAKE_DEBUG_POSTFIX})
|
||||
SET(t4NAMES test4 test4${CMAKE_DEBUG_POSTFIX})
|
||||
SET(t4NAMES test4out test4out${CMAKE_DEBUG_POSTFIX})
|
||||
|
||||
# Make sure the install script ran.
|
||||
SET(CMAKE_INSTALL_SCRIPT_DID_RUN 0)
|
||||
@@ -165,6 +165,10 @@ ELSE(STAGE2)
|
||||
ADD_LIBRARY(test3 MODULE lib3.cxx)
|
||||
ADD_LIBRARY(test4 SHARED lib4.cxx)
|
||||
|
||||
# Test <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME properties.
|
||||
SET_PROPERTY(TARGET test4 PROPERTY ARCHIVE_OUTPUT_NAME test4out)
|
||||
SET_PROPERTY(TARGET test4 PROPERTY LIBRARY_OUTPUT_NAME test4out)
|
||||
|
||||
ADD_EXECUTABLE (SimpleInstall inst.cxx foo.c foo.h)
|
||||
TARGET_LINK_LIBRARIES(SimpleInstall test1 test2 test4)
|
||||
SET(install_target SimpleInstall)
|
||||
|
||||
@@ -33,7 +33,7 @@ IF(STAGE2)
|
||||
)
|
||||
SET(t1NAMES test1 test1${CMAKE_DEBUG_POSTFIX} test1rel)
|
||||
SET(t2NAMES test2 test2${CMAKE_DEBUG_POSTFIX})
|
||||
SET(t4NAMES test4 test4${CMAKE_DEBUG_POSTFIX})
|
||||
SET(t4NAMES test4out test4out${CMAKE_DEBUG_POSTFIX})
|
||||
|
||||
# Make sure the install script ran.
|
||||
SET(CMAKE_INSTALL_SCRIPT_DID_RUN 0)
|
||||
@@ -165,6 +165,10 @@ ELSE(STAGE2)
|
||||
ADD_LIBRARY(test3 MODULE lib3.cxx)
|
||||
ADD_LIBRARY(test4 SHARED lib4.cxx)
|
||||
|
||||
# Test <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME properties.
|
||||
SET_PROPERTY(TARGET test4 PROPERTY ARCHIVE_OUTPUT_NAME test4out)
|
||||
SET_PROPERTY(TARGET test4 PROPERTY LIBRARY_OUTPUT_NAME test4out)
|
||||
|
||||
ADD_EXECUTABLE (SimpleInstall inst.cxx foo.c foo.h)
|
||||
TARGET_LINK_LIBRARIES(SimpleInstall test1 test2 test4)
|
||||
SET(install_target SimpleInstall)
|
||||
|
||||
Reference in New Issue
Block a user