[CMake] custom configuration types and linking with 3rd-party libs

Brad King brad.king at kitware.com
Thu Sep 4 17:37:29 EDT 2008


Philip Lowman wrote:
> Ultimately, TARGET_LINK_LIBRARIES() works just fine the way it is with
> the debug/optimized keywords satisfying normal use cases.  The
> debug/optimized keywords are in the lexicon and they aren't going
> anywhere.  What is the harm in accepting a patch (if a user submitted
> one) that facilitated global association of custom build configurations
> with the debug/optimized keywords?  I'm honestly surprised that this has
> been hardcoded for as long as it has been.

I think the best way to define meaning of the keywords is simply to
define one global property 'DEBUG_CONFIGURATIONS':

set_property(GLOBAL PROPERTY DEBUG_CONFIGURATIONS Debug MyDebugConfig)

The property is generic enough that it could be useful for other things
later, so I'm willing to create it even though it extends the old way.
The TARGET_LINK_LIBRARIES() command can use this property to define
which configurations are associated with 'debug' (and all others with
'optimized').  There some subtle issues with the implementation and
testing of the property, so I've taken care of it.

-Brad

/cvsroot/CMake/CMake/Source/cmComputeLinkDepends.cxx,v  <--
Source/cmComputeLinkDepends.cxx
new revision: 1.29; previous revision: 1.28
/cvsroot/CMake/CMake/Source/cmComputeLinkDepends.h,v  <--
Source/cmComputeLinkDepends.h
new revision: 1.15; previous revision: 1.14
/cvsroot/CMake/CMake/Source/cmExportFileGenerator.cxx,v  <--
Source/cmExportFileGenerator.cxx
new revision: 1.15; previous revision: 1.14
/cvsroot/CMake/CMake/Source/cmTarget.cxx,v  <--  Source/cmTarget.cxx
new revision: 1.226; previous revision: 1.225
/cvsroot/CMake/CMake/Source/cmTarget.h,v  <--  Source/cmTarget.h
new revision: 1.120; previous revision: 1.119
/cvsroot/CMake/CMake/Source/cmTargetLinkLibrariesCommand.cxx,v  <--
Source/cmTargetLinkLibrariesCommand.cxx
new revision: 1.29; previous revision: 1.28
/cvsroot/CMake/CMake/Source/cmTargetLinkLibrariesCommand.h,v  <--
Source/cmTargetLinkLibrariesCommand.h
new revision: 1.19; previous revision: 1.18
/cvsroot/CMake/CMake/Source/cmake.cxx,v  <--  Source/cmake.cxx
new revision: 1.395; previous revision: 1.394
/cvsroot/CMake/CMake/Source/cmake.h,v  <--  Source/cmake.h
new revision: 1.117; previous revision: 1.116
/cvsroot/CMake/CMake/Tests/ExportImport/Export/CMakeLists.txt,v  <--
Tests/ExportImport/Export/CMakeLists.txt
new revision: 1.15; previous revision: 1.14
/cvsroot/CMake/CMake/Tests/ExportImport/Import/CMakeLists.txt,v  <--
Tests/ExportImport/Import/CMakeLists.txt
new revision: 1.6; previous revision: 1.5


More information about the CMake mailing list