diff options
-rw-r--r-- | CMakeLists.txt | 11 | ||||
-rw-r--r-- | Help/manual/cmake-buildsystem.7.rst | 6 | ||||
-rw-r--r-- | Help/manual/cmake-packages.7.rst | 15 | ||||
-rw-r--r-- | Modules/Platform/Windows-MSVC.cmake | 10 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.cxx | 1 | ||||
-rw-r--r-- | Source/cmInstallTargetGenerator.cxx | 14 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 1 | ||||
-rw-r--r-- | Tests/InterfaceLibrary/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/InterfaceLibrary/definetestexe.cpp | 3 | ||||
-rw-r--r-- | Tests/InterfaceLibrary/obj.cpp | 1 | ||||
-rw-r--r-- | Tests/RunCMake/TargetObjects/BadContext-stderr.txt | 14 | ||||
-rw-r--r-- | Tests/RunCMake/TargetObjects/BadContext.cmake | 3 |
13 files changed, 68 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 41ff4a6..e210f74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -201,12 +201,6 @@ endmacro() #----------------------------------------------------------------------- macro (CMAKE_BUILD_UTILITIES) #--------------------------------------------------------------------- - # Create the KWIML library for CMake. - set(KWIML cmIML) - set(KWIML_HEADER_ROOT ${CMake_BINARY_DIR}/Utilities) - add_subdirectory(Utilities/KWIML) - - #--------------------------------------------------------------------- # Create the kwsys library for CMake. set(KWSYS_NAMESPACE cmsys) set(KWSYS_USE_SystemTools 1) @@ -465,6 +459,11 @@ if("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x") set(CMAKE_TESTS_CDASH_SERVER "http://open.cdash.org") endif() +# Create the KWIML library for CMake. +set(KWIML cmIML) +set(KWIML_HEADER_ROOT ${CMake_BINARY_DIR}/Utilities) +add_subdirectory(Utilities/KWIML) + if(NOT CMake_TEST_EXTERNAL_CMAKE) # build the utilities (a macro defined in this file) CMAKE_BUILD_UTILITIES() diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst index a7402f7..1ce9a7e 100644 --- a/Help/manual/cmake-buildsystem.7.rst +++ b/Help/manual/cmake-buildsystem.7.rst @@ -107,6 +107,12 @@ they may not be installed, exported, or used in the right hand side of :command:`target_link_libraries`. They also may not be used as the ``TARGET`` in a use of the :command:`add_custom_command(TARGET)` command signature. +Although object libraries may not be named directly in calls to +the :command:`target_link_libraries` command, they can be "linked" +indirectly by using an :ref:`Interface Library <Interface Libraries>` +whose :prop_tgt:`INTERFACE_SOURCES` target property is set to name +``$<TARGET_OBJECTS:objlib>``. + Build Specification and Usage Requirements ========================================== diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst index c4cca6d..5badd48 100644 --- a/Help/manual/cmake-packages.7.rst +++ b/Help/manual/cmake-packages.7.rst @@ -385,9 +385,12 @@ In this case, the ``ClimbingStatsConfig.cmake`` file could be as simple as: .. code-block:: cmake - include("${CMAKE_CURRENT_LIST_DIR}/ClimbingStatsTargets.cmake") + if(NOT TARGET Upstream::ClimbingStats) + include("${CMAKE_CURRENT_LIST_DIR}/ClimbingStatsTargets.cmake") + endif() -As this allows downstreams to use the ``IMPORTED`` targets. If any macros +This allows downstreams to use the ``IMPORTED`` targets, and guards +against importing the targets more than once. If any macros should be provided by the ``ClimbingStats`` package, they should be in a separate file which is installed to the same location as the ``ClimbingStatsConfig.cmake`` file, and included from there. @@ -454,7 +457,9 @@ dependencies of a package should be found in the ``Config.cmake`` file: include(CMakeFindDependencyMacro) find_dependency(Stats 2.6.4) - include("${CMAKE_CURRENT_LIST_DIR}/ClimbingStatsTargets.cmake") + if(NOT TARGET Upstream::ClimbingStats) + include("${CMAKE_CURRENT_LIST_DIR}/ClimbingStatsTargets.cmake") + endif() include("${CMAKE_CURRENT_LIST_DIR}/ClimbingStatsMacros.cmake") The ``find_dependency`` macro also sets ``ClimbingStats_FOUND`` to ``False`` if @@ -471,7 +476,9 @@ be true. This can be tested with logic in the package configuration file: include(CMakeFindDependencyMacro) find_dependency(Stats 2.6.4) - include("${CMAKE_CURRENT_LIST_DIR}/ClimbingStatsTargets.cmake") + if(NOT TARGET Upstream::ClimbingStats) + include("${CMAKE_CURRENT_LIST_DIR}/ClimbingStatsTargets.cmake") + endif() include("${CMAKE_CURRENT_LIST_DIR}/ClimbingStatsMacros.cmake") set(_supported_components Plot Table) diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index bb6d991..8e988c9 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -39,12 +39,14 @@ endif() set(WIN32 1) if(CMAKE_SYSTEM_NAME MATCHES "WindowsCE") - set(CMAKE_CREATE_WIN32_EXE "/subsystem:windowsce /entry:WinMainCRTStartup") - set(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce /entry:mainACRTStartup") + set(CMAKE_CREATE_WIN32_EXE "/entry:WinMainCRTStartup") + set(CMAKE_CREATE_CONSOLE_EXE "/entry:mainACRTStartup") + set(_PLATFORM_LINK_FLAGS " /subsystem:windowsce") set(WINCE 1) else() set(CMAKE_CREATE_WIN32_EXE "/subsystem:windows") set(CMAKE_CREATE_CONSOLE_EXE "/subsystem:console") + set(_PLATFORM_LINK_FLAGS "") endif() if(CMAKE_GENERATOR MATCHES "Visual Studio 6") @@ -238,7 +240,7 @@ macro(__windows_compiler_msvc lang) set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe ") endif() set(CMAKE_${lang}_CREATE_SHARED_LIBRARY - "${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") + "${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY}) set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ") @@ -252,7 +254,7 @@ macro(__windows_compiler_msvc lang) set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1) set(CMAKE_${lang}_LINK_EXECUTABLE - "${_CMAKE_VS_LINK_EXE}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") + "${_CMAKE_VS_LINK_EXE}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_FLAGS_INIT "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_${lang}} /D_WINDOWS /W3${_FLAGS_${lang}}") set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od ${_RTC1}") diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index c37587c..0de45a0 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 0) -set(CMake_VERSION_PATCH 20140709) +set(CMake_VERSION_PATCH 20140714) #set(CMake_VERSION_RC 1) diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 13eac3b..3b83cd3 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1210,6 +1210,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode { cmGeneratorExpression ge(&context->Backtrace); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop); + cge->SetEvaluateForBuildsystem(context->EvaluateForBuildsystem); std::string result = cge->Evaluate(context->Makefile, context->Config, context->Quiet, diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 85df91d..8a1c53e 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -215,6 +215,20 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os, filesFrom.push_back(from1); filesTo.push_back(to1); } + else if(this->Target->IsCFBundleOnApple()) + { + // Install the whole app bundle directory. + type = cmInstallType_DIRECTORY; + literal_args += " USE_SOURCE_PERMISSIONS"; + + std::string targetNameBase = targetName.substr(0, targetName.find('/')); + + std::string from1 = fromDirConfig + targetNameBase; + std::string to1 = toDir + targetName; + + filesFrom.push_back(from1); + filesTo.push_back(to1); + } else { bool haveNamelink = false; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 0a7724c..667c2a4 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -6375,6 +6375,7 @@ void cmTargetInternals::AddInterfaceEntries( "$<TARGET_PROPERTY:" + *it + "," + prop + ">"; cmGeneratorExpression ge(&it->Backtrace); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(genex); + cge->SetEvaluateForBuildsystem(true); entries.push_back( new cmTargetInternals::TargetPropertyEntry(cge, *it)); } diff --git a/Tests/InterfaceLibrary/CMakeLists.txt b/Tests/InterfaceLibrary/CMakeLists.txt index d4f49c2..fe202dd 100644 --- a/Tests/InterfaceLibrary/CMakeLists.txt +++ b/Tests/InterfaceLibrary/CMakeLists.txt @@ -18,8 +18,12 @@ set_property(TARGET imp::iface APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SOMEPRO set_property(TARGET imp::iface PROPERTY INTERFACE_SOMEPROP OFF) set_property(TARGET imp::iface PROPERTY INTERFACE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/does_not_exist.cpp) +add_library(objlib OBJECT obj.cpp) +add_library(iface_objlib INTERFACE) +target_sources(iface_objlib INTERFACE $<TARGET_OBJECTS:objlib>) + add_executable(InterfaceLibrary definetestexe.cpp) -target_link_libraries(InterfaceLibrary iface_nodepends headeriface subiface) +target_link_libraries(InterfaceLibrary iface_nodepends headeriface subiface iface_objlib) add_subdirectory(libsdir) diff --git a/Tests/InterfaceLibrary/definetestexe.cpp b/Tests/InterfaceLibrary/definetestexe.cpp index 30f2925..9044076 100644 --- a/Tests/InterfaceLibrary/definetestexe.cpp +++ b/Tests/InterfaceLibrary/definetestexe.cpp @@ -15,9 +15,10 @@ #error Expected IFACE_HEADER_BUILDDIR #endif +extern int obj(); extern int sub(); int main(int,char**) { - return sub(); + return obj() + sub(); } diff --git a/Tests/InterfaceLibrary/obj.cpp b/Tests/InterfaceLibrary/obj.cpp new file mode 100644 index 0000000..ee6f5fe --- /dev/null +++ b/Tests/InterfaceLibrary/obj.cpp @@ -0,0 +1 @@ +int obj() { return 0; } diff --git a/Tests/RunCMake/TargetObjects/BadContext-stderr.txt b/Tests/RunCMake/TargetObjects/BadContext-stderr.txt index 92f2c91..b78189e 100644 --- a/Tests/RunCMake/TargetObjects/BadContext-stderr.txt +++ b/Tests/RunCMake/TargetObjects/BadContext-stderr.txt @@ -1,4 +1,4 @@ -CMake Error at BadContext.cmake:2 \(file\): +(CMake Error at BadContext.cmake:4 \(file\): Error evaluating generator expression: \$<TARGET_OBJECTS:NoTarget> @@ -7,7 +7,17 @@ CMake Error at BadContext.cmake:2 \(file\): for consumption by CMake. It is not suitable for writing out elsewhere. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) -+ +*)+ +(CMake Error at BadContext.cmake:5 \(file\): + Error evaluating generator expression: + + \$<TARGET_OBJECTS:NoTarget> + + The evaluation of the TARGET_OBJECTS generator expression is only suitable + for consumption by CMake. It is not suitable for writing out elsewhere. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +*)+ CMake Error: Error evaluating generator expression: diff --git a/Tests/RunCMake/TargetObjects/BadContext.cmake b/Tests/RunCMake/TargetObjects/BadContext.cmake index 67962a4..5d7e33e 100644 --- a/Tests/RunCMake/TargetObjects/BadContext.cmake +++ b/Tests/RunCMake/TargetObjects/BadContext.cmake @@ -1,4 +1,7 @@ +add_library(iface INTERFACE) +target_sources(iface INTERFACE $<TARGET_OBJECTS:NoTarget>) file(GENERATE OUTPUT test_output CONTENT $<TARGET_OBJECTS:NoTarget>) +file(GENERATE OUTPUT test_output2 CONTENT $<TARGET_PROPERTY:iface,INTERFACE_SOURCES>) install(FILES $<TARGET_OBJECTS:NoTarget> DESTINATION objects) |