summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeCPack.cmake2
-rw-r--r--Modules/CMakeDetermineCompilerABI.cmake5
-rw-r--r--Modules/CMakeMinGWFindMake.cmake4
-rw-r--r--Modules/CPackWIX.cmake26
-rw-r--r--Modules/FindCUDA.cmake6
-rw-r--r--Modules/FindQt4.cmake30
-rw-r--r--Modules/SelectLibraryConfigurations.cmake74
-rw-r--r--Modules/UseJava.cmake2
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx141
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.h6
-rw-r--r--Source/cmAddCompileOptionsCommand.h1
-rw-r--r--Source/cmAddTestCommand.h3
-rw-r--r--Source/cmComputeLinkInformation.cxx20
-rw-r--r--Source/cmCustomCommand.cxx28
-rw-r--r--Source/cmCustomCommand.h1
-rw-r--r--Source/cmDocumentGeneratorExpressions.h8
-rw-r--r--Source/cmExportFileGenerator.cxx4
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx98
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx48
-rw-r--r--Source/cmLocalGenerator.cxx2
-rw-r--r--Source/cmMakefile.cxx3
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx6
-rw-r--r--Source/cmOrderDirectories.cxx22
-rw-r--r--Source/cmSetPropertyCommand.cxx6
-rw-r--r--Source/cmTarget.cxx27
-rw-r--r--Source/cmTargetCompileDefinitionsCommand.h1
-rw-r--r--Source/cmTargetIncludeDirectoriesCommand.h1
-rw-r--r--Tests/CMakeLists.txt1
-rw-r--r--Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt2
-rw-r--r--Tests/CPackWiXGenerator/CMakeLists.txt2
-rw-r--r--Tests/CompileDefinitions/compiletest_mixed_c.c4
-rw-r--r--Tests/CompileDefinitions/compiletest_mixed_cxx.cpp4
-rw-r--r--Tests/CompileDefinitions/target_prop/CMakeLists.txt19
-rw-r--r--Tests/EmptyProperty/CMakeLists.txt9
-rw-r--r--Tests/EmptyProperty/EmptyProperty.cxx1
-rw-r--r--Tests/GeneratorExpression/CMakeLists.txt30
-rw-r--r--Tests/GeneratorExpression/check-part3.cmake13
-rw-r--r--Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt12
-rw-r--r--Tests/MacRuntimePath/A/CMakeLists.txt5
-rw-r--r--Tests/MacRuntimePath/A/framework2.cpp8
-rw-r--r--Tests/MacRuntimePath/A/framework2.h17
-rw-r--r--Tests/MacRuntimePath/B/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/Configure/FailCopyFileABI-check.cmake13
-rw-r--r--Tests/RunCMake/Configure/FailCopyFileABI-override.cmake6
-rw-r--r--Tests/RunCMake/Configure/FailCopyFileABI-stdout.txt4
-rw-r--r--Tests/RunCMake/Configure/FailCopyFileABI.cmake2
-rw-r--r--Tests/RunCMake/Configure/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt5
-rw-r--r--Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake2
50 files changed, 501 insertions, 239 deletions
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake
index a27d000..2495c44 100644
--- a/CMakeCPack.cmake
+++ b/CMakeCPack.cmake
@@ -113,6 +113,8 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
include(Utilities/Release/Cygwin/CMakeLists.txt)
endif()
+ set(CPACK_WIX_UPGRADE_GUID "8ffd1d72-b7f1-11e2-8ee5-00238bca4991")
+
# Set the options file that needs to be included inside CMakeCPackOptions.cmake
set(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake)
configure_file("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index 44cc04a..e9ae995 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -41,6 +41,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
"--no-warn-unused-cli"
OUTPUT_VARIABLE OUTPUT
COPY_FILE "${BIN}"
+ COPY_FILE_ERROR _copy_error
)
# Move result from cache to normal variable.
set(CMAKE_${lang}_ABI_COMPILED ${CMAKE_${lang}_ABI_COMPILED})
@@ -48,7 +49,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
set(CMAKE_${lang}_ABI_COMPILED ${CMAKE_${lang}_ABI_COMPILED} PARENT_SCOPE)
# Load the resulting information strings.
- if(CMAKE_${lang}_ABI_COMPILED)
+ if(CMAKE_${lang}_ABI_COMPILED AND NOT _copy_error)
message(STATUS "Detecting ${lang} compiler ABI info - done")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Detecting ${lang} compiler ABI info compiled with the following output:\n${OUTPUT}\n\n")
@@ -131,7 +132,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
else()
message(STATUS "Detecting ${lang} compiler ABI info - failed")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Detecting ${lang} compiler ABI info failed to compile with the following output:\n${OUTPUT}\n\n")
+ "Detecting ${lang} compiler ABI info failed to compile with the following output:\n${OUTPUT}\n${_copy_error}\n\n")
endif()
endif()
endfunction()
diff --git a/Modules/CMakeMinGWFindMake.cmake b/Modules/CMakeMinGWFindMake.cmake
index efba20a..d7298dc 100644
--- a/Modules/CMakeMinGWFindMake.cmake
+++ b/Modules/CMakeMinGWFindMake.cmake
@@ -14,7 +14,9 @@
find_program(CMAKE_MAKE_PROGRAM mingw32-make.exe PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
- c:/MinGW/bin /MinGW/bin)
+ c:/MinGW/bin /MinGW/bin
+ "[HKEY_CURRENT_USER\\Software\\CodeBlocks;Path]/MinGW/bin"
+ )
find_program(CMAKE_SH sh.exe )
if(CMAKE_SH)
message(FATAL_ERROR "sh.exe was found in your PATH, here:\n${CMAKE_SH}\nFor MinGW make to work correctly sh.exe must NOT be in your path.\nRun cmake from a shell that does not have sh.exe in your PATH.\nIf you want to use a UNIX shell, then use MSYS Makefiles.\n")
diff --git a/Modules/CPackWIX.cmake b/Modules/CPackWIX.cmake
index 0c0a8f1..fce25f0 100644
--- a/Modules/CPackWIX.cmake
+++ b/Modules/CPackWIX.cmake
@@ -76,6 +76,32 @@
# This image must be 493 by 312 pixels.
#
##end
+#
+##variable
+# CPACK_WIX_PROGRAM_MENU_FOLDER - Start menu folder name for launcher.
+#
+# If this variable is not set, it will be initialized with CPACK_PACKAGE_NAME
+#
+##end
+##variable
+# CPACK_WIX_CULTURES - Language(s) of the installer
+#
+# Languages are compiled into the WixUI extension library. To use them,
+# simply provide the name of the culture. If you specify more than one
+# culture identifier in a comma or semicolon delimited list, the first one
+# that is found will be used. You can find a list of supported languages at:
+# http://wix.sourceforge.net/manual-wix3/WixUI_localization.htm
+#
+##end
+##variable
+# CPACK_WIX_TEMPLATE - Template file for WiX generation
+#
+# If this variable is set, the specified template will be used to generate the WiX wxs file.
+# This should be used if further customization of the output is required.
+#
+# If this variable is not set, the default MSI template included with CMake will be used.
+#
+##end
#=============================================================================
# Copyright 2012 Kitware, Inc.
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 5a680e3..0390ae4 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -607,7 +607,11 @@ macro(cuda_find_library_local_first_with_path_ext _var _names _doc _path_ext )
NO_DEFAULT_PATH
)
# Search default search paths, after we search our own set of paths.
- find_library(${_var} NAMES ${_names} DOC ${_doc})
+ find_library(${_var}
+ NAMES ${_names}
+ PATHS "/usr/lib/nvidia-current"
+ DOC ${_doc}
+ )
endmacro()
macro(cuda_find_library_local_first _var _names _doc)
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 7b37e1e..7e9caa2 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -886,20 +886,16 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
endforeach()
if(Q_WS_WIN)
- if (QT_QAXCONTAINER_FOUND)
- set(QT_MODULES ${QT_MODULES} QAxContainer)
- # Set QT_AXCONTAINER_INCLUDE_DIR and QT_AXSERVER_INCLUDE_DIR
- find_path(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt
- PATHS ${QT_HEADERS_DIR}/ActiveQt
- NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
- )
- endif()
- if (QT_QAXSERVER_FOUND)
- find_path(QT_QAXSERVER_INCLUDE_DIR ActiveQt
- PATHS ${QT_HEADERS_DIR}/ActiveQt
- NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
- )
- endif()
+ set(QT_MODULES ${QT_MODULES} QAxContainer)
+ # Set QT_AXCONTAINER_INCLUDE_DIR and QT_AXSERVER_INCLUDE_DIR
+ find_path(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt
+ PATHS ${QT_HEADERS_DIR}/ActiveQt
+ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
+ )
+ find_path(QT_QAXSERVER_INCLUDE_DIR ActiveQt
+ PATHS ${QT_HEADERS_DIR}/ActiveQt
+ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
+ )
endif()
# Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR
@@ -1060,8 +1056,8 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
if(Q_WS_WIN)
_QT4_ADJUST_LIB_VARS(qtmain)
+ _QT4_ADJUST_LIB_VARS(QAxServer)
if(QT_QAXSERVER_FOUND)
- _QT4_ADJUST_LIB_VARS(QAxServer)
set_property(TARGET Qt4::QAxServer PROPERTY
INTERFACE_QT4_NO_LINK_QTMAIN ON
)
@@ -1069,9 +1065,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
COMPATIBLE_INTERFACE_BOOL QT4_NO_LINK_QTMAIN)
endif()
- if(QT_QAXCONTAINER_FOUND)
- _QT4_ADJUST_LIB_VARS(QAxContainer)
- endif()
+ _QT4_ADJUST_LIB_VARS(QAxContainer)
endif()
# Only public dependencies are listed here.
diff --git a/Modules/SelectLibraryConfigurations.cmake b/Modules/SelectLibraryConfigurations.cmake
index 5bca064..297e1d3 100644
--- a/Modules/SelectLibraryConfigurations.cmake
+++ b/Modules/SelectLibraryConfigurations.cmake
@@ -3,16 +3,18 @@
# This macro takes a library base name as an argument, and will choose good
# values for basename_LIBRARY, basename_LIBRARIES, basename_LIBRARY_DEBUG, and
# basename_LIBRARY_RELEASE depending on what has been found and set. If only
-# basename_LIBRARY_RELEASE is defined, basename_LIBRARY, basename_LIBRARY_DEBUG,
-# and basename_LIBRARY_RELEASE will be set to the release value. If only
-# basename_LIBRARY_DEBUG is defined, then basename_LIBRARY,
-# basename_LIBRARY_DEBUG and basename_LIBRARY_RELEASE will take the debug value.
+# basename_LIBRARY_RELEASE is defined, basename_LIBRARY will be set to the
+# release value, and basename_LIBRARY_DEBUG will be set to
+# basename_LIBRARY_DEBUG-NOTFOUND. If only basename_LIBRARY_DEBUG is defined,
+# then basename_LIBRARY will take the debug value, and basename_LIBRARY_RELEASE
+# will be set to basename_LIBRARY_RELEASE-NOTFOUND.
#
# If the generator supports configuration types, then basename_LIBRARY and
# basename_LIBRARIES will be set with debug and optimized flags specifying the
# library to be used for the given configuration. If no build type has been set
# or the generator in use does not support configuration types, then
-# basename_LIBRARY and basename_LIBRARIES will take only the release values.
+# basename_LIBRARY and basename_LIBRARIES will take only the release value, or
+# the debug value if the release one is not set.
#=============================================================================
# Copyright 2009 Will Dicharry <wdicharry@stellarscience.com>
@@ -31,57 +33,41 @@
# This macro was adapted from the FindQt4 CMake module and is maintained by Will
# Dicharry <wdicharry@stellarscience.com>.
-# Utility macro to check if one variable exists while another doesn't, and set
-# one that doesn't exist to the one that exists.
-macro( _set_library_name basename GOOD BAD )
- if( ${basename}_LIBRARY_${GOOD} AND NOT ${basename}_LIBRARY_${BAD} )
- set( ${basename}_LIBRARY_${BAD} ${${basename}_LIBRARY_${GOOD}} )
- set( ${basename}_LIBRARY ${${basename}_LIBRARY_${GOOD}} )
- set( ${basename}_LIBRARIES ${${basename}_LIBRARY_${GOOD}} )
- endif()
-endmacro()
-
macro( select_library_configurations basename )
- # if only the release version was found, set the debug to be the release
- # version.
- _set_library_name( ${basename} RELEASE DEBUG )
- # if only the debug version was found, set the release value to be the
- # debug value.
- _set_library_name( ${basename} DEBUG RELEASE )
-
- # Set a default case, which will come into effect if
- # -no build type is set and the generator only supports one build type
- # at a time (i.e. CMAKE_CONFIGURATION_TYPES is false)
- # -${basename}_LIBRARY_DEBUG and ${basename}_LIBRARY_RELEASE are the same
- # -${basename}_LIBRARY_DEBUG and ${basename}_LIBRARY_RELEASE are both empty
- set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
- set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} )
+ if(NOT ${basename}_LIBRARY_RELEASE)
+ set(${basename}_LIBRARY_RELEASE "${basename}_LIBRARY_RELEASE-NOTFOUND" CACHE FILEPATH "Path to a library.")
+ endif()
+ if(NOT ${basename}_LIBRARY_DEBUG)
+ set(${basename}_LIBRARY_DEBUG "${basename}_LIBRARY_DEBUG-NOTFOUND" CACHE FILEPATH "Path to a library.")
+ endif()
if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND
- NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE )
+ NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE AND
+ ( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) )
# if the generator supports configuration types or CMAKE_BUILD_TYPE
# is set, then set optimized and debug options.
- if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
- set( ${basename}_LIBRARY "" )
- foreach( _libname IN LISTS ${basename}_LIBRARY_RELEASE )
- list( APPEND ${basename}_LIBRARY optimized "${_libname}" )
- endforeach()
- foreach( _libname IN LISTS ${basename}_LIBRARY_DEBUG )
- list( APPEND ${basename}_LIBRARY debug "${_libname}" )
- endforeach()
- set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" )
- endif()
+ set( ${basename}_LIBRARY "" )
+ foreach( _libname IN LISTS ${basename}_LIBRARY_RELEASE )
+ list( APPEND ${basename}_LIBRARY optimized "${_libname}" )
+ endforeach()
+ foreach( _libname IN LISTS ${basename}_LIBRARY_DEBUG )
+ list( APPEND ${basename}_LIBRARY debug "${_libname}" )
+ endforeach()
+ elseif( ${basename}_LIBRARY_RELEASE )
+ set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
+ elseif( ${basename}_LIBRARY_DEBUG )
+ set( ${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG} )
+ else()
+ set( ${basename}_LIBRARY "${basename}_LIBRARY-NOTFOUND")
endif()
- set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH
- "The ${basename} library" )
+ set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" )
if( ${basename}_LIBRARY )
set( ${basename}_FOUND TRUE )
endif()
- mark_as_advanced( ${basename}_LIBRARY
- ${basename}_LIBRARY_RELEASE
+ mark_as_advanced( ${basename}_LIBRARY_RELEASE
${basename}_LIBRARY_DEBUG
)
endmacro()
diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index f518b14..c0fd07c 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -192,7 +192,7 @@
#=============================================================================
# Copyright 2013 OpenGamma Ltd. <graham@opengamma.com>
# Copyright 2010-2011 Andreas schneider <asn@redhat.com>
-# Copyright 2010 Ben Boeckel <ben.boeckel@kitware.com>
+# Copyright 2010-2013 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 8d486cb..67b502d 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,5 +2,5 @@
set(CMake_VERSION_MAJOR 2)
set(CMake_VERSION_MINOR 8)
set(CMake_VERSION_PATCH 11)
-set(CMake_VERSION_TWEAK 20130717)
+set(CMake_VERSION_TWEAK 20130724)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index e8b0ea9..cc9dec7 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -100,6 +100,11 @@ bool cmCPackWIXGenerator::RunLightCommand(const std::string& objectFiles)
command << " -nologo";
command << " -out " << QuotePath(packageFileNames.at(0));
command << " -ext WixUIExtension";
+ const char* const cultures = GetOption("CPACK_WIX_CULTURES");
+ if(cultures)
+ {
+ command << " -cultures:" << cultures;
+ }
command << " " << objectFiles;
return RunWiXCommand(command.str());
@@ -224,6 +229,9 @@ bool cmCPackWIXGenerator::CreateWiXVariablesIncludeFile()
CopyDefinition(includeFile, "CPACK_WIX_PRODUCT_ICON");
CopyDefinition(includeFile, "CPACK_WIX_UI_BANNER");
CopyDefinition(includeFile, "CPACK_WIX_UI_DIALOG");
+ SetOptionIfNotSet("CPACK_WIX_PROGRAM_MENU_FOLDER",
+ GetOption("CPACK_PACKAGE_NAME"));
+ CopyDefinition(includeFile, "CPACK_WIX_PROGRAM_MENU_FOLDER");
return true;
}
@@ -339,25 +347,114 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
featureDefinitions.BeginElement("FeatureRef");
featureDefinitions.AddAttribute("Id", "ProductFeature");
+ const char *cpackPackageExecutables = GetOption("CPACK_PACKAGE_EXECUTABLES");
+ std::vector<std::string> cpackPkgExecutables;
+ std::string regKey;
+ if ( cpackPackageExecutables )
+ {
+ cmSystemTools::ExpandListArgument(cpackPackageExecutables,
+ cpackPkgExecutables);
+ if ( cpackPkgExecutables.size() % 2 != 0 )
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "CPACK_PACKAGE_EXECUTABLES should contain pairs of <executable> and "
+ "<icon name>." << std::endl);
+ cpackPkgExecutables.clear();
+ }
+
+ const char *cpackVendor = GetOption("CPACK_PACKAGE_VENDOR");
+ const char *cpackPkgName = GetOption("CPACK_PACKAGE_NAME");
+ if (!cpackVendor || !cpackPkgName)
+ {
+ cmCPackLogger(cmCPackLog::LOG_WARNING, "CPACK_PACKAGE_VENDOR and "
+ "CPACK_PACKAGE_NAME must be defined for shortcut creation" << std::endl);
+ cpackPkgExecutables.clear();
+ }
+ else
+ {
+ regKey = std::string("Software/") + cpackVendor + "/" + cpackPkgName;
+ }
+ }
+
+ std::vector<std::string> dirIdExecutables;
AddDirectoryAndFileDefinitons(
toplevel, "INSTALL_ROOT",
directoryDefinitions, fileDefinitions, featureDefinitions,
- directoryCounter, fileCounter);
+ directoryCounter, fileCounter, cpackPkgExecutables, dirIdExecutables);
- featureDefinitions.EndElement();
- featureDefinitions.EndElement();
- fileDefinitions.EndElement();
+ directoryDefinitions.EndElement();
+ directoryDefinitions.EndElement();
- for(size_t i = 1; i < install_root.size(); ++i)
+ if (dirIdExecutables.size() > 0 && dirIdExecutables.size() % 3 == 0)
{
- directoryDefinitions.EndElement();
- }
+ fileDefinitions.BeginElement("DirectoryRef");
+ fileDefinitions.AddAttribute("Id", "PROGRAM_MENU_FOLDER");
+ fileDefinitions.BeginElement("Component");
+ fileDefinitions.AddAttribute("Id", "SHORTCUT");
+ fileDefinitions.AddAttribute("Guid", "*");
- directoryDefinitions.EndElement();
- directoryDefinitions.EndElement();
+ std::vector<std::string>::iterator it;
+ for ( it = dirIdExecutables.begin() ;
+ it != dirIdExecutables.end();
+ ++it)
+ {
+ std::string fileName = *it++;
+ std::string iconName = *it++;
+ std::string directoryId = *it;
+
+ fileDefinitions.BeginElement("Shortcut");
+ std::string shortcutName = fileName; // the iconName is mor likely to contain blanks early on
+ std::string::size_type const dotPos = shortcutName.find('.');
+ if(std::string::npos == dotPos)
+ { shortcutName = shortcutName.substr(0, dotPos); }
+ fileDefinitions.AddAttribute("Id", "SHORTCUT_" + shortcutName);
+ fileDefinitions.AddAttribute("Name", iconName);
+ std::string target = "[" + directoryId + "]" + fileName;
+ fileDefinitions.AddAttribute("Target", target);
+ fileDefinitions.AddAttribute("WorkingDirectory", directoryId);
+ fileDefinitions.EndElement();
+ }
+ fileDefinitions.BeginElement("Shortcut");
+ fileDefinitions.AddAttribute("Id", "UNINSTALL");
+ std::string pkgName = GetOption("CPACK_PACKAGE_NAME");
+ fileDefinitions.AddAttribute("Name", "Uninstall " + pkgName);
+ fileDefinitions.AddAttribute("Description", "Uninstalls " + pkgName);
+ fileDefinitions.AddAttribute("Target", "[SystemFolder]msiexec.exe");
+ fileDefinitions.AddAttribute("Arguments", "/x [ProductCode]");
+ fileDefinitions.EndElement();
+ fileDefinitions.BeginElement("RemoveFolder");
+ fileDefinitions.AddAttribute("Id", "PROGRAM_MENU_FOLDER");
+ fileDefinitions.AddAttribute("On", "uninstall");
+ fileDefinitions.EndElement();
+ fileDefinitions.BeginElement("RegistryValue");
+ fileDefinitions.AddAttribute("Root", "HKCU");
+ fileDefinitions.AddAttribute("Key", regKey);
+ fileDefinitions.AddAttribute("Name", "installed");
+ fileDefinitions.AddAttribute("Type", "integer");
+ fileDefinitions.AddAttribute("Value", "1");
+ fileDefinitions.AddAttribute("KeyPath", "yes");
+
+ featureDefinitions.BeginElement("ComponentRef");
+ featureDefinitions.AddAttribute("Id", "SHORTCUT");
+ featureDefinitions.EndElement();
+ directoryDefinitions.BeginElement("Directory");
+ directoryDefinitions.AddAttribute("Id", "ProgramMenuFolder");
+ directoryDefinitions.BeginElement("Directory");
+ directoryDefinitions.AddAttribute("Id", "PROGRAM_MENU_FOLDER");
+ const char *startMenuFolder = GetOption("CPACK_WIX_PROGRAM_MENU_FOLDER");
+ directoryDefinitions.AddAttribute("Name", startMenuFolder);
+ }
+
+ featureDefinitions.EndElement();
+ featureDefinitions.EndElement();
+ fileDefinitions.EndElement();
directoryDefinitions.EndElement();
std::string wixTemplate = FindTemplate("WIX.template.in");
+ if(GetOption("CPACK_WIX_TEMPLATE") != 0)
+ {
+ wixTemplate = GetOption("CPACK_WIX_TEMPLATE");
+ }
if(wixTemplate.empty())
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
@@ -435,7 +532,9 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons(
cmWIXSourceWriter& fileDefinitions,
cmWIXSourceWriter& featureDefinitions,
size_t& directoryCounter,
- size_t& fileCounter)
+ size_t& fileCounter,
+ const std::vector<std::string>& pkgExecutables,
+ std::vector<std::string>& dirIdExecutables)
{
cmsys::Directory dir;
dir.Load(topdir.c_str());
@@ -467,8 +566,9 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons(
fileDefinitions,
featureDefinitions,
directoryCounter,
- fileCounter);
-
+ fileCounter,
+ pkgExecutables,
+ dirIdExecutables);
directoryDefinitions.EndElement();
}
else
@@ -499,6 +599,23 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons(
featureDefinitions.BeginElement("ComponentRef");
featureDefinitions.AddAttribute("Id", componentId);
featureDefinitions.EndElement();
+
+ std::vector<std::string>::const_iterator it;
+ for (it = pkgExecutables.begin() ;
+ it != pkgExecutables.end() ;
+ ++it)
+ {
+ std::string execName = *it++;
+ std::string iconName = *it;
+
+ if (cmSystemTools::LowerCase(fileName) ==
+ cmSystemTools::LowerCase(execName) + ".exe")
+ {
+ dirIdExecutables.push_back(fileName);
+ dirIdExecutables.push_back(iconName);
+ dirIdExecutables.push_back(directoryId);
+ }
+ }
}
}
}
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h
index 0e95d70..aaccf9d 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.h
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.h
@@ -83,7 +83,11 @@ private:
cmWIXSourceWriter& fileDefinitions,
cmWIXSourceWriter& featureDefinitions,
size_t& directoryCounter,
- size_t& fileCounter);
+ size_t& fileCounter,
+ const std::vector<std::string>& pkgExecutables,
+ std::vector<std::string>& dirIdExecutables
+ );
+
bool RequireOption(const std::string& name, std::string& value) const;
diff --git a/Source/cmAddCompileOptionsCommand.h b/Source/cmAddCompileOptionsCommand.h
index 4504795..e9bbf28 100644
--- a/Source/cmAddCompileOptionsCommand.h
+++ b/Source/cmAddCompileOptionsCommand.h
@@ -62,7 +62,6 @@ public:
"Arguments to add_compile_options may use \"generator "
"expressions\" with the syntax \"$<...>\". "
CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
- CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS
;
}
diff --git a/Source/cmAddTestCommand.h b/Source/cmAddTestCommand.h
index 6a0cd9d..ec7fda3 100644
--- a/Source/cmAddTestCommand.h
+++ b/Source/cmAddTestCommand.h
@@ -71,6 +71,9 @@ public:
" add_test(NAME <name> [CONFIGURATIONS [Debug|Release|...]]\n"
" [WORKING_DIRECTORY dir]\n"
" COMMAND <command> [arg1 [arg2 ...]])\n"
+ "Add a test called <name>. "
+ "The test name may not contain spaces, quotes, or other characters "
+ "special in CMake syntax. "
"If COMMAND specifies an executable target (created by "
"add_executable) it will automatically be replaced by the location "
"of the executable created at build time. "
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index ab9eb14..fb7b5b6 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1345,12 +1345,23 @@ void cmComputeLinkInformation::AddFrameworkItem(std::string const& item)
return;
}
+ std::string fw_path = this->SplitFramework.match(1);
+ std::string fw = this->SplitFramework.match(2);
+ std::string full_fw = fw_path;
+ full_fw += "/";
+ full_fw += fw;
+ full_fw += ".framework";
+ full_fw += "/";
+ full_fw += fw;
+
// Add the directory portion to the framework search path.
- this->AddFrameworkPath(this->SplitFramework.match(1));
+ this->AddFrameworkPath(fw_path);
+
+ // add runtime information
+ this->AddLibraryRuntimeInfo(full_fw);
// Add the item using the -framework option.
this->Items.push_back(Item("-framework", false));
- std::string fw = this->SplitFramework.match(2);
fw = this->LocalGenerator->EscapeForShell(fw.c_str());
this->Items.push_back(Item(fw, false));
}
@@ -1813,9 +1824,10 @@ cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath)
if(fullPath.find(".framework") != std::string::npos)
{
cmsys::RegularExpression splitFramework;
- splitFramework.compile("^(.*)/(.*).framework/.*/(.*)$");
+ splitFramework.compile("^(.*)/(.*).framework/(.*)$");
if(splitFramework.find(fullPath) &&
- (splitFramework.match(2) == splitFramework.match(3)))
+ (std::string::npos !=
+ splitFramework.match(3).find(splitFramework.match(2))))
{
is_shared_library = true;
}
diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx
index bd860ee..3620a38 100644
--- a/Source/cmCustomCommand.cxx
+++ b/Source/cmCustomCommand.cxx
@@ -13,6 +13,8 @@
#include "cmMakefile.h"
+#include <cmsys/auto_ptr.hxx>
+
//----------------------------------------------------------------------------
cmCustomCommand::cmCustomCommand()
{
@@ -36,6 +38,32 @@ cmCustomCommand::cmCustomCommand(const cmCustomCommand& r):
}
//----------------------------------------------------------------------------
+cmCustomCommand& cmCustomCommand::operator=(cmCustomCommand const& r)
+{
+ if(this == &r)
+ {
+ return *this;
+ }
+
+ this->Outputs = r.Outputs;
+ this->Depends = r.Depends;
+ this->CommandLines = r.CommandLines;
+ this->HaveComment = r.HaveComment;
+ this->Comment = r.Comment;
+ this->WorkingDirectory = r.WorkingDirectory;
+ this->EscapeAllowMakeVars = r.EscapeAllowMakeVars;
+ this->EscapeOldStyle = r.EscapeOldStyle;
+ this->ImplicitDepends = r.ImplicitDepends;
+
+ cmsys::auto_ptr<cmListFileBacktrace>
+ newBacktrace(new cmListFileBacktrace(*r.Backtrace));
+ delete this->Backtrace;
+ this->Backtrace = newBacktrace.release();
+
+ return *this;
+}
+
+//----------------------------------------------------------------------------
cmCustomCommand::cmCustomCommand(cmMakefile* mf,
const std::vector<std::string>& outputs,
const std::vector<std::string>& depends,
diff --git a/Source/cmCustomCommand.h b/Source/cmCustomCommand.h
index dd92e34..e20d2bf 100644
--- a/Source/cmCustomCommand.h
+++ b/Source/cmCustomCommand.h
@@ -27,6 +27,7 @@ public:
/** Default and copy constructors for STL containers. */
cmCustomCommand();
cmCustomCommand(const cmCustomCommand& r);
+ cmCustomCommand& operator=(cmCustomCommand const& r);
/** Main constructor specifies all information for the command. */
cmCustomCommand(cmMakefile* mf,
diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h
index 841061c..46cd77e 100644
--- a/Source/cmDocumentGeneratorExpressions.h
+++ b/Source/cmDocumentGeneratorExpressions.h
@@ -95,12 +95,4 @@
"the target on which the generator expression is evaluated.\n" \
""
-#define CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS \
- "Language related expressions:\n" \
- " $<LINK_LANGUAGE> = The link language of the target " \
- "being generated.\n" \
- " $<LINK_LANGUAGE:lang> = '1' if the link language of the " \
- "target being generated matches lang, else '0'.\n" \
- ""
-
#endif
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index b4e6e81..90e6d51 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -792,7 +792,9 @@ void cmExportFileGenerator::GenerateImportVersionCode(std::ostream& os)
void cmExportFileGenerator::GenerateExpectedTargetsCode(std::ostream& os,
const std::string &expectedTargets)
{
- os << "set(_targetsDefined)\n"
+ os << "# Protect against multiple inclusion, which would fail when already "
+ "imported targets are added once more.\n"
+ "set(_targetsDefined)\n"
"set(_targetsNotDefined)\n"
"set(_expectedTargets)\n"
"foreach(_expectedTarget " << expectedTargets << ")\n"
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 381ef7c..b59298f 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -564,77 +564,30 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
const char* loc = 0;
const char* imp = 0;
std::string suffix;
- return context->CurrentTarget->GetMappedConfig(context->Config,
+ if (context->CurrentTarget->GetMappedConfig(context->Config,
&loc,
&imp,
- suffix) ? "1" : "0";
- }
- return "0";
- }
-} configurationTestNode;
-
-//----------------------------------------------------------------------------
-static const struct LinkLanguageNode : public cmGeneratorExpressionNode
-{
- LinkLanguageNode() {}
-
- virtual int NumExpectedParameters() const { return ZeroOrMoreParameters; }
-
- std::string Evaluate(const std::vector<std::string> &parameters,
- cmGeneratorExpressionContext *context,
- const GeneratorExpressionContent *content,
- cmGeneratorExpressionDAGChecker *dagChecker) const
- {
- if (dagChecker && dagChecker->EvaluatingLinkLibraries())
- {
- reportError(context, content->GetOriginalExpression(),
- "$<LINK_LANGUAGE> expression can not be used while evaluating "
- "link libraries");
- return std::string();
- }
- if (parameters.size() != 0 && parameters.size() != 1)
- {
- reportError(context, content->GetOriginalExpression(),
- "$<LINK_LANGUAGE> expression requires one or two parameters");
- return std::string();
- }
- cmTarget* target = context->HeadTarget;
- if (!target)
- {
- reportError(context, content->GetOriginalExpression(),
- "$<LINK_LANGUAGE> may only be used with targets. It may not "
- "be used with add_custom_command.");
- return std::string();
- }
-
- const char *lang = target->GetLinkerLanguage(context->Config);
- if (parameters.size() == 0)
- {
- return lang ? lang : "";
- }
- else
- {
- cmsys::RegularExpression langValidator;
- langValidator.compile("^[A-Za-z0-9_]*$");
- if (!langValidator.find(parameters.begin()->c_str()))
- {
- reportError(context, content->GetOriginalExpression(),
- "Expression syntax not recognized.");
- return std::string();
- }
- if (!lang)
- {
- return parameters.front().empty() ? "1" : "0";
- }
-
- if (strcmp(parameters.begin()->c_str(), lang) == 0)
+ suffix))
{
- return "1";
+ // This imported target has an appropriate location
+ // for this (possibly mapped) config.
+ // Check if there is a proper config mapping for the tested config.
+ std::vector<std::string> mappedConfigs;
+ std::string mapProp = "MAP_IMPORTED_CONFIG_";
+ mapProp += context->Config;
+ if(const char* mapValue =
+ context->CurrentTarget->GetProperty(mapProp.c_str()))
+ {
+ cmSystemTools::ExpandListArgument(cmSystemTools::UpperCase(mapValue),
+ mappedConfigs);
+ return std::find(mappedConfigs.begin(), mappedConfigs.end(),
+ context->Config) != mappedConfigs.end() ? "1" : "0";
+ }
}
- return "0";
}
+ return "0";
}
-} linkLanguageNode;
+} configurationTestNode;
static const struct JoinNode : public cmGeneratorExpressionNode
{
@@ -835,6 +788,19 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
assert(target);
+ if (propertyName == "LINKER_LANGUAGE")
+ {
+ if (dagCheckerParent && dagCheckerParent->EvaluatingLinkLibraries())
+ {
+ reportError(context, content->GetOriginalExpression(),
+ "LINKER_LANGUAGE target property can not be used while evaluating "
+ "link libraries");
+ return std::string();
+ }
+ const char *lang = target->GetLinkerLanguage(context->Config);
+ return lang ? lang : "";
+ }
+
cmGeneratorExpressionDAGChecker dagChecker(context->Backtrace,
target->GetName(),
propertyName,
@@ -1380,8 +1346,6 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier)
return &configurationNode;
else if (identifier == "CONFIG")
return &configurationTestNode;
- else if (identifier == "LINK_LANGUAGE")
- return &linkLanguageNode;
else if (identifier == "TARGET_FILE")
return &targetFileNode;
else if (identifier == "TARGET_LINKER_FILE")
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 9596ebc..61d0272 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -147,7 +147,7 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
//we need to track every dependency that comes in, since we are trying
//to find dependencies that are side effects of build commands
//
- this->CombinedBuildExplicitDependencies.insert(*i);
+ this->CombinedBuildExplicitDependencies.insert( EncodePath(*i) );
}
// Write implicit dependencies.
@@ -180,7 +180,7 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
i != outputs.end(); ++i)
{
build << " " << EncodeIdent(EncodePath(*i), os);
- this->CombinedBuildOutputs.insert(*i);
+ this->CombinedBuildOutputs.insert( EncodePath(*i) );
}
build << ":";
@@ -824,13 +824,19 @@ cmGlobalNinjaGenerator
cmLocalNinjaGenerator *ng =
static_cast<cmLocalNinjaGenerator *>(this->LocalGenerators[0]);
+ // for frameworks, we want the real name, not smple name
+ // frameworks always appear versioned, and the build.ninja
+ // will always attempt to manage symbolic links instead
+ // of letting cmOSXBundleGenerator do it.
+ bool realname = target->IsFrameworkOnApple();
+
switch (target->GetType()) {
case cmTarget::EXECUTABLE:
case cmTarget::SHARED_LIBRARY:
case cmTarget::STATIC_LIBRARY:
case cmTarget::MODULE_LIBRARY:
outputs.push_back(ng->ConvertToNinjaPath(
- target->GetFullPath(configName).c_str()));
+ target->GetFullPath(configName, false, realname).c_str()));
break;
case cmTarget::OBJECT_LIBRARY:
@@ -944,7 +950,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
typedef std::vector<std::string>::const_iterator vect_it;
for(vect_it j = files.begin(); j != files.end(); ++j)
{
- knownDependencies.insert(ng->ConvertToNinjaPath( j->c_str() ));
+ knownDependencies.insert( ng->ConvertToNinjaPath( j->c_str() ) );
}
}
@@ -959,26 +965,15 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
typedef std::vector<std::string>::const_iterator vect_it;
for(vect_it j = files.begin(); j != files.end(); ++j)
{
- knownDependencies.insert(ng->ConvertToNinjaPath( j->c_str() ));
+ knownDependencies.insert( ng->ConvertToNinjaPath( j->c_str() ) );
}
}
- //insert outputs from all WirteBuild commands
- for(std::set<std::string>::iterator i = this->CombinedBuildOutputs.begin();
- i != this->CombinedBuildOutputs.end(); ++i)
- {
- knownDependencies.insert(*i);
- }
-
- //after we have combined the data into knownDependencies we have no need
- //to keep this data around
- this->CombinedBuildOutputs.clear();
-
for(TargetAliasMap::const_iterator i= this->TargetAliases.begin();
i != this->TargetAliases.end();
++i)
{
- knownDependencies.insert(i->first);
+ knownDependencies.insert( ng->ConvertToNinjaPath(i->first.c_str()) );
}
//remove all source files we know will exist.
@@ -987,11 +982,26 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
i != this->AssumedSourceDependencies.end();
++i)
{
- knownDependencies.insert(i->first);
+ knownDependencies.insert( ng->ConvertToNinjaPath(i->first.c_str()) );
}
+ //insert outputs from all WirteBuild commands
+ for(std::set<std::string>::iterator i = this->CombinedBuildOutputs.begin();
+ i != this->CombinedBuildOutputs.end(); ++i)
+ {
+ //these paths have already be encoded when added to CombinedBuildOutputs
+ knownDependencies.insert(*i);
+ }
+
+ //after we have combined the data into knownDependencies we have no need
+ //to keep this data around
+ this->CombinedBuildOutputs.clear();
+
//now we difference with CombinedBuildExplicitDependencies to find
- //the list of items we know nothing about
+ //the list of items we know nothing about.
+ //We have encoded all the paths in CombinedBuildExplicitDependencies
+ //and knownDependencies so no matter if unix or windows paths they
+ //should all match now.
std::vector<std::string> unkownExplicitDepends;
this->CombinedBuildExplicitDependencies.erase("all");
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 4e871d6..b187d6b 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1380,7 +1380,7 @@ void cmLocalGenerator::AddCompileOptions(
// COMPILE_FLAGS are not escaped for historical reasons.
this->AppendFlags(flags, targetFlags);
}
- std::vector<std::string> opts; // TODO: Emitted.
+ std::vector<std::string> opts;
target->GetCompileOptions(opts, config);
for(std::vector<std::string>::const_iterator i = opts.begin();
i != opts.end(); ++i)
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 818a580..2cd19cf 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4087,8 +4087,7 @@ void cmMakefile::DefineProperties(cmake *cm)
"the options for the compiler.\n"
"Contents of COMPILE_OPTIONS may use \"generator expressions\" with "
"the syntax \"$<...>\". "
- CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
- CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS);
+ CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS);
cm->DefineProperty
("LINK_DIRECTORIES", cmProperty::DIRECTORY,
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index fa7e396..57adeba 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -265,7 +265,8 @@ cmNinjaNormalTargetGenerator
rspcontent);
}
- if (this->TargetNameOut != this->TargetNameReal) {
+ if (this->TargetNameOut != this->TargetNameReal &&
+ !this->GetTarget()->IsFrameworkOnApple()) {
std::string cmakeCommand =
this->GetLocalGenerator()->ConvertToOutputFormat(
this->GetMakefile()->GetRequiredDefinition("CMAKE_COMMAND"),
@@ -599,7 +600,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
rspfile,
commandLineLengthLimit);
- if (targetOutput != targetOutputReal) {
+ if (targetOutput != targetOutputReal &&
+ !this->GetTarget()->IsFrameworkOnApple()) {
if (targetType == cmTarget::EXECUTABLE) {
globalGenerator->WriteBuild(this->GetBuildFileStream(),
"Create executable symlink " + targetOutput,
diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx
index 93885b2..0220825 100644
--- a/Source/cmOrderDirectories.cxx
+++ b/Source/cmOrderDirectories.cxx
@@ -40,9 +40,10 @@ public:
if(file.rfind(".framework") != std::string::npos)
{
cmsys::RegularExpression splitFramework;
- splitFramework.compile("^(.*)/(.*).framework/.*/(.*)$");
+ splitFramework.compile("^(.*)/(.*).framework/(.*)$");
if(splitFramework.find(file) &&
- (splitFramework.match(2) == splitFramework.match(3)))
+ (std::string::npos !=
+ splitFramework.match(3).find(splitFramework.match(2))))
{
this->Directory = splitFramework.match(1);
this->FileName =
@@ -318,7 +319,6 @@ void cmOrderDirectories::AddRuntimeLibrary(std::string const& fullPath,
// Add the runtime library at most once.
if(this->EmmittedConstraintSOName.insert(fullPath).second)
{
- std::string soname2 = soname ? soname : "";
// Implicit link directories need special handling.
if(!this->ImplicitDirectories.empty())
{
@@ -327,16 +327,12 @@ void cmOrderDirectories::AddRuntimeLibrary(std::string const& fullPath,
if(fullPath.rfind(".framework") != std::string::npos)
{
cmsys::RegularExpression splitFramework;
- splitFramework.compile("^(.*)/(.*).framework/(.*)/(.*)$");
+ splitFramework.compile("^(.*)/(.*).framework/(.*)$");
if(splitFramework.find(fullPath) &&
- (splitFramework.match(2) == splitFramework.match(4)))
+ (std::string::npos !=
+ splitFramework.match(3).find(splitFramework.match(2))))
{
dir = splitFramework.match(1);
- soname2 = splitFramework.match(2);
- soname2 += ".framework/";
- soname2 += splitFramework.match(3);
- soname2 += "/";
- soname2 += splitFramework.match(4);
}
}
@@ -344,16 +340,14 @@ void cmOrderDirectories::AddRuntimeLibrary(std::string const& fullPath,
this->ImplicitDirectories.end())
{
this->ImplicitDirEntries.push_back(
- new cmOrderDirectoriesConstraintSOName(this, fullPath,
- soname2.c_str()));
+ new cmOrderDirectoriesConstraintSOName(this, fullPath, soname));
return;
}
}
// Construct the runtime information entry for this library.
this->ConstraintEntries.push_back(
- new cmOrderDirectoriesConstraintSOName(this, fullPath,
- soname2.c_str()));
+ new cmOrderDirectoriesConstraintSOName(this, fullPath, soname));
}
else
{
diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx
index cc10840..b5e5225 100644
--- a/Source/cmSetPropertyCommand.cxx
+++ b/Source/cmSetPropertyCommand.cxx
@@ -84,12 +84,14 @@ bool cmSetPropertyCommand
{
doing = DoingNone;
this->AppendMode = true;
+ this->Remove = false;
this->AppendAsString = false;
}
else if(*arg == "APPEND_STRING")
{
doing = DoingNone;
this->AppendMode = true;
+ this->Remove = false;
this->AppendAsString = true;
}
else if(doing == DoingNames)
@@ -160,7 +162,7 @@ bool cmSetPropertyCommand::HandleGlobalMode()
}
if(this->AppendMode)
{
- cm->AppendProperty(name, value, this->AppendAsString);
+ cm->AppendProperty(name, value ? value : "", this->AppendAsString);
}
else
{
@@ -226,7 +228,7 @@ bool cmSetPropertyCommand::HandleDirectoryMode()
}
if(this->AppendMode)
{
- mf->AppendProperty(name, value, this->AppendAsString);
+ mf->AppendProperty(name, value ? value : "", this->AppendAsString);
}
else
{
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 994e053..26bf9b7 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -292,7 +292,6 @@ void cmTarget::DefineProperties(cmake *cm)
"Contents of COMPILE_DEFINITIONS may use \"generator expressions\" with "
"the syntax \"$<...>\". "
CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
- CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS
CM_DOCUMENT_COMPILE_DEFINITIONS_DISCLAIMER);
cm->DefineProperty
@@ -311,8 +310,7 @@ void cmTarget::DefineProperties(cmake *cm)
"the options for the compiler.\n"
"Contents of COMPILE_OPTIONS may use \"generator expressions\" with "
"the syntax \"$<...>\". "
- CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
- CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS);
+ CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS);
cm->DefineProperty
("INTERFACE_COMPILE_OPTIONS", cmProperty::TARGET,
@@ -323,8 +321,7 @@ void cmTarget::DefineProperties(cmake *cm)
"as $<TARGET_PROPERTY:foo,INTERFACE_COMPILE_OPTIONS> to use the "
"compile options specified in the interface of 'foo'."
"\n"
- CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
- CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS);
+ CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS);
cm->DefineProperty
("DEFINE_SYMBOL", cmProperty::TARGET,
@@ -653,8 +650,7 @@ void cmTarget::DefineProperties(cmake *cm)
"See also the include_directories command.\n"
"Contents of INCLUDE_DIRECTORIES may use \"generator expressions\" with "
"the syntax \"$<...>\". "
- CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
- CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS);
+ CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS);
cm->DefineProperty
("INSTALL_NAME_DIR", cmProperty::TARGET,
@@ -749,7 +745,11 @@ void cmTarget::DefineProperties(cmake *cm)
"file providing the program entry point (main). "
"If not set, the language with the highest linker preference "
"value is the default. "
- "See documentation of CMAKE_<LANG>_LINKER_PREFERENCE variables.");
+ "See documentation of CMAKE_<LANG>_LINKER_PREFERENCE variables."
+ "\n"
+ "If this property is not set by the user, it will be calculated at "
+ "generate-time by CMake."
+ );
cm->DefineProperty
("LOCATION", cmProperty::TARGET,
@@ -870,8 +870,7 @@ void cmTarget::DefineProperties(cmake *cm)
"as $<TARGET_PROPERTY:foo,INTERFACE_INCLUDE_DIRECTORIES> to use the "
"include directories specified in the interface of 'foo'."
"\n"
- CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
- CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS);
+ CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS);
cm->DefineProperty
("SYSTEM_INTERFACE_INCLUDE_DIRECTORIES", cmProperty::TARGET,
@@ -881,8 +880,7 @@ void cmTarget::DefineProperties(cmake *cm)
"compiler warnings. Consuming targets will then mark the same include "
"directories as system headers."
"\n"
- CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
- CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS);
+ CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS);
cm->DefineProperty
("INTERFACE_COMPILE_DEFINITIONS", cmProperty::TARGET,
@@ -893,8 +891,7 @@ void cmTarget::DefineProperties(cmake *cm)
"as $<TARGET_PROPERTY:foo,INTERFACE_COMPILE_DEFINITIONS> to use the "
"compile definitions specified in the interface of 'foo'."
"\n"
- CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
- CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS);
+ CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS);
cm->DefineProperty
("LINK_INTERFACE_MULTIPLICITY", cmProperty::TARGET,
@@ -3206,7 +3203,7 @@ static void processIncludeDirectories(cmTarget *tgt,
{
e << "Target \"" << (*it)->TargetName << "\" contains relative "
"path in its INTERFACE_INCLUDE_DIRECTORIES:\n"
- " \"" << *li << "\" ";
+ " \"" << *li << "\"";
}
else
{
diff --git a/Source/cmTargetCompileDefinitionsCommand.h b/Source/cmTargetCompileDefinitionsCommand.h
index bc58b31..585485d 100644
--- a/Source/cmTargetCompileDefinitionsCommand.h
+++ b/Source/cmTargetCompileDefinitionsCommand.h
@@ -70,7 +70,6 @@ public:
"Arguments to target_compile_definitions may use \"generator "
"expressions\" with the syntax \"$<...>\". "
CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
- CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS
;
}
diff --git a/Source/cmTargetIncludeDirectoriesCommand.h b/Source/cmTargetIncludeDirectoriesCommand.h
index 2968618..fcc37f0 100644
--- a/Source/cmTargetIncludeDirectoriesCommand.h
+++ b/Source/cmTargetIncludeDirectoriesCommand.h
@@ -83,7 +83,6 @@ public:
"Arguments to target_include_directories may use \"generator "
"expressions\" with the syntax \"$<...>\". "
CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
- CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS
;
}
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index fcefaf9..440cdf0 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -225,6 +225,7 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(ObjectLibrary UseCshared)
ADD_TEST_MACRO(NewlineArgs NewlineArgs)
ADD_TEST_MACRO(SetLang SetLang)
+ ADD_TEST_MACRO(EmptyProperty EmptyProperty)
ADD_TEST_MACRO(ExternalOBJ ExternalOBJ)
ADD_TEST_MACRO(LoadCommand LoadedCommand)
ADD_TEST_MACRO(LinkDirectory bin/LinkDirectory)
diff --git a/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt b/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt
index 5bf0f8a..6d1628a 100644
--- a/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt
+++ b/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt
@@ -29,7 +29,7 @@ if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif ()
-check_slc(empty "")
+check_slc(empty "empty_LIBRARY-NOTFOUND")
set(OPTONLY_LIBRARY_RELEASE "opt")
check_slc(OPTONLY "opt")
diff --git a/Tests/CPackWiXGenerator/CMakeLists.txt b/Tests/CPackWiXGenerator/CMakeLists.txt
index ce02f11..475e60d 100644
--- a/Tests/CPackWiXGenerator/CMakeLists.txt
+++ b/Tests/CPackWiXGenerator/CMakeLists.txt
@@ -35,6 +35,8 @@ set(CPACK_PACKAGE_VERSION_PATCH "0")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "CPack Component Example")
set(CPACK_WIX_UPGRADE_GUID "BF20CE5E-7F7C-401D-8F7C-AB45E8D170E6")
+set(CPACK_WIX_UNINSTALL "1")
+set(CPACK_PACKAGE_EXECUTABLES "mylibapp; CPack Wix Test")
include(CPack)
diff --git a/Tests/CompileDefinitions/compiletest_mixed_c.c b/Tests/CompileDefinitions/compiletest_mixed_c.c
index 698c989..a270b2b 100644
--- a/Tests/CompileDefinitions/compiletest_mixed_c.c
+++ b/Tests/CompileDefinitions/compiletest_mixed_c.c
@@ -13,6 +13,10 @@
#error Unexpected LINK_LANGUAGE_IS_C
#endif
+#ifndef C_EXECUTABLE_LINK_LANGUAGE_IS_C
+#error Expected C_EXECUTABLE_LINK_LANGUAGE_IS_C define
+#endif
+
void someFunc(void)
{
diff --git a/Tests/CompileDefinitions/compiletest_mixed_cxx.cpp b/Tests/CompileDefinitions/compiletest_mixed_cxx.cpp
index c686854..ae6befc 100644
--- a/Tests/CompileDefinitions/compiletest_mixed_cxx.cpp
+++ b/Tests/CompileDefinitions/compiletest_mixed_cxx.cpp
@@ -13,6 +13,10 @@
#error Unexpected LINK_LANGUAGE_IS_C
#endif
+#ifndef C_EXECUTABLE_LINK_LANGUAGE_IS_C
+#error Expected C_EXECUTABLE_LINK_LANGUAGE_IS_C define
+#endif
+
int main(int argc, char **argv)
{
return 0;
diff --git a/Tests/CompileDefinitions/target_prop/CMakeLists.txt b/Tests/CompileDefinitions/target_prop/CMakeLists.txt
index 6bf9c5c..a0d3f4e 100644
--- a/Tests/CompileDefinitions/target_prop/CMakeLists.txt
+++ b/Tests/CompileDefinitions/target_prop/CMakeLists.txt
@@ -23,9 +23,9 @@ set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS
LETTER_LIST3=\"$<JOIN:A;B;C;D,,->\"
LETTER_LIST4=\"$<JOIN:A;B;C;D,-,->\"
LETTER_LIST5=\"$<JOIN:A;B;C;D,-,>\"
- "$<$<LINK_LANGUAGE:CXX>:LINK_CXX_DEFINE>"
- "$<$<LINK_LANGUAGE:C>:LINK_C_DEFINE>"
- "LINK_LANGUAGE_IS_$<LINK_LANGUAGE>"
+ "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:LINK_CXX_DEFINE>"
+ "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,C>:LINK_C_DEFINE>"
+ "LINK_LANGUAGE_IS_$<TARGET_PROPERTY:LINKER_LANGUAGE>"
)
set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS
@@ -36,16 +36,17 @@ set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS
add_executable(target_prop_c_executable ../compiletest.c)
set_property(TARGET target_prop_c_executable APPEND PROPERTY COMPILE_DEFINITIONS
- "$<$<LINK_LANGUAGE:CXX>:LINK_CXX_DEFINE>"
- "$<$<LINK_LANGUAGE:C>:LINK_C_DEFINE>"
- "LINK_LANGUAGE_IS_$<LINK_LANGUAGE>"
+ "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:LINK_CXX_DEFINE>"
+ "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,C>:LINK_C_DEFINE>"
+ "LINK_LANGUAGE_IS_$<TARGET_PROPERTY:LINKER_LANGUAGE>"
)
# Resulting link language will be CXX
add_executable(target_prop_mixed_executable ../compiletest_mixed_c.c ../compiletest_mixed_cxx.cpp)
set_property(TARGET target_prop_mixed_executable APPEND PROPERTY COMPILE_DEFINITIONS
- "$<$<LINK_LANGUAGE:CXX>:LINK_CXX_DEFINE>"
- "$<$<LINK_LANGUAGE:C>:LINK_C_DEFINE>"
- "LINK_LANGUAGE_IS_$<LINK_LANGUAGE>"
+ "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:LINK_CXX_DEFINE>"
+ "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,C>:LINK_C_DEFINE>"
+ "LINK_LANGUAGE_IS_$<TARGET_PROPERTY:LINKER_LANGUAGE>"
+ "C_EXECUTABLE_LINK_LANGUAGE_IS_$<TARGET_PROPERTY:target_prop_c_executable,LINKER_LANGUAGE>"
)
diff --git a/Tests/EmptyProperty/CMakeLists.txt b/Tests/EmptyProperty/CMakeLists.txt
new file mode 100644
index 0000000..39e75f3
--- /dev/null
+++ b/Tests/EmptyProperty/CMakeLists.txt
@@ -0,0 +1,9 @@
+project (EmptyProperty)
+
+set_property(DIRECTORY APPEND
+ PROPERTY
+ COMPILE_DEFINITIONS)
+
+include(CTest)
+
+add_executable(EmptyProperty EmptyProperty.cxx)
diff --git a/Tests/EmptyProperty/EmptyProperty.cxx b/Tests/EmptyProperty/EmptyProperty.cxx
new file mode 100644
index 0000000..78f2de1
--- /dev/null
+++ b/Tests/EmptyProperty/EmptyProperty.cxx
@@ -0,0 +1 @@
+int main(void) { return 0; }
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index ab936ca..7ac6ede 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -138,6 +138,31 @@ add_custom_target(check-part2 ALL
VERBATIM
)
+add_library(imported1 SHARED IMPORTED)
+set_property(TARGET imported1 PROPERTY IMPORTED_LOCATION_RELEASE release_loc)
+set_property(TARGET imported1 PROPERTY IMPORTED_LOCATION_DEBUG debug_loc)
+set_property(TARGET imported1 PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG)
+set_property(TARGET imported1 PROPERTY INTERFACE_INCLUDE_DIRECTORIES /imported1/include)
+
+add_library(imported2 SHARED IMPORTED)
+set_property(TARGET imported2 PROPERTY IMPORTED_LOCATION_RELEASE release_loc)
+set_property(TARGET imported2 PROPERTY IMPORTED_LOCATION_DEBUG debug_loc)
+set_property(TARGET imported2 PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG)
+set_property(TARGET imported2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES /imported2/include)
+
+add_library(imported3 SHARED IMPORTED)
+set_property(TARGET imported3 PROPERTY IMPORTED_LOCATION_RELEASE release_loc)
+set_property(TARGET imported3 PROPERTY IMPORTED_LOCATION_DEBUG debug_loc)
+# Both Debug and Release should not be true when this is evaluated.
+set_property(TARGET imported3 APPEND PROPERTY
+ INTERFACE_INCLUDE_DIRECTORIES $<$<CONFIG:DEBUG>:$<TARGET_PROPERTY:imported1,INTERFACE_INCLUDE_DIRECTORIES>>)
+set_property(TARGET imported3 APPEND PROPERTY
+ INTERFACE_INCLUDE_DIRECTORIES $<$<CONFIG:RELEASE>:$<TARGET_PROPERTY:imported2,INTERFACE_INCLUDE_DIRECTORIES>>)
+
+add_library(imported4 SHARED IMPORTED)
+set_property(TARGET imported4 APPEND PROPERTY
+ INCLUDE_DIRECTORIES $<TARGET_PROPERTY:imported3,INTERFACE_INCLUDE_DIRECTORIES>)
+
add_custom_target(check-part3 ALL
COMMAND ${CMAKE_COMMAND}
-Dtest_version_greater_1=$<VERSION_GREATER:1.0,1.1.1>
@@ -146,6 +171,11 @@ add_custom_target(check-part3 ALL
-Dtest_version_less_2=$<VERSION_LESS:1.0,1.1.1>
-Dtest_version_equal_1=$<VERSION_EQUAL:1.0.1,1.1>
-Dtest_version_equal_2=$<VERSION_EQUAL:1.1,1.1>
+ -Dconfig=$<CONFIGURATION>
+ -Dtest_imported_debug=$<TARGET_PROPERTY:imported4,INCLUDE_DIRECTORIES>
+ -Dtest_imported_release=$<TARGET_PROPERTY:imported4,INCLUDE_DIRECTORIES>
+ -Dtest_imported_relwithdebinfo=$<TARGET_PROPERTY:imported4,INCLUDE_DIRECTORIES>
+ -Dtest_imported_minsizerel=$<TARGET_PROPERTY:imported4,INCLUDE_DIRECTORIES>
-P ${CMAKE_CURRENT_SOURCE_DIR}/check-part3.cmake
COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 3)"
VERBATIM
diff --git a/Tests/GeneratorExpression/check-part3.cmake b/Tests/GeneratorExpression/check-part3.cmake
index 70d6571..af290a5 100644
--- a/Tests/GeneratorExpression/check-part3.cmake
+++ b/Tests/GeneratorExpression/check-part3.cmake
@@ -7,3 +7,16 @@ check(test_version_less_1 "0")
check(test_version_less_2 "1")
check(test_version_equal_1 "0")
check(test_version_equal_2 "1")
+
+foreach(c debug release relwithdebinfo minsizerel)
+ if(config AND NOT config STREQUAL NoConfig)
+ if(NOT "${test_imported_${c}}" MATCHES "^;/imported2/include$"
+ AND NOT "${test_imported_${c}}" MATCHES "^/imported1/include;$")
+ message(SEND_ERROR "test_imported_${c} is not correct: ${test_imported_${c}}")
+ endif()
+ else()
+ if(NOT "${test_imported_${c}}" MATCHES "^;$")
+ message(SEND_ERROR "test_imported_${c} is not an empty list: ${test_imported_${c}}")
+ endif()
+ endif()
+endforeach()
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
index 6919261..8e2bd0a 100644
--- a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
@@ -156,15 +156,15 @@ target_include_directories(TargetIncludeDirectories PRIVATE "${CMAKE_CURRENT_BIN
# Test that the language generator expressions work
set_property(TARGET TargetIncludeDirectories
APPEND PROPERTY INCLUDE_DIRECTORIES
- "$<$<LINK_LANGUAGE:C>:${CMAKE_CURRENT_BINARY_DIR}/bad>"
- "$<$<LINK_LANGUAGE:CXX>:${CMAKE_CURRENT_BINARY_DIR}/good>"
- "$<$<STREQUAL:$<LINK_LANGUAGE>,CXX>:${CMAKE_CURRENT_BINARY_DIR}/othergood/>"
+ "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,C>:${CMAKE_CURRENT_BINARY_DIR}/bad>"
+ "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:${CMAKE_CURRENT_BINARY_DIR}/good>"
+ "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:${CMAKE_CURRENT_BINARY_DIR}/othergood/>"
)
add_executable(TargetIncludeDirectories_C main.c)
set_property(TARGET TargetIncludeDirectories_C
APPEND PROPERTY INCLUDE_DIRECTORIES
- "$<$<LINK_LANGUAGE:CXX>:${CMAKE_CURRENT_BINARY_DIR}/bad>"
- "$<$<LINK_LANGUAGE:C>:${CMAKE_CURRENT_BINARY_DIR}/good>"
- "$<$<STREQUAL:$<LINK_LANGUAGE>,C>:${CMAKE_CURRENT_BINARY_DIR}/othergood/>"
+ "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:${CMAKE_CURRENT_BINARY_DIR}/bad>"
+ "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,C>:${CMAKE_CURRENT_BINARY_DIR}/good>"
+ "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,C>:${CMAKE_CURRENT_BINARY_DIR}/othergood/>"
)
diff --git a/Tests/MacRuntimePath/A/CMakeLists.txt b/Tests/MacRuntimePath/A/CMakeLists.txt
index 6e6de42..5fc54f4 100644
--- a/Tests/MacRuntimePath/A/CMakeLists.txt
+++ b/Tests/MacRuntimePath/A/CMakeLists.txt
@@ -14,6 +14,10 @@ set_target_properties(shared2 PROPERTIES
add_library(framework SHARED framework.cpp framework.h)
set_target_properties(framework PROPERTIES MACOSX_RPATH 1 FRAMEWORK 1)
+# another framework
+add_library(framework2 SHARED framework2.cpp framework2.h)
+set_target_properties(framework2 PROPERTIES MACOSX_RPATH 1 FRAMEWORK 1)
+
# executable to test a shared library dependency with install rpaths
add_executable(test1 test1.cpp)
target_link_libraries(test1 shared)
@@ -60,4 +64,5 @@ export(TARGETS shared shared2 framework FILE "${CMAKE_CURRENT_BINARY_DIR}/exp.cm
install(TARGETS shared EXPORT MyExport DESTINATION lib)
install(TARGETS shared2 EXPORT MyExport DESTINATION lib2)
install(TARGETS framework EXPORT MyExport DESTINATION lib-fw)
+install(TARGETS framework2 EXPORT MyExport DESTINATION lib-fw2)
install(EXPORT MyExport DESTINATION lib FILE exp.cmake)
diff --git a/Tests/MacRuntimePath/A/framework2.cpp b/Tests/MacRuntimePath/A/framework2.cpp
new file mode 100644
index 0000000..d3c2c45
--- /dev/null
+++ b/Tests/MacRuntimePath/A/framework2.cpp
@@ -0,0 +1,8 @@
+
+#include "framework2.h"
+#include "stdio.h"
+
+void framework2()
+{
+ printf("framework 2\n");
+}
diff --git a/Tests/MacRuntimePath/A/framework2.h b/Tests/MacRuntimePath/A/framework2.h
new file mode 100644
index 0000000..4576d12
--- /dev/null
+++ b/Tests/MacRuntimePath/A/framework2.h
@@ -0,0 +1,17 @@
+
+#ifndef framework2_h
+#define framework2_h
+
+#ifdef WIN32
+# ifdef framework2_EXPORTS
+# define FRAMEWORK2_EXPORT __declspec(dllexport)
+# else
+# define FRAMEWORK2_EXPORT __declspec(dllimport)
+# endif
+#else
+# define FRAMEWORK2_EXPORT
+#endif
+
+void FRAMEWORK2_EXPORT framework2();
+
+#endif
diff --git a/Tests/MacRuntimePath/B/CMakeLists.txt b/Tests/MacRuntimePath/B/CMakeLists.txt
index c361620..4317af6 100644
--- a/Tests/MacRuntimePath/B/CMakeLists.txt
+++ b/Tests/MacRuntimePath/B/CMakeLists.txt
@@ -9,7 +9,8 @@ add_executable(testb ${MacRuntimePath_B_SOURCE_DIR}/../A/test3.cpp)
target_link_libraries(testb shared framework)
# test link with rpath enabled library by filename
-target_link_libraries(testb $<TARGET_LINKER_FILE:shared2> framework)
+find_library(fw2 NAMES framework2 HINTS ${MacRuntimePath_B_BINARY_DIR}/../Root/lib-fw2)
+target_link_libraries(testb $<TARGET_LINKER_FILE:shared2> ${fw2})
add_custom_target(testb_run ALL
COMMAND testb
diff --git a/Tests/RunCMake/Configure/FailCopyFileABI-check.cmake b/Tests/RunCMake/Configure/FailCopyFileABI-check.cmake
new file mode 100644
index 0000000..c439aac
--- /dev/null
+++ b/Tests/RunCMake/Configure/FailCopyFileABI-check.cmake
@@ -0,0 +1,13 @@
+set(log "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/CMakeError.log")
+if(EXISTS "${log}")
+ file(READ "${log}" error_log)
+else()
+ set(error_log "")
+endif()
+if(NOT error_log MATCHES "Cannot copy output executable.*
+to destination specified by COPY_FILE:.*
+Unable to find the executable at any of:
+ .*\\.missing")
+ string(REGEX REPLACE "\n" "\n " error_log " ${error_log}")
+ set(RunCMake_TEST_FAILED "Log file:\n ${log}\ndoes not have expected COPY_FILE failure message:\n${error_log}")
+endif()
diff --git a/Tests/RunCMake/Configure/FailCopyFileABI-override.cmake b/Tests/RunCMake/Configure/FailCopyFileABI-override.cmake
new file mode 100644
index 0000000..c633555
--- /dev/null
+++ b/Tests/RunCMake/Configure/FailCopyFileABI-override.cmake
@@ -0,0 +1,6 @@
+# Change the executable suffix that try_compile will use for
+# COPY_FILE but not inside the test project. This forces failure.
+get_property(in_try_compile GLOBAL PROPERTY IN_TRY_COMPILE)
+if(NOT in_try_compile)
+ set(CMAKE_EXECUTABLE_SUFFIX .missing)
+endif()
diff --git a/Tests/RunCMake/Configure/FailCopyFileABI-stdout.txt b/Tests/RunCMake/Configure/FailCopyFileABI-stdout.txt
new file mode 100644
index 0000000..bb87f4c
--- /dev/null
+++ b/Tests/RunCMake/Configure/FailCopyFileABI-stdout.txt
@@ -0,0 +1,4 @@
+-- Detecting C compiler ABI info
+-- Detecting C compiler ABI info - failed
+-- Configuring done
+-- Generating done
diff --git a/Tests/RunCMake/Configure/FailCopyFileABI.cmake b/Tests/RunCMake/Configure/FailCopyFileABI.cmake
new file mode 100644
index 0000000..74efd97
--- /dev/null
+++ b/Tests/RunCMake/Configure/FailCopyFileABI.cmake
@@ -0,0 +1,2 @@
+set(CMAKE_USER_MAKE_RULES_OVERRIDE_C ${CMAKE_CURRENT_SOURCE_DIR}/FailCopyFileABI-override.cmake)
+enable_language(C)
diff --git a/Tests/RunCMake/Configure/RunCMakeTest.cmake b/Tests/RunCMake/Configure/RunCMakeTest.cmake
index 46f9184..79e4060 100644
--- a/Tests/RunCMake/Configure/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Configure/RunCMakeTest.cmake
@@ -1,3 +1,4 @@
include(RunCMake)
run_cmake(ErrorLogs)
+run_cmake(FailCopyFileABI)
diff --git a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt
index 8e0591d..a5d5d50 100644
--- a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt
+++ b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt
@@ -1,6 +1,7 @@
CMake Error:
Error evaluating generator expression:
- \$<LINK_LANGUAGE>
+ \$<TARGET_PROPERTY:LINKER_LANGUAGE>
- \$<LINK_LANGUAGE> expression can not be used while evaluating link libraries
+ LINKER_LANGUAGE target property can not be used while evaluating link
+ libraries
diff --git a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake
index e0f8c57..d4e31cd 100644
--- a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake
+++ b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake
@@ -1,4 +1,4 @@
add_library(foo SHARED empty.cpp)
add_library(bar SHARED empty.cpp)
-target_link_libraries(foo $<$<STREQUAL:$<LINK_LANGUAGE>,anything>:bar>)
+target_link_libraries(foo $<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,anything>:bar>)