summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx8
-rw-r--r--Source/cmDocumentVariables.cxx4
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx6
-rw-r--r--Source/cmExtraSublimeTextGenerator.cxx3
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx8
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx1
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx2
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx1
-rw-r--r--Source/cmMakefileTargetGenerator.cxx11
-rw-r--r--Source/cmNinjaTargetGenerator.cxx5
-rw-r--r--Source/cmQtAutomoc.cxx2
-rw-r--r--Source/cmStringCommand.h4
-rw-r--r--Source/cmTarget.cxx32
-rw-r--r--Source/cmTarget.h2
-rw-r--r--Source/cmTargetCompileDefinitionsCommand.h6
-rw-r--r--Source/cmTargetIncludeDirectoriesCommand.h5
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx2
-rw-r--r--Source/kwsys/ProcessUNIX.c6
-rw-r--r--Source/kwsys/SystemInformation.cxx2
-rw-r--r--Tests/CMakeCommands/target_link_libraries/subdir/CMakeLists.txt2
-rw-r--r--Tests/CompileDefinitions/CMakeLists.txt15
-rw-r--r--Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt1
-rw-r--r--Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt3
-rw-r--r--Tests/CompileDefinitions/compiletest.cpp24
-rw-r--r--Tests/CompileDefinitions/runtest.c47
-rw-r--r--Tests/CompileDefinitions/target_prop/CMakeLists.txt5
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt2
-rw-r--r--Tests/ExportImport/Export/sublib/CMakeLists.txt2
-rw-r--r--Tests/QtAutomoc/Adir/CMakeLists.txt2
-rw-r--r--Tests/QtAutomoc/Bdir/CMakeLists.txt2
-rw-r--r--Tests/QtAutomoc/CMakeLists.txt2
32 files changed, 153 insertions, 66 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 27e313a..a860daf 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 10)
-set(CMake_VERSION_TWEAK 20130325)
+set(CMake_VERSION_TWEAK 20130326)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index f99db58..4494e8a 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -771,13 +771,13 @@ static int put_arobj(CF *cfp, struct stat *sb)
}
if (lname > sizeof(hdr->ar_name) || strchr(name, ' '))
(void)sprintf(ar_hb, HDR1, AR_EFMT1, (int)lname,
- (long int)sb->st_mtime, uid, gid, sb->st_mode,
- (long long)sb->st_size + lname, ARFMAG);
+ (long int)sb->st_mtime, (unsigned)uid, (unsigned)gid,
+ sb->st_mode, (long long)sb->st_size + lname, ARFMAG);
else {
lname = 0;
(void)sprintf(ar_hb, HDR2, name,
- (long int)sb->st_mtime, uid, gid, sb->st_mode,
- (long long)sb->st_size, ARFMAG);
+ (long int)sb->st_mtime, (unsigned)uid, (unsigned)gid,
+ sb->st_mode, (long long)sb->st_size, ARFMAG);
}
off_t size = sb->st_size;
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 2f55098..50509a0 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -1164,14 +1164,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"Variables that Control the Build");
cm->DefineProperty
- ("CMAKE_BUILD_INTERFACE_INCLUDES", cmProperty::VARIABLE,
+ ("CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE", cmProperty::VARIABLE,
"Automatically add the current source- and build directories "
"to the INTERFACE_INCLUDE_DIRECTORIES.",
"If this variable is enabled, CMake automatically adds for each shared "
"library target, static library target, module target and executable "
"target, ${CMAKE_CURRENT_SOURCE_DIR} and ${CMAKE_CURRENT_BINARY_DIR} to "
"the INTERFACE_INCLUDE_DIRECTORIES."
- "By default CMAKE_BUILD_INTERFACE_INCLUDES is OFF.",
+ "By default CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE is OFF.",
false,
"Variables that Control the Build");
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 6d5d5b5..f6f4cef 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -621,7 +621,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
->GetGeneratorTarget(target);
// the compilerdefines for this target
- std::string cdefs = target->GetCompileDefinitions();
+ std::string cdefs = target->GetCompileDefinitions(buildType);
if(!cdefs.empty())
{
@@ -640,10 +640,8 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
std::set<std::string> uniqIncludeDirs;
std::vector<std::string> includes;
- const char *config = target->GetMakefile()
- ->GetDefinition("CMAKE_BUILD_TYPE");
target->GetMakefile()->GetLocalGenerator()->
- GetIncludeDirectories(includes, gtgt, "C", config);
+ GetIncludeDirectories(includes, gtgt, "C", buildType);
for(std::vector<std::string>::const_iterator dirIt=includes.begin();
dirIt != includes.end();
++dirIt)
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 5431401..e4802d5 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -488,12 +488,11 @@ ComputeDefines(cmSourceFile *source, cmLocalGenerator* lg, cmTarget *target,
}
// Add preprocessor definitions for this target and configuration.
- lg->AppendDefines(defines, target->GetCompileDefinitions());
+ lg->AppendDefines(defines, target->GetCompileDefinitions(config));
lg->AppendDefines(defines, source->GetProperty("COMPILE_DEFINITIONS"));
{
std::string defPropName = "COMPILE_DEFINITIONS_";
defPropName += cmSystemTools::UpperCase(config);
- lg->AppendDefines(defines, target->GetCompileDefinitions(config));
lg->AppendDefines(defines, source->GetProperty(defPropName.c_str()));
}
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 2222a0e..ceac564 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1709,12 +1709,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
this->AppendDefines(ppDefs, exportMacro);
}
cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&target);
- this->AppendDefines(ppDefs, target.GetCompileDefinitions().c_str());
- if(configName)
- {
- this->AppendDefines(ppDefs,
- target.GetCompileDefinitions(configName).c_str());
- }
+ this->AppendDefines(ppDefs,
+ target.GetCompileDefinitions(configName).c_str());
buildSettings->AddAttribute
("GCC_PREPROCESSOR_DEFINITIONS", ppDefs.CreateList());
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index f6ab0d0..0f680f6 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1962,7 +1962,6 @@ void cmLocalUnixMakefileGenerator3
// Build a list of preprocessor definitions for the target.
std::set<std::string> defines;
- this->AppendDefines(defines, target.GetCompileDefinitions());
this->AppendDefines(defines, target.GetCompileDefinitions(
this->ConfigurationName.c_str()));
if(!defines.empty())
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index c35288c..dc94476 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -1702,7 +1702,7 @@ void cmLocalVisualStudio6Generator
this->AppendDefines(
definesSet,
- target.GetCompileDefinitions());
+ target.GetCompileDefinitions(0));
this->AppendDefines(
debugDefinesSet,
target.GetCompileDefinitions("DEBUG"));
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index dfe8280..7d0bc67 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -745,7 +745,6 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
targetOptions.ParseFinish();
cmGeneratorTarget* gt =
this->GlobalGenerator->GetGeneratorTarget(&target);
- targetOptions.AddDefines(target.GetCompileDefinitions().c_str());
targetOptions.AddDefines(target.GetCompileDefinitions(configName).c_str());
targetOptions.SetVerboseMakefile(
this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"));
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index d9aa7fe..4220ae1 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -303,9 +303,6 @@ std::string cmMakefileTargetGenerator::GetDefines(const std::string &l)
// Add preprocessor definitions for this target and configuration.
this->LocalGenerator->AppendDefines
- (defines, this->Target->GetCompileDefinitions());
-
- this->LocalGenerator->AppendDefines
(defines, this->Target->GetCompileDefinitions(
this->LocalGenerator->ConfigurationName.c_str()));
@@ -640,18 +637,25 @@ cmMakefileTargetGenerator
(commands, buildEcho.c_str(), cmLocalUnixMakefileGenerator3::EchoBuild);
}
+ std::string targetOutPathReal;
std::string targetOutPathPDB;
{
+ std::string targetFullPathReal;
std::string targetFullPathPDB;
if(this->Target->GetType() == cmTarget::EXECUTABLE ||
this->Target->GetType() == cmTarget::STATIC_LIBRARY ||
this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
this->Target->GetType() == cmTarget::MODULE_LIBRARY)
{
+ targetFullPathReal =
+ this->Target->GetFullPath(this->ConfigName, false, true);
targetFullPathPDB = this->Target->GetPDBDirectory(this->ConfigName);
targetFullPathPDB += "/";
targetFullPathPDB += this->Target->GetPDBName(this->ConfigName);
}
+ targetOutPathReal = this->Convert(targetFullPathReal.c_str(),
+ cmLocalGenerator::START_OUTPUT,
+ cmLocalGenerator::SHELL);
targetOutPathPDB =
this->Convert(targetFullPathPDB.c_str(),cmLocalGenerator::NONE,
cmLocalGenerator::SHELL);
@@ -660,6 +664,7 @@ cmMakefileTargetGenerator
vars.RuleLauncher = "RULE_LAUNCH_COMPILE";
vars.CMTarget = this->Target;
vars.Language = lang;
+ vars.Target = targetOutPathReal.c_str();
vars.TargetPDB = targetOutPathPDB.c_str();
vars.Source = sourceFile.c_str();
std::string shellObj =
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 80a1a9b..3fb823c 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -228,7 +228,7 @@ ComputeDefines(cmSourceFile *source, const std::string& language)
// Add preprocessor definitions for this target and configuration.
this->LocalGenerator->AppendDefines
(defines,
- this->Target->GetCompileDefinitions());
+ this->Target->GetCompileDefinitions(this->GetConfigName()));
this->LocalGenerator->AppendDefines
(defines,
source->GetProperty("COMPILE_DEFINITIONS"));
@@ -237,9 +237,6 @@ ComputeDefines(cmSourceFile *source, const std::string& language)
defPropName += cmSystemTools::UpperCase(this->GetConfigName());
this->LocalGenerator->AppendDefines
(defines,
- this->Target->GetCompileDefinitions(this->GetConfigName()));
- this->LocalGenerator->AppendDefines
- (defines,
source->GetProperty(defPropName.c_str()));
}
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx
index 5730c8c..c7060b0 100644
--- a/Source/cmQtAutomoc.cxx
+++ b/Source/cmQtAutomoc.cxx
@@ -250,7 +250,7 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
std::string _moc_compile_defs;
if (tmp)
{
- _moc_compile_defs = target->GetCompileDefinitions();
+ _moc_compile_defs = target->GetCompileDefinitions(0);
}
tmp = makefile->GetProperty("COMPILE_DEFINITIONS");
if (tmp)
diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h
index 30dbaa5..802e0b8 100644
--- a/Source/cmStringCommand.h
+++ b/Source/cmStringCommand.h
@@ -129,8 +129,8 @@ public:
"will search for the position of the last occurrence of the "
"specified substring.\n"
"The following characters have special meaning in regular expressions:\n"
- " ^ Matches at beginning of a line\n"
- " $ Matches at end of a line\n"
+ " ^ Matches at beginning of input\n"
+ " $ Matches at end of input\n"
" . Matches any single character\n"
" [ ] Matches any character(s) inside the brackets\n"
" [^ ] Matches any character(s) not inside the brackets\n"
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 56eb4ad..53e3cfa 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2745,7 +2745,7 @@ void cmTarget::AppendBuildInterfaceIncludes()
}
this->BuildInterfaceIncludesAppended = true;
- if (this->Makefile->IsOn("CMAKE_BUILD_INTERFACE_INCLUDES"))
+ if (this->Makefile->IsOn("CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE"))
{
const char *binDir = this->Makefile->GetStartOutputDirectory();
const char *srcDir = this->Makefile->GetStartDirectory();
@@ -2942,29 +2942,33 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
//----------------------------------------------------------------------------
std::string cmTarget::GetCompileDefinitions(const char *config)
{
- std::string defPropName = "COMPILE_DEFINITIONS";
+ const char *configProp = 0;
if (config)
{
- defPropName += "_" + cmSystemTools::UpperCase(config);
+ std::string configPropName;
+ configPropName = "COMPILE_DEFINITIONS_" + cmSystemTools::UpperCase(config);
+ configProp = this->GetProperty(configPropName.c_str());
}
- const char *prop = this->GetProperty(defPropName.c_str());
+ const char *noconfigProp = this->GetProperty("COMPILE_DEFINITIONS");
cmListFileBacktrace lfbt;
cmGeneratorExpressionDAGChecker dagChecker(lfbt,
this->GetName(),
- defPropName, 0, 0);
+ "COMPILE_DEFINITIONS", 0, 0);
- std::string result;
- if (prop)
+ std::string defsString = (noconfigProp ? noconfigProp : "");
+ if (configProp && noconfigProp)
{
- cmGeneratorExpression ge(lfbt);
-
- result = ge.Parse(prop)->Evaluate(this->Makefile,
- config,
- false,
- this,
- &dagChecker);
+ defsString += ";";
}
+ defsString += (configProp ? configProp : "");
+
+ cmGeneratorExpression ge(lfbt);
+ std::string result = ge.Parse(defsString.c_str())->Evaluate(this->Makefile,
+ config,
+ false,
+ this,
+ &dagChecker);
std::vector<std::string> libs;
this->GetDirectLinkLibraries(config, libs, this);
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 0e6dd42..e25133e 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -430,7 +430,7 @@ public:
If no macro should be defined null is returned. */
const char* GetExportMacro();
- std::string GetCompileDefinitions(const char *config = 0);
+ std::string GetCompileDefinitions(const char *config);
// Compute the set of languages compiled by the target. This is
// computed every time it is called because the languages can change
diff --git a/Source/cmTargetCompileDefinitionsCommand.h b/Source/cmTargetCompileDefinitionsCommand.h
index c93cacb..ec9b071 100644
--- a/Source/cmTargetCompileDefinitionsCommand.h
+++ b/Source/cmTargetCompileDefinitionsCommand.h
@@ -56,8 +56,7 @@ public:
" target_compile_definitions(<target> "
"<INTERFACE|PUBLIC|PRIVATE> [items1...]\n"
" [<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])\n"
- "Specify compile definitions or targets to use when compiling a given "
- "target. "
+ "Specify compile definitions to use when compiling a given target. "
"The named <target> must have been created by a command such as "
"add_executable or add_library and must not be an IMPORTED target. "
"The INTERFACE, PUBLIC and PRIVATE keywords are required to specify "
@@ -65,8 +64,7 @@ public:
"populate the COMPILE_DEFINITIONS property of <target>. PUBLIC and "
"INTERFACE items will populate the INTERFACE_COMPILE_DEFINITIONS "
"property of <target>. "
- "The non-scope arguments specify compile definitions or targets to use "
- "INTERFACE_COMPILE_DEFINITIONS from. "
+ "The following arguments specify compile definitions. "
"Repeated calls for the same <target> append items in the order called."
"\n"
"Arguments to target_compile_definitions may use \"generator "
diff --git a/Source/cmTargetIncludeDirectoriesCommand.h b/Source/cmTargetIncludeDirectoriesCommand.h
index 2bc7bef..e4bc9cf 100644
--- a/Source/cmTargetIncludeDirectoriesCommand.h
+++ b/Source/cmTargetIncludeDirectoriesCommand.h
@@ -68,9 +68,8 @@ public:
"populate the INCLUDE_DIRECTORIES property of <target>. PUBLIC and "
"INTERFACE items will populate the INTERFACE_INCLUDE_DIRECTORIES "
"property of <target>. "
- "The non-scope arguments specify either include directories or targets "
- "to use INTERFACE_INCLUDE_DIRECTORIES from. Any specified include "
- "directories must be absolute paths, not relative paths. "
+ "The following arguments specify include directories. Specified "
+ "include directories may be absolute paths or relative paths. "
"Repeated calls for the same <target> append items in the order called."
"\n"
"Arguments to target_include_directories may use \"generator "
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index f4984c7..1cb9f23 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1220,8 +1220,6 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
clOptions.AddFlag("PrecompiledHeader", "NotUsing");
clOptions.Parse(flags.c_str());
clOptions.Parse(defineFlags.c_str());
- clOptions.AddDefines(
- this->Target->GetCompileDefinitions().c_str());
clOptions.AddDefines(this->Target->GetCompileDefinitions(
configName.c_str()).c_str());
clOptions.SetVerboseMakefile(
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
index fc9e8bf..b9af2f1 100644
--- a/Source/kwsys/ProcessUNIX.c
+++ b/Source/kwsys/ProcessUNIX.c
@@ -47,6 +47,12 @@ do.
*/
+#if defined(__CYGWIN__)
+/* Increase the file descriptor limit for select() before including
+ related system headers. (Default: 64) */
+# define FD_SETSIZE 16384
+#endif
+
#include <stddef.h> /* ptrdiff_t */
#include <stdio.h> /* snprintf */
#include <stdlib.h> /* malloc, free */
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index f057e0f..9e2a93d 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -130,7 +130,7 @@ typedef int siginfo_t;
# define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN
# endif
# endif
-# if defined(__GNUG__)
+# if defined(__GNUC__)
# include <execinfo.h>
# if !(defined(__LSB_VERSION__) && __LSB_VERSION__ < 41)
# define KWSYS_SYSTEMINFORMATION_HAVE_BACKTRACE
diff --git a/Tests/CMakeCommands/target_link_libraries/subdir/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/subdir/CMakeLists.txt
index 61a1a59..9d7fa6c 100644
--- a/Tests/CMakeCommands/target_link_libraries/subdir/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/subdir/CMakeLists.txt
@@ -1,5 +1,5 @@
-set(CMAKE_BUILD_INTERFACE_INCLUDES ON)
+set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
add_library(subdirlib SHARED subdirlib.cpp)
generate_export_header(subdirlib)
diff --git a/Tests/CompileDefinitions/CMakeLists.txt b/Tests/CompileDefinitions/CMakeLists.txt
index e7d91bf..d3e9a3e 100644
--- a/Tests/CompileDefinitions/CMakeLists.txt
+++ b/Tests/CompileDefinitions/CMakeLists.txt
@@ -7,10 +7,19 @@ if ("${CMAKE_GENERATOR}" STREQUAL "Visual Studio 6")
add_definitions(-DNO_SPACES_IN_DEFINE_VALUES)
endif()
+# Use compile flags to tell executables which config is built
+# without depending on the compile definitions functionality.
+foreach(c DEBUG RELEASE RELWITHDEBINFO MINSIZEREL)
+ set(CMAKE_C_FLAGS_${c} "${CMAKE_C_FLAGS_${c}} -DTEST_CONFIG_${c}")
+ set(CMAKE_CXX_FLAGS_${c} "${CMAKE_CXX_FLAGS_${c}} -DTEST_CONFIG_${c}")
+endforeach()
+
+set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
+ "BUILD_CONFIG_NAME=\"$<CONFIGURATION>\""
+ )
+
add_subdirectory(add_definitions_command)
add_subdirectory(target_prop)
add_subdirectory(add_definitions_command_with_target_prop)
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummyexecutable.cpp" "int main(int, char **) { return 0; }\n")
-
-add_executable(CompileDefinitions "${CMAKE_CURRENT_BINARY_DIR}/dummyexecutable.cpp")
+add_executable(CompileDefinitions runtest.c)
diff --git a/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt b/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt
index a6372af..d3886a1 100644
--- a/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt
+++ b/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt
@@ -3,5 +3,6 @@ project(add_definitions_command)
add_definitions(-DCMAKE_IS_FUN -DCMAKE_IS=Fun -DCMAKE_IS_="Fun" -DCMAKE_IS_REALLY="Very Fun")
add_definitions(-DCMAKE_IS_="Fun" -DCMAKE_IS_REALLY="Very Fun" -DCMAKE_IS_FUN -DCMAKE_IS=Fun)
+add_definitions(-DBUILD_IS_DEBUG=$<CONFIG:Debug> -DBUILD_IS_NOT_DEBUG=$<NOT:$<CONFIG:Debug>>)
add_executable(add_definitions_command_executable ../compiletest.cpp)
diff --git a/Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt b/Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt
index e415390..5587f7f 100644
--- a/Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt
+++ b/Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt
@@ -12,3 +12,6 @@ set_property(TARGET add_definitions_command_with_target_prop_executable APPEND P
add_definitions(-DCMAKE_IS_FUN)
set_property(TARGET add_definitions_command_with_target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS=Fun CMAKE_IS_="Fun")
+
+add_definitions(-DBUILD_IS_DEBUG=$<CONFIG:Debug>)
+set_property(TARGET add_definitions_command_with_target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS BUILD_IS_NOT_DEBUG=$<NOT:$<CONFIG:Debug>>)
diff --git a/Tests/CompileDefinitions/compiletest.cpp b/Tests/CompileDefinitions/compiletest.cpp
index f18e59e..14b8eab 100644
--- a/Tests/CompileDefinitions/compiletest.cpp
+++ b/Tests/CompileDefinitions/compiletest.cpp
@@ -45,6 +45,30 @@ enum {
// TEST_GENERATOR_EXPRESSIONS
#endif
+#ifndef BUILD_IS_DEBUG
+# error "BUILD_IS_DEBUG not defined!"
+#endif
+#ifndef BUILD_IS_NOT_DEBUG
+# error "BUILD_IS_NOT_DEBUG not defined!"
+#endif
+
+// Check per-config definitions.
+#ifdef TEST_CONFIG_DEBUG
+# if !BUILD_IS_DEBUG
+# error "BUILD_IS_DEBUG false with TEST_CONFIG_DEBUG!"
+# endif
+# if BUILD_IS_NOT_DEBUG
+# error "BUILD_IS_NOT_DEBUG true with TEST_CONFIG_DEBUG!"
+# endif
+#else
+# if BUILD_IS_DEBUG
+# error "BUILD_IS_DEBUG true without TEST_CONFIG_DEBUG!"
+# endif
+# if !BUILD_IS_NOT_DEBUG
+# error "BUILD_IS_NOT_DEBUG false without TEST_CONFIG_DEBUG!"
+# endif
+#endif
+
int main(int argc, char **argv)
{
return 0;
diff --git a/Tests/CompileDefinitions/runtest.c b/Tests/CompileDefinitions/runtest.c
new file mode 100644
index 0000000..02d2cad
--- /dev/null
+++ b/Tests/CompileDefinitions/runtest.c
@@ -0,0 +1,47 @@
+#include <string.h>
+#include <stdio.h>
+#include <ctype.h>
+
+#ifndef BUILD_CONFIG_NAME
+# error "BUILD_CONFIG_NAME not defined!"
+#endif
+
+int main()
+{
+ char build_config_name[] = BUILD_CONFIG_NAME;
+ char* c;
+ for(c = build_config_name; *c; ++c)
+ {
+ *c = (char)tolower((int)*c);
+ }
+ fprintf(stderr, "build_config_name=\"%s\"\n", build_config_name);
+#ifdef TEST_CONFIG_DEBUG
+ if(strcmp(build_config_name, "debug") != 0)
+ {
+ fprintf(stderr, "build_config_name is not \"debug\"\n");
+ return 1;
+ }
+#endif
+#ifdef TEST_CONFIG_RELEASE
+ if(strcmp(build_config_name, "release") != 0)
+ {
+ fprintf(stderr, "build_config_name is not \"release\"\n");
+ return 1;
+ }
+#endif
+#ifdef TEST_CONFIG_MINSIZEREL
+ if(strcmp(build_config_name, "minsizerel") != 0)
+ {
+ fprintf(stderr, "build_config_name is not \"minsizerel\"\n");
+ return 1;
+ }
+#endif
+#ifdef TEST_CONFIG_RELWITHDEBINFO
+ if(strcmp(build_config_name, "relwithdebinfo") != 0)
+ {
+ fprintf(stderr, "build_config_name is not \"relwithdebinfo\"\n");
+ return 1;
+ }
+#endif
+ return 0;
+}
diff --git a/Tests/CompileDefinitions/target_prop/CMakeLists.txt b/Tests/CompileDefinitions/target_prop/CMakeLists.txt
index abdf257..1ef2d6d 100644
--- a/Tests/CompileDefinitions/target_prop/CMakeLists.txt
+++ b/Tests/CompileDefinitions/target_prop/CMakeLists.txt
@@ -14,3 +14,8 @@ set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS
"$<0:GE_NOT_DEFINED>"
"$<1:ARGUMENT;LIST>"
)
+
+set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS
+ BUILD_IS_DEBUG=$<CONFIG:Debug>
+ BUILD_IS_NOT_DEBUG=$<NOT:$<CONFIG:Debug>>
+ )
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index 337168f..cdf67c2 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -291,7 +291,7 @@ if(WIN32)
install(TARGETS testLib5 RUNTIME DESTINATION bin)
endif()
-add_subdirectory(sublib) # For CMAKE_BUILD_INTERFACE_INCLUDES test.
+add_subdirectory(sublib) # For CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE test.
# Export from build tree.
export(TARGETS testExe1 testLib1 testLib2 testLib3
diff --git a/Tests/ExportImport/Export/sublib/CMakeLists.txt b/Tests/ExportImport/Export/sublib/CMakeLists.txt
index 2d11040..a5c6413 100644
--- a/Tests/ExportImport/Export/sublib/CMakeLists.txt
+++ b/Tests/ExportImport/Export/sublib/CMakeLists.txt
@@ -1,5 +1,5 @@
-set(CMAKE_BUILD_INTERFACE_INCLUDES ON)
+set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_library(subdirlib SHARED subdir.cpp)
diff --git a/Tests/QtAutomoc/Adir/CMakeLists.txt b/Tests/QtAutomoc/Adir/CMakeLists.txt
index abd328e..1712223 100644
--- a/Tests/QtAutomoc/Adir/CMakeLists.txt
+++ b/Tests/QtAutomoc/Adir/CMakeLists.txt
@@ -1,7 +1,7 @@
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
-set(CMAKE_BUILD_INTERFACE_INCLUDES ON)
+set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
add_library(libA SHARED libA.cpp)
target_link_libraries(libA LINK_PUBLIC Qt4::QtCore)
diff --git a/Tests/QtAutomoc/Bdir/CMakeLists.txt b/Tests/QtAutomoc/Bdir/CMakeLists.txt
index 5497105..d9d4aa7 100644
--- a/Tests/QtAutomoc/Bdir/CMakeLists.txt
+++ b/Tests/QtAutomoc/Bdir/CMakeLists.txt
@@ -1,7 +1,7 @@
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
-set(CMAKE_BUILD_INTERFACE_INCLUDES ON)
+set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
add_library(libB SHARED libB.cpp)
generate_export_header(libB)
diff --git a/Tests/QtAutomoc/CMakeLists.txt b/Tests/QtAutomoc/CMakeLists.txt
index ebfbb03..fd624c8 100644
--- a/Tests/QtAutomoc/CMakeLists.txt
+++ b/Tests/QtAutomoc/CMakeLists.txt
@@ -25,7 +25,7 @@ set_target_properties(foo codeeditorLib privateSlot PROPERTIES AUTOMOC TRUE)
include(GenerateExportHeader)
# The order is relevant here. B depends on A, and B headers depend on A
-# headers both subdirectories use CMAKE_BUILD_INTERFACE_INCLUDES and we
+# headers both subdirectories use CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE and we
# test that CMAKE_AUTOMOC successfully reads the include directories
# for the build interface from those targets. There has previously been
# a bug where caching of the include directories happened before