summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeCPack.cmake1
-rw-r--r--CMakeCPackOptions.cmake.in9
-rw-r--r--Help/manual/cmake-generator-expressions.7.rst11
-rw-r--r--Modules/CMakeCheckCompilerFlagCommonPatterns.cmake2
-rw-r--r--Modules/CPackIFW.cmake43
-rw-r--r--Modules/Platform/Windows-MSVC.cmake1
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cmCPackIFWGenerator.cxx70
-rw-r--r--Source/CTest/cmParseJacocoCoverage.cxx3
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx125
-rw-r--r--Source/cmTarget.cxx12
-rw-r--r--Tests/RunCMake/CMakeLists.txt6
-rw-r--r--Tests/RunCMake/Configure/CustomTargetAfterError-result.txt1
-rw-r--r--Tests/RunCMake/Configure/CustomTargetAfterError-stderr.txt9
-rw-r--r--Tests/RunCMake/Configure/CustomTargetAfterError.cmake3
-rw-r--r--Tests/RunCMake/Configure/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-stderr.txt8
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE.cmake9
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-stderr.txt8
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE.cmake9
-rw-r--r--Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-check.cmake17
-rw-r--r--Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-stderr.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE.cmake19
26 files changed, 327 insertions, 52 deletions
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake
index 5b096ad..b27cd69 100644
--- a/CMakeCPack.cmake
+++ b/CMakeCPack.cmake
@@ -74,6 +74,7 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
string(TOUPPER ${_CPACK_IFW_COMPONENT_NAME} _CPACK_IFW_COMPONENT_UNAME)
if(${CMAKE_SYSTEM_NAME} MATCHES Windows)
+ set(_CPACK_IFW_PACKAGE_ICON "set(CPACK_IFW_PACKAGE_ICON \"${CMake_SOURCE_DIR}/Source/QtDialog/CMakeSetup.ico\")")
if(BUILD_QtDialog)
set(_CPACK_IFW_SHORTCUT_OPTIONAL "${_CPACK_IFW_SHORTCUT_OPTIONAL}component.addOperation(\"CreateShortcut\", \"@TargetDir@/bin/cmake-gui.exe\", \"@StartMenuDir@/CMake (cmake-gui).lnk\");\n")
endif()
diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in
index 135c07d..5127220 100644
--- a/CMakeCPackOptions.cmake.in
+++ b/CMakeCPackOptions.cmake.in
@@ -34,12 +34,17 @@ include("@QT_DIALOG_CPACK_OPTIONS_FILE@" OPTIONAL)
if(CPACK_GENERATOR MATCHES "IFW")
# Version with QtIFW limitations
set(CPACK_PACKAGE_VERSION "@_CPACK_IFW_PACKAGE_VERSION@")
+ # Installer configuration
+ set(CPACK_IFW_PACKAGE_TITLE "CMake Build Tool")
+ set(CPACK_IFW_PRODUCT_URL "http://www.cmake.org")
+ @_CPACK_IFW_PACKAGE_ICON@
+ set(CPACK_IFW_PACKAGE_WINDOW_ICON "@CMake_SOURCE_DIR@/Source/QtDialog/CMakeSetup128.png")
# Enable install default component
set(CPACK_COMPONENTS_ALL "@_CPACK_IFW_COMPONENT_NAME@")
- # Configuration
+ # Component configuration
set(CPACK_COMPONENT_@_CPACK_IFW_COMPONENT_UNAME@_DISPLAY_NAME "@CPACK_PACKAGE_NAME@")
set(CPACK_COMPONENT_@_CPACK_IFW_COMPONENT_UNAME@_DESCRIPTION "@CPACK_PACKAGE_DESCRIPTION_SUMMARY@")
- # IFW Configuration
+ # IFW component onfiguration
set(CPACK_IFW_COMPONENT_@_CPACK_IFW_COMPONENT_UNAME@_NAME "@CPACK_PACKAGE_NAME@")
set(CPACK_IFW_COMPONENT_@_CPACK_IFW_COMPONENT_UNAME@_LICENSES "@CPACK_PACKAGE_NAME@ Copyright" "@CPACK_RESOURCE_FILE_LICENSE@")
@_CPACK_IFW_COMPONENT_SCRIPT@
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index bc24798..77259a0 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -148,6 +148,17 @@ than 4.2.0.
Name of file with soname (.so.3).
``$<TARGET_SONAME_FILE_DIR:tgt>``
Directory of with soname (.so.3).
+``$<TARGET_PDB_FILE:tgt>``
+ Full path to the linker generated program database file (.pdb)
+ where ``tgt`` is the name of a target.
+
+ See also the :prop_tgt:`PDB_NAME` and :prop_tgt:`PDB_OUTPUT_DIRECTORY`
+ target properties and their configuration specific variants
+ :prop_tgt:`PDB_NAME_<CONFIG>` and :prop_tgt:`PDB_OUTPUT_DIRECTORY_<CONFIG>`.
+``$<TARGET_PDB_FILE_NAME:tgt>``
+ Name of the linker generated program database file (.pdb).
+``$<TARGET_PDB_FILE_DIR:tgt>``
+ Directory of the linker generated program database file (.pdb).
``$<TARGET_PROPERTY:tgt,prop>``
Value of the property ``prop`` on the target ``tgt``.
diff --git a/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake b/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake
index 9d8ba9e..abbcda4 100644
--- a/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake
+++ b/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake
@@ -32,7 +32,7 @@ macro (CHECK_COMPILER_FLAG_COMMON_PATTERNS _VAR)
FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro
FAIL_REGEX "command option .* is not recognized" # XL
FAIL_REGEX "command option .* contains an incorrect subargument" # XL
- FAIL_REGEX "not supported in this configuration; ignored" # AIX
+ FAIL_REGEX "not supported in this configuration. ignored" # AIX
FAIL_REGEX "File with unknown suffix passed to linker" # PGI
FAIL_REGEX "WARNING: unknown flag:" # Open64
FAIL_REGEX "Incorrect command line option:" # Borland
diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake
index f99488a..1f6de8f 100644
--- a/Modules/CPackIFW.cmake
+++ b/Modules/CPackIFW.cmake
@@ -29,8 +29,37 @@
# Variables
# ^^^^^^^^^
#
-# Variables that Change Behavior
-# """"""""""""""""""""""""""""""
+# You can use the following variables to change behavior of CPack ``IFW`` generator.
+#
+# Package
+# """""""
+#
+# .. variable:: CPACK_IFW_PACKAGE_TITLE
+#
+# Name of the installer as displayed on the title bar.
+# By default used :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY`
+#
+# .. variable:: CPACK_IFW_PACKAGE_PUBLISHER
+#
+# Publisher of the software (as shown in the Windows Control Panel).
+# By default used :variable:`CPACK_PACKAGE_VENDOR`
+#
+# .. variable:: CPACK_IFW_PRODUCT_URL
+#
+# URL to a page that contains product information on your web site.
+#
+# .. variable:: CPACK_IFW_PACKAGE_ICON
+#
+# Filename for a custom installer icon. The actual file is '.icns' (Mac OS X),
+# '.ico' (Windows). No functionality on Unix.
+#
+# .. variable:: CPACK_IFW_PACKAGE_WINDOW_ICON
+#
+# Filename for a custom window icon in PNG format for the Installer application.
+#
+# .. variable:: CPACK_IFW_PACKAGE_LOGO
+#
+# Filename for a logo used as QWizard::LogoPixmap.
#
# .. variable:: CPACK_IFW_TARGET_DIRECTORY
#
@@ -45,6 +74,9 @@
#
# You can use predefined variables.
#
+# Components
+# """"""""""
+#
# .. variable:: CPACK_IFW_RESOLVE_DUPLICATE_NAMES
#
# Resolve duplicate names when installing components with groups.
@@ -54,8 +86,8 @@
# Additional prepared packages dirs that will be used to resolve
# dependent components.
#
-# Advanced Variables
-# """"""""""""""""""
+# Advanced
+# """"""""
#
# .. variable:: CPACK_IFW_BINARYCREATOR_EXECUTABLE
#
@@ -95,6 +127,7 @@
# [SCRIPT <script>]
# [NAME <name>]
# [PRIORITY <priority>]
+# [DEPENDS <com_id> ...]
# [LICENSES <display_name> <file_path> ...])
#
# This command should be called after cpack_add_component command.
@@ -109,6 +142,8 @@
#
# ``PRIORITY`` is priority of the component in the tree.
#
+# ``DEPENDS`` list of dependency component identifiers in QtIFW_ style.
+#
# ``LICENSES`` pair of <display_name> and <file_path> of license text for this
# component. You can specify more then one license.
#
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index 2cfe6fe..e51c592 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -258,4 +258,5 @@ macro(__windows_compiler_msvc lang)
set(CMAKE_${lang}_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
+ set(CMAKE_${lang}_LINKER_SUPPORTS_PDB ON)
endmacro()
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 1208b8a..ea892aa 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 20140730)
+set(CMake_VERSION_PATCH 20140731)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cmCPackIFWGenerator.cxx b/Source/CPack/cmCPackIFWGenerator.cxx
index 51c0f2e..3a7f539 100644
--- a/Source/CPack/cmCPackIFWGenerator.cxx
+++ b/Source/CPack/cmCPackIFWGenerator.cxx
@@ -680,14 +680,19 @@ int cmCPackIFWGenerator::IfwCreateConfigFile()
ifwPkgName = "Your package";
}
- std::string ifwPkgDescription;
- if (const char *name = this->GetOption("CPACK_PACKAGE_DESCRIPTION_SUMMARY"))
+ std::string pkgTitle;
+ if (const char *title = this->GetOption("CPACK_IFW_PACKAGE_TITLE"))
{
- ifwPkgDescription = name;
+ pkgTitle = title;
+ }
+ else if (const char *description =
+ this->GetOption("CPACK_PACKAGE_DESCRIPTION_SUMMARY"))
+ {
+ pkgTitle = description;
}
else
{
- ifwPkgDescription = "Your package description";
+ pkgTitle = "Your package description";
}
std::string ifwPkgVersion;
@@ -711,9 +716,64 @@ int cmCPackIFWGenerator::IfwCreateConfigFile()
cfg << "<Installer>" << std::endl;
cfg << " <Name>" << cmXMLSafe(ifwPkgName).str() << "</Name>" << std::endl;
cfg << " <Version>" << ifwPkgVersion << "</Version>" << std::endl;
- cfg << " <Title>" << cmXMLSafe(ifwPkgDescription).str() << "</Title>"
+ cfg << " <Title>" << cmXMLSafe(pkgTitle).str() << "</Title>"
<< std::endl;
+ // Publisher
+ std::string ifwPublisher;
+ if(const char *publisher = GetOption("CPACK_IFW_PACKAGE_PUBLISHER"))
+ {
+ ifwPublisher = publisher;
+ }
+ else if(const char *vendor = GetOption("CPACK_PACKAGE_VENDOR"))
+ {
+ ifwPublisher = vendor;
+ }
+ if(!ifwPublisher.empty())
+ {
+ cfg << " <Publisher>" << cmXMLSafe(ifwPublisher).str()
+ << "</Publisher>" << std::endl;
+ }
+
+ // ProductUrl
+ if(const char *url = GetOption("CPACK_IFW_PRODUCT_URL"))
+ {
+ cfg << " <ProductUrl>" << url << "</ProductUrl>" << std::endl;
+ }
+
+ // ApplicationIcon
+ const char *pkgApplicationIcon = GetOption("CPACK_IFW_PACKAGE_ICON");
+ if(pkgApplicationIcon && cmSystemTools::FileExists(pkgApplicationIcon))
+ {
+ std::string name = cmSystemTools::GetFilenameName(pkgApplicationIcon);
+ std::string path = this->toplevel + "/config/" + name;
+ name = cmSystemTools::GetFilenameWithoutExtension(name);
+ cmsys::SystemTools::CopyFileIfDifferent(pkgApplicationIcon, path.data());
+ cfg << " <InstallerApplicationIcon>" << name
+ << "</InstallerApplicationIcon>" << std::endl;
+ }
+
+ // WindowIcon
+ const char *pkgWindowIcon = GetOption("CPACK_IFW_PACKAGE_WINDOW_ICON");
+ if(pkgWindowIcon && cmSystemTools::FileExists(pkgWindowIcon))
+ {
+ std::string name = cmSystemTools::GetFilenameName(pkgWindowIcon);
+ std::string path = this->toplevel + "/config/" + name;
+ cmsys::SystemTools::CopyFileIfDifferent(pkgWindowIcon, path.data());
+ cfg << " <InstallerWindowIcon>" << name
+ << "</InstallerWindowIcon>" << std::endl;
+ }
+
+ // Logo
+ const char *pkgLogo = GetOption("CPACK_IFW_PACKAGE_LOGO");
+ if(pkgLogo && cmSystemTools::FileExists(pkgLogo))
+ {
+ std::string name = cmSystemTools::GetFilenameName(pkgLogo);
+ std::string path = this->toplevel + "/config/" + name;
+ cmsys::SystemTools::CopyFileIfDifferent(pkgLogo, path.data());
+ cfg << " <Logo>" << name << "</Logo>" << std::endl;
+ }
+
// Default target directory for installation
if (ifwTargetDir)
{
diff --git a/Source/CTest/cmParseJacocoCoverage.cxx b/Source/CTest/cmParseJacocoCoverage.cxx
index 4723dd3..f270adb 100644
--- a/Source/CTest/cmParseJacocoCoverage.cxx
+++ b/Source/CTest/cmParseJacocoCoverage.cxx
@@ -42,6 +42,9 @@ class cmParseJacocoCoverage::XMLParser: public cmXMLParser
"/" + this->ModuleName + "/src/main/java/" +
this->PackageName;
this->FilePaths.push_back(FilePath);
+ FilePath = this->Coverage.SourceDir +
+ "/src/main/java/" + this->PackageName;
+ this->FilePaths.push_back(FilePath);
}
else if(name == "sourcefile")
{
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 7a53d65..35a9fcb 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -1523,7 +1523,17 @@ static const struct InstallPrefixNode : public cmGeneratorExpressionNode
} installPrefixNode;
//----------------------------------------------------------------------------
-template<bool linker, bool soname>
+class ArtifactNameTag;
+class ArtifactLinkerTag;
+class ArtifactSonameTag;
+class ArtifactPdbTag;
+
+class ArtifactPathTag;
+class ArtifactDirTag;
+class ArtifactNameTag;
+
+//----------------------------------------------------------------------------
+template<typename ArtifactT>
struct TargetFilesystemArtifactResultCreator
{
static std::string Create(cmTarget* target,
@@ -1533,7 +1543,7 @@ struct TargetFilesystemArtifactResultCreator
//----------------------------------------------------------------------------
template<>
-struct TargetFilesystemArtifactResultCreator<false, true>
+struct TargetFilesystemArtifactResultCreator<ArtifactSonameTag>
{
static std::string Create(cmTarget* target,
cmGeneratorExpressionContext *context,
@@ -1563,7 +1573,45 @@ struct TargetFilesystemArtifactResultCreator<false, true>
//----------------------------------------------------------------------------
template<>
-struct TargetFilesystemArtifactResultCreator<true, false>
+struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
+{
+ static std::string Create(cmTarget* target,
+ cmGeneratorExpressionContext *context,
+ const GeneratorExpressionContent *content)
+ {
+ std::string language = target->GetLinkerLanguage(context->Config);
+
+ std::string pdbSupportVar = "CMAKE_" + language + "_LINKER_SUPPORTS_PDB";
+
+ if(!context->Makefile->IsOn(pdbSupportVar))
+ {
+ ::reportError(context, content->GetOriginalExpression(),
+ "TARGET_PDB_FILE is not supported by the target linker.");
+ return std::string();
+ }
+
+ cmTarget::TargetType targetType = target->GetType();
+
+ if(targetType != cmTarget::SHARED_LIBRARY &&
+ targetType != cmTarget::MODULE_LIBRARY &&
+ targetType != cmTarget::EXECUTABLE)
+ {
+ ::reportError(context, content->GetOriginalExpression(),
+ "TARGET_PDB_FILE is allowed only for "
+ "targets with linker created artifacts.");
+ return std::string();
+ }
+
+ std::string result = target->GetPDBDirectory(context->Config);
+ result += "/";
+ result += target->GetPDBName(context->Config);
+ return result;
+ }
+};
+
+//----------------------------------------------------------------------------
+template<>
+struct TargetFilesystemArtifactResultCreator<ArtifactLinkerTag>
{
static std::string Create(cmTarget* target,
cmGeneratorExpressionContext *context,
@@ -1584,7 +1632,7 @@ struct TargetFilesystemArtifactResultCreator<true, false>
//----------------------------------------------------------------------------
template<>
-struct TargetFilesystemArtifactResultCreator<false, false>
+struct TargetFilesystemArtifactResultCreator<ArtifactNameTag>
{
static std::string Create(cmTarget* target,
cmGeneratorExpressionContext *context,
@@ -1596,7 +1644,7 @@ struct TargetFilesystemArtifactResultCreator<false, false>
//----------------------------------------------------------------------------
-template<bool dirQual, bool nameQual>
+template<typename ArtifactT>
struct TargetFilesystemArtifactResultGetter
{
static std::string Get(const std::string &result);
@@ -1604,7 +1652,7 @@ struct TargetFilesystemArtifactResultGetter
//----------------------------------------------------------------------------
template<>
-struct TargetFilesystemArtifactResultGetter<false, true>
+struct TargetFilesystemArtifactResultGetter<ArtifactNameTag>
{
static std::string Get(const std::string &result)
{ return cmSystemTools::GetFilenameName(result); }
@@ -1612,7 +1660,7 @@ struct TargetFilesystemArtifactResultGetter<false, true>
//----------------------------------------------------------------------------
template<>
-struct TargetFilesystemArtifactResultGetter<true, false>
+struct TargetFilesystemArtifactResultGetter<ArtifactDirTag>
{
static std::string Get(const std::string &result)
{ return cmSystemTools::GetFilenamePath(result); }
@@ -1620,14 +1668,14 @@ struct TargetFilesystemArtifactResultGetter<true, false>
//----------------------------------------------------------------------------
template<>
-struct TargetFilesystemArtifactResultGetter<false, false>
+struct TargetFilesystemArtifactResultGetter<ArtifactPathTag>
{
static std::string Get(const std::string &result)
{ return result; }
};
//----------------------------------------------------------------------------
-template<bool linker, bool soname, bool dirQual, bool nameQual>
+template<typename ArtifactT, typename ComponentT>
struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
{
TargetFilesystemArtifact() {}
@@ -1675,7 +1723,7 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
context->AllTargets.insert(target);
std::string result =
- TargetFilesystemArtifactResultCreator<linker, soname>::Create(
+ TargetFilesystemArtifactResultCreator<ArtifactT>::Create(
target,
context,
content);
@@ -1684,29 +1732,35 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
return std::string();
}
return
- TargetFilesystemArtifactResultGetter<dirQual, nameQual>::Get(result);
+ TargetFilesystemArtifactResultGetter<ComponentT>::Get(result);
}
};
//----------------------------------------------------------------------------
+template<typename ArtifactT>
+struct TargetFilesystemArtifactNodeGroup
+{
+ TargetFilesystemArtifactNodeGroup()
+ {
+ }
+
+ TargetFilesystemArtifact<ArtifactT, ArtifactPathTag> File;
+ TargetFilesystemArtifact<ArtifactT, ArtifactNameTag> FileName;
+ TargetFilesystemArtifact<ArtifactT, ArtifactDirTag> FileDir;
+};
+
+//----------------------------------------------------------------------------
static const
-TargetFilesystemArtifact<false, false, false, false> targetFileNode;
-static const
-TargetFilesystemArtifact<true, false, false, false> targetLinkerFileNode;
-static const
-TargetFilesystemArtifact<false, true, false, false> targetSoNameFileNode;
-static const
-TargetFilesystemArtifact<false, false, false, true> targetFileNameNode;
-static const
-TargetFilesystemArtifact<true, false, false, true> targetLinkerFileNameNode;
-static const
-TargetFilesystemArtifact<false, true, false, true> targetSoNameFileNameNode;
+TargetFilesystemArtifactNodeGroup<ArtifactNameTag> targetNodeGroup;
+
static const
-TargetFilesystemArtifact<false, false, true, false> targetFileDirNode;
+TargetFilesystemArtifactNodeGroup<ArtifactLinkerTag> targetLinkerNodeGroup;
+
static const
-TargetFilesystemArtifact<true, false, true, false> targetLinkerFileDirNode;
+TargetFilesystemArtifactNodeGroup<ArtifactSonameTag> targetSoNameNodeGroup;
+
static const
-TargetFilesystemArtifact<false, true, true, false> targetSoNameFileDirNode;
+TargetFilesystemArtifactNodeGroup<ArtifactPdbTag> targetPdbNodeGroup;
//----------------------------------------------------------------------------
static const
@@ -1732,15 +1786,18 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier)
nodeMap["COMPILE_FEATURES"] = &compileFeaturesNode;
nodeMap["CONFIGURATION"] = &configurationNode;
nodeMap["CONFIG"] = &configurationTestNode;
- nodeMap["TARGET_FILE"] = &targetFileNode;
- nodeMap["TARGET_LINKER_FILE"] = &targetLinkerFileNode;
- nodeMap["TARGET_SONAME_FILE"] = &targetSoNameFileNode;
- nodeMap["TARGET_FILE_NAME"] = &targetFileNameNode;
- nodeMap["TARGET_LINKER_FILE_NAME"] = &targetLinkerFileNameNode;
- nodeMap["TARGET_SONAME_FILE_NAME"] = &targetSoNameFileNameNode;
- nodeMap["TARGET_FILE_DIR"] = &targetFileDirNode;
- nodeMap["TARGET_LINKER_FILE_DIR"] = &targetLinkerFileDirNode;
- nodeMap["TARGET_SONAME_FILE_DIR"] = &targetSoNameFileDirNode;
+ nodeMap["TARGET_FILE"] = &targetNodeGroup.File;
+ nodeMap["TARGET_LINKER_FILE"] = &targetLinkerNodeGroup.File;
+ nodeMap["TARGET_SONAME_FILE"] = &targetSoNameNodeGroup.File;
+ nodeMap["TARGET_PDB_FILE"] = &targetPdbNodeGroup.File;
+ nodeMap["TARGET_FILE_NAME"] = &targetNodeGroup.FileName;
+ nodeMap["TARGET_LINKER_FILE_NAME"] = &targetLinkerNodeGroup.FileName;
+ nodeMap["TARGET_SONAME_FILE_NAME"] = &targetSoNameNodeGroup.FileName;
+ nodeMap["TARGET_PDB_FILE_NAME"] = &targetPdbNodeGroup.FileName;
+ nodeMap["TARGET_FILE_DIR"] = &targetNodeGroup.FileDir;
+ nodeMap["TARGET_LINKER_FILE_DIR"] = &targetLinkerNodeGroup.FileDir;
+ nodeMap["TARGET_SONAME_FILE_DIR"] = &targetSoNameNodeGroup.FileDir;
+ nodeMap["TARGET_PDB_FILE_DIR"] = &targetPdbNodeGroup.FileDir;
nodeMap["STREQUAL"] = &strEqualNode;
nodeMap["EQUAL"] = &equalNode;
nodeMap["LOWER_CASE"] = &lowerCaseNode;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index ca24d2d..acae0b3 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -927,10 +927,13 @@ void cmTarget::AddSources(std::vector<std::string> const& srcs)
if(!(src[0] == '$' && src[1] == '<'))
{
- filename = this->ProcessSourceItemCMP0049(filename);
- if (cmSystemTools::GetErrorOccuredFlag())
+ if(!filename.empty())
{
- return;
+ filename = this->ProcessSourceItemCMP0049(filename);
+ if(filename.empty())
+ {
+ return;
+ }
}
this->Makefile->GetOrCreateSource(filename);
}
@@ -998,8 +1001,7 @@ std::string cmTarget::ProcessSourceItemCMP0049(const std::string& s)
cmSourceFile* cmTarget::AddSourceCMP0049(const std::string& s)
{
std::string src = this->ProcessSourceItemCMP0049(s);
-
- if (cmSystemTools::GetErrorOccuredFlag())
+ if(!s.empty() && src.empty())
{
return 0;
}
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index ff3b9a0..3cd9947 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -21,6 +21,12 @@ if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 2)
set(File_Generate_ARGS -DXCODE_BELOW_2=1)
endif()
+# Test MSVC for older host CMake versions, and test
+# WIN32/CMAKE_C_COMPILER_ID to fix check on Intel for Windows.
+if(MSVC OR (WIN32 AND CMAKE_C_COMPILER_ID MATCHES "MSVC|Intel"))
+ set(GeneratorExpression_ARGS -DLINKER_SUPPORTS_PDB=1)
+endif()
+
add_RunCMake_test(CMP0019)
add_RunCMake_test(CMP0022)
add_RunCMake_test(CMP0026)
diff --git a/Tests/RunCMake/Configure/CustomTargetAfterError-result.txt b/Tests/RunCMake/Configure/CustomTargetAfterError-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Configure/CustomTargetAfterError-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Configure/CustomTargetAfterError-stderr.txt b/Tests/RunCMake/Configure/CustomTargetAfterError-stderr.txt
new file mode 100644
index 0000000..7ce7daf
--- /dev/null
+++ b/Tests/RunCMake/Configure/CustomTargetAfterError-stderr.txt
@@ -0,0 +1,9 @@
+^CMake Error at CustomTargetAfterError.cmake:1 \(message\):
+ Error before add_custom_target
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at CustomTargetAfterError.cmake:3 \(message\):
+ Error after add_custom_target
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Configure/CustomTargetAfterError.cmake b/Tests/RunCMake/Configure/CustomTargetAfterError.cmake
new file mode 100644
index 0000000..3e26455
--- /dev/null
+++ b/Tests/RunCMake/Configure/CustomTargetAfterError.cmake
@@ -0,0 +1,3 @@
+message(SEND_ERROR "Error before add_custom_target")
+add_custom_target(foo COMMAND echo)
+message(SEND_ERROR "Error after add_custom_target")
diff --git a/Tests/RunCMake/Configure/RunCMakeTest.cmake b/Tests/RunCMake/Configure/RunCMakeTest.cmake
index 5ef0384..58e1a2a 100644
--- a/Tests/RunCMake/Configure/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Configure/RunCMakeTest.cmake
@@ -1,5 +1,6 @@
include(RunCMake)
+run_cmake(CustomTargetAfterError)
run_cmake(ErrorLogs)
run_cmake(FailCopyFileABI)
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-stderr.txt
new file mode 100644
index 0000000..831edad
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-stderr.txt
@@ -0,0 +1,8 @@
+CMake Error at NonValidCompiler-TARGET_PDB_FILE.cmake:6 \(file\):
+ Error evaluating generator expression:
+
+ \$<TARGET_PDB_FILE:empty>
+
+ TARGET_PDB_FILE is not supported by the target linker.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE.cmake b/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE.cmake
new file mode 100644
index 0000000..84a2b2e
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE.cmake
@@ -0,0 +1,9 @@
+
+enable_language(C)
+
+add_library(empty STATIC empty.c)
+
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test.txt"
+ CONTENT "[$<TARGET_PDB_FILE:empty>]"
+)
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-stderr.txt
new file mode 100644
index 0000000..e5f21e2
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-stderr.txt
@@ -0,0 +1,8 @@
+CMake Error at NonValidTarget-TARGET_PDB_FILE.cmake:6 \(file\):
+ Error evaluating generator expression:
+
+ \$<TARGET_PDB_FILE:empty>
+
+ TARGET_PDB_FILE is allowed only for targets with linker created artifacts.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE.cmake
new file mode 100644
index 0000000..84a2b2e
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE.cmake
@@ -0,0 +1,9 @@
+
+enable_language(C)
+
+add_library(empty STATIC empty.c)
+
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test.txt"
+ CONTENT "[$<TARGET_PDB_FILE:empty>]"
+)
diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
index c8f3fdf..6c32393 100644
--- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
@@ -16,3 +16,10 @@ run_cmake(NonValidTarget-C_COMPILER_VERSION)
run_cmake(NonValidTarget-CXX_COMPILER_VERSION)
run_cmake(NonValidTarget-TARGET_PROPERTY)
run_cmake(NonValidTarget-TARGET_POLICY)
+
+if(LINKER_SUPPORTS_PDB)
+ run_cmake(NonValidTarget-TARGET_PDB_FILE)
+ run_cmake(ValidTarget-TARGET_PDB_FILE)
+else()
+ run_cmake(NonValidCompiler-TARGET_PDB_FILE)
+endif()
diff --git a/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-check.cmake b/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-check.cmake
new file mode 100644
index 0000000..748d14f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-check.cmake
@@ -0,0 +1,17 @@
+file(STRINGS ${RunCMake_TEST_BINARY_DIR}/test.txt TEST_TXT)
+
+list(GET TEST_TXT 0 PDB_PATH)
+list(GET TEST_TXT 1 PDB_NAME)
+list(GET TEST_TXT 2 PDB_DIR)
+
+if(NOT PDB_PATH MATCHES "empty\\.pdb")
+ message(FATAL_ERROR "unexpected PDB_PATH [${PDB_PATH}]")
+endif()
+
+if(NOT PDB_NAME STREQUAL "empty.pdb")
+ message(FATAL_ERROR "unexpected PDB_NAME [${PDB_NAME}]")
+endif()
+
+if(PDB_DIR MATCHES "empty\\.pdb")
+ message(FATAL_ERROR "unexpected PDB_DIR [${PDB_DIR}]")
+endif()
diff --git a/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-stderr.txt b/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE.cmake b/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE.cmake
new file mode 100644
index 0000000..38e47f9
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE.cmake
@@ -0,0 +1,19 @@
+
+enable_language(C)
+
+add_library(empty SHARED empty.c)
+
+if(CMAKE_CONFIGURATION_TYPES)
+ list(GET CMAKE_CONFIGURATION_TYPES 0 FIRST_CONFIG)
+ set(GENERATE_CONDITION CONDITION $<CONFIG:${FIRST_CONFIG}>)
+endif()
+
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test.txt"
+ CONTENT
+[[$<TARGET_PDB_FILE:empty>
+$<TARGET_PDB_FILE_NAME:empty>
+$<TARGET_PDB_FILE_DIR:empty>
+]]
+ ${GENERATE_CONDITION}
+)