summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/release/dev/cpack-nsis-bitmap.rst6
-rw-r--r--Help/variable/CMAKE_BINARY_DIR.rst5
-rw-r--r--Help/variable/CMAKE_CURRENT_BINARY_DIR.rst5
-rw-r--r--Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst5
-rw-r--r--Help/variable/CMAKE_SOURCE_DIR.rst5
-rw-r--r--Modules/CPackNSIS.cmake8
-rw-r--r--Modules/CheckCSourceCompiles.cmake2
-rw-r--r--Modules/CheckCSourceRuns.cmake2
-rw-r--r--Modules/CheckCXXSourceCompiles.cmake2
-rw-r--r--Modules/CheckCXXSourceRuns.cmake2
-rw-r--r--Modules/CheckFortranSourceCompiles.cmake2
-rw-r--r--Modules/NSIS.template.in2
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx22
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx9
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx4
-rw-r--r--Source/cmExtraCodeLiteGenerator.cxx4
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx4
-rw-r--r--Source/cmExtraSublimeTextGenerator.cxx2
-rw-r--r--Source/cmFLTKWrapUICommand.cxx39
-rw-r--r--Source/cmGeneratorTarget.cxx333
-rw-r--r--Source/cmGeneratorTarget.h15
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx14
-rw-r--r--Source/cmGhsMultiTargetGenerator.h4
-rw-r--r--Source/cmGlobalGenerator.cxx16
-rw-r--r--Source/cmGlobalGhsMultiGenerator.cxx6
-rw-r--r--Source/cmGlobalKdevelopGenerator.cxx4
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx7
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx13
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx6
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx8
-rw-r--r--Source/cmMakefile.cxx59
-rw-r--r--Source/cmMakefile.h2
-rw-r--r--Source/cmMakefileTargetGenerator.cxx2
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx2
-rw-r--r--Source/cmNinjaUtilityTargetGenerator.cxx2
-rw-r--r--Source/cmQtAutoGeneratorInitializer.cxx4
-rw-r--r--Source/cmQtAutoGenerators.cxx5
-rw-r--r--Source/cmState.cxx2
-rw-r--r--Source/cmState.h5
-rw-r--r--Source/cmTarget.cxx375
-rw-r--r--Source/cmTarget.h13
-rw-r--r--Source/cmake.cxx14
-rw-r--r--Source/cmcmd.cxx6
-rw-r--r--Source/kwsys/EncodingCXX.cxx1
-rw-r--r--Source/kwsys/SystemTools.hxx.in4
-rw-r--r--Tests/CMakeLists.txt8
-rw-r--r--Tests/RunCMake/CommandLine/P_working-dir.cmake14
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake1
-rw-r--r--Utilities/Release/create-cmake-release.cmake3
-rw-r--r--Utilities/Release/dash2win64_cygwin.cmake2
-rw-r--r--Utilities/Release/dashmacmini2_release.cmake25
-rw-r--r--Utilities/Release/release_cmake.cmake19
-rwxr-xr-xbootstrap2
55 files changed, 563 insertions, 567 deletions
diff --git a/Help/release/dev/cpack-nsis-bitmap.rst b/Help/release/dev/cpack-nsis-bitmap.rst
new file mode 100644
index 0000000..c5ccfb5
--- /dev/null
+++ b/Help/release/dev/cpack-nsis-bitmap.rst
@@ -0,0 +1,6 @@
+cpack-nsis-bitmap
+-----------------
+
+* The :module:`CPackNSIS` module learned new variables to add bitmaps to the
+ installer. See the :variable:`CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP`
+ and :variable:`CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP` variables.
diff --git a/Help/variable/CMAKE_BINARY_DIR.rst b/Help/variable/CMAKE_BINARY_DIR.rst
index f8dd8ab..3b323b7 100644
--- a/Help/variable/CMAKE_BINARY_DIR.rst
+++ b/Help/variable/CMAKE_BINARY_DIR.rst
@@ -6,3 +6,8 @@ The path to the top level of the build tree.
This is the full path to the top level of the current CMake build
tree. For an in-source build, this would be the same as
:variable:`CMAKE_SOURCE_DIR`.
+
+When run in -P script mode, CMake sets the variables
+:variable:`CMAKE_BINARY_DIR`, :variable:`CMAKE_SOURCE_DIR`,
+:variable:`CMAKE_CURRENT_BINARY_DIR` and
+:variable:`CMAKE_CURRENT_SOURCE_DIR` to the current working directory.
diff --git a/Help/variable/CMAKE_CURRENT_BINARY_DIR.rst b/Help/variable/CMAKE_CURRENT_BINARY_DIR.rst
index cc3b639..40496b5 100644
--- a/Help/variable/CMAKE_CURRENT_BINARY_DIR.rst
+++ b/Help/variable/CMAKE_CURRENT_BINARY_DIR.rst
@@ -8,3 +8,8 @@ processed by cmake. Each directory added by :command:`add_subdirectory` will
create a binary directory in the build tree, and as it is being
processed this variable will be set. For in-source builds this is the
current source directory being processed.
+
+When run in -P script mode, CMake sets the variables
+:variable:`CMAKE_BINARY_DIR`, :variable:`CMAKE_SOURCE_DIR`,
+:variable:`CMAKE_CURRENT_BINARY_DIR` and
+:variable:`CMAKE_CURRENT_SOURCE_DIR` to the current working directory.
diff --git a/Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst b/Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst
index db063a4..c1b755a 100644
--- a/Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst
+++ b/Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst
@@ -5,3 +5,8 @@ The path to the source directory currently being processed.
This the full path to the source directory that is currently being
processed by cmake.
+
+When run in -P script mode, CMake sets the variables
+:variable:`CMAKE_BINARY_DIR`, :variable:`CMAKE_SOURCE_DIR`,
+:variable:`CMAKE_CURRENT_BINARY_DIR` and
+:variable:`CMAKE_CURRENT_SOURCE_DIR` to the current working directory.
diff --git a/Help/variable/CMAKE_SOURCE_DIR.rst b/Help/variable/CMAKE_SOURCE_DIR.rst
index 3df0226..416fbe1 100644
--- a/Help/variable/CMAKE_SOURCE_DIR.rst
+++ b/Help/variable/CMAKE_SOURCE_DIR.rst
@@ -6,3 +6,8 @@ The path to the top level of the source tree.
This is the full path to the top level of the current CMake source
tree. For an in-source build, this would be the same as
:variable:`CMAKE_BINARY_DIR`.
+
+When run in -P script mode, CMake sets the variables
+:variable:`CMAKE_BINARY_DIR`, :variable:`CMAKE_SOURCE_DIR`,
+:variable:`CMAKE_CURRENT_BINARY_DIR` and
+:variable:`CMAKE_CURRENT_SOURCE_DIR` to the current working directory.
diff --git a/Modules/CPackNSIS.cmake b/Modules/CPackNSIS.cmake
index c6b3d19..db5984a 100644
--- a/Modules/CPackNSIS.cmake
+++ b/Modules/CPackNSIS.cmake
@@ -30,6 +30,14 @@
#
# undocumented.
#
+# .. variable:: CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP
+#
+# The filename of a bitmap to use as the NSIS MUI_WELCOMEFINISHPAGE_BITMAP.
+#
+# .. variable:: CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP
+#
+# The filename of a bitmap to use as the NSIS MUI_UNWELCOMEFINISHPAGE_BITMAP.
+#
# .. variable:: CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS
#
# Extra NSIS commands that will be added to the beginning of the install
diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake
index 6e80fb5..c2b1723 100644
--- a/Modules/CheckCSourceCompiles.cmake
+++ b/Modules/CheckCSourceCompiles.cmake
@@ -93,7 +93,7 @@ macro(CHECK_C_SOURCE_COMPILES SOURCE VAR)
message(STATUS "Performing Test ${VAR} - Success")
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
+ "Performing C SOURCE FILE Test ${VAR} succeeded with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${SOURCE}\n")
else()
diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake
index 0ce423c..5afeab6 100644
--- a/Modules/CheckCSourceRuns.cmake
+++ b/Modules/CheckCSourceRuns.cmake
@@ -81,7 +81,7 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
message(STATUS "Performing Test ${VAR} - Success")
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
+ "Performing C SOURCE FILE Test ${VAR} succeeded with the following output:\n"
"${OUTPUT}\n"
"Return value: ${${VAR}}\n"
"Source file was:\n${SOURCE}\n")
diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake
index 6d52ec6..f8736e2 100644
--- a/Modules/CheckCXXSourceCompiles.cmake
+++ b/Modules/CheckCXXSourceCompiles.cmake
@@ -94,7 +94,7 @@ macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
message(STATUS "Performing Test ${VAR} - Success")
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
+ "Performing C++ SOURCE FILE Test ${VAR} succeeded with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${SOURCE}\n")
else()
diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake
index 3c06d75..84b661d 100644
--- a/Modules/CheckCXXSourceRuns.cmake
+++ b/Modules/CheckCXXSourceRuns.cmake
@@ -82,7 +82,7 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
message(STATUS "Performing Test ${VAR} - Success")
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
+ "Performing C++ SOURCE FILE Test ${VAR} succeeded with the following output:\n"
"${OUTPUT}\n"
"Return value: ${${VAR}}\n"
"Source file was:\n${SOURCE}\n")
diff --git a/Modules/CheckFortranSourceCompiles.cmake b/Modules/CheckFortranSourceCompiles.cmake
index f90d05b..0bdcffa 100644
--- a/Modules/CheckFortranSourceCompiles.cmake
+++ b/Modules/CheckFortranSourceCompiles.cmake
@@ -94,7 +94,7 @@ macro(CHECK_Fortran_SOURCE_COMPILES SOURCE VAR)
message(STATUS "Performing Test ${VAR} - Success")
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Performing Fortran SOURCE FILE Test ${VAR} succeded with the following output:\n"
+ "Performing Fortran SOURCE FILE Test ${VAR} succeeded with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${SOURCE}\n")
else()
diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in
index 76310af..1ef3d28 100644
--- a/Modules/NSIS.template.in
+++ b/Modules/NSIS.template.in
@@ -542,6 +542,8 @@ FunctionEnd
; Define some macro setting for the gui
@CPACK_NSIS_INSTALLER_MUI_ICON_CODE@
@CPACK_NSIS_INSTALLER_ICON_CODE@
+@CPACK_NSIS_INSTALLER_MUI_WELCOMEFINISH_CODE@
+@CPACK_NSIS_INSTALLER_MUI_UNWELCOMEFINISH_CODE@
@CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC@
@CPACK_NSIS_INSTALLER_MUI_FINISHPAGE_RUN_CODE@
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index d36e648..852d360 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 4)
-set(CMake_VERSION_PATCH 20151006)
+set(CMake_VERSION_PATCH 20151008)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 52fbdaf..5ba639f 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -157,6 +157,28 @@ int cmCPackNSISGenerator::PackageFiles()
installerIconCode.c_str());
}
+ if (this->IsSet("CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP"))
+ {
+ std::string installerBitmapCode =
+ "!define MUI_WELCOMEFINISHPAGE_BITMAP \"";
+ installerBitmapCode +=
+ this->GetOption("CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP");
+ installerBitmapCode += "\"\n";
+ this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_WELCOMEFINISH_CODE",
+ installerBitmapCode.c_str());
+ }
+
+ if (this->IsSet("CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP"))
+ {
+ std::string installerBitmapCode =
+ "!define MUI_UNWELCOMEFINISHPAGE_BITMAP \"";
+ installerBitmapCode +=
+ this->GetOption("CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP");
+ installerBitmapCode += "\"\n";
+ this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_UNWELCOMEFINISH_CODE",
+ installerBitmapCode.c_str());
+ }
+
if(this->IsSet("CPACK_NSIS_MUI_FINISHPAGE_RUN"))
{
std::string installerRunCode = "!define MUI_FINISHPAGE_RUN \"$INSTDIR\\";
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 2f125aa..b9016af 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -318,16 +318,13 @@ void cmCTestScriptHandler::CreateCMake()
this->GlobalGenerator = new cmGlobalGenerator(this->CMake);
cmState::Snapshot snapshot = this->CMake->GetCurrentSnapshot();
+ std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
+ snapshot.GetDirectory().SetCurrentSource(cwd);
+ snapshot.GetDirectory().SetCurrentBinary(cwd);
this->Makefile = new cmMakefile(this->GlobalGenerator, snapshot);
this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest);
- // Set CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR.
- // Also, some commands need Makefile->GetCurrentSourceDirectory().
- std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
- this->Makefile->SetCurrentSourceDirectory(cwd);
- this->Makefile->SetCurrentBinaryDirectory(cwd);
-
// remove all cmake commands which are not scriptable, since they can't be
// used in ctest scripts
this->CMake->GetState()->RemoveUnscriptableCommands();
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index dfd51c7..7915a6e 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -401,7 +401,9 @@ void cmExtraCodeBlocksGenerator
case cmTarget::UTILITY: // can have sources since 2.6.3
{
std::vector<cmSourceFile*> sources;
- ti->second.GetSourceFiles(sources,
+ cmGeneratorTarget* gt =
+ this->GlobalGenerator->GetGeneratorTarget(&ti->second);
+ gt->GetSourceFiles(sources,
makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
for (std::vector<cmSourceFile*>::const_iterator si=sources.begin();
si!=sources.end(); si++)
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index c2cff14..496c1a8 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -196,7 +196,9 @@ void cmExtraCodeLiteGenerator
case cmTarget::MODULE_LIBRARY:
{
std::vector<cmSourceFile*> sources;
- ti->second.GetSourceFiles(sources,
+ cmGeneratorTarget* gt =
+ this->GlobalGenerator->GetGeneratorTarget(&ti->second);
+ gt->GetSourceFiles(sources,
makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
for (std::vector<cmSourceFile*>::const_iterator si=sources.begin();
si!=sources.end(); si++)
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 44bf586..6dc18c2 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -562,7 +562,9 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(
// get the files from the source lists then add them to the groups
cmTarget* tgt = const_cast<cmTarget*>(&ti->second);
std::vector<cmSourceFile*> files;
- tgt->GetSourceFiles(files,
+ cmGeneratorTarget* gt =
+ this->GlobalGenerator->GetGeneratorTarget(tgt);
+ gt->GetSourceFiles(files,
makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
for(std::vector<cmSourceFile*>::const_iterator sfIt = files.begin();
sfIt != files.end();
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 163a75b..11410a7 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -237,7 +237,7 @@ void cmExtraSublimeTextGenerator::
cmGeneratorTarget *gtgt = this->GlobalGenerator
->GetGeneratorTarget(target);
std::vector<cmSourceFile*> sourceFiles;
- target->GetSourceFiles(sourceFiles,
+ gtgt->GetSourceFiles(sourceFiles,
makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
std::vector<cmSourceFile*>::const_iterator sourceFilesEnd =
sourceFiles.end();
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx
index 12adfd9..d17d664 100644
--- a/Source/cmFLTKWrapUICommand.cxx
+++ b/Source/cmFLTKWrapUICommand.cxx
@@ -129,45 +129,6 @@ void cmFLTKWrapUICommand::FinalPass()
cmSystemTools::Message(msg.c_str(),"Warning");
return;
}
- std::vector<cmSourceFile*> srcs;
- target->GetSourceFiles(srcs, "");
- bool found = false;
- for (unsigned int i = 0; i < srcs.size(); ++i)
- {
- if (srcs[i]->GetFullPath() ==
- this->GeneratedSourcesClasses[0]->GetFullPath())
- {
- found = true;
- break;
- }
- }
- if (!found)
- {
- std::string msg =
- "In CMake 2.2 the FLTK_WRAP_UI command sets a variable to the list of "
- "source files that should be added to your executable or library. It "
- "appears that you have not added these source files to your target. "
- "You should change your CMakeLists.txt file to "
- "directly add the generated files to the target. "
- "For example FTLK_WRAP_UI(foo src1 src2 src3) "
- "will create a variable named foo_FLTK_UI_SRCS that contains the list "
- "of sources to add to your target when you call ADD_LIBRARY or "
- "ADD_EXECUTABLE. For now CMake will add the sources to your target "
- "for you as was done in CMake 2.0 and earlier. In the future this may "
- "become an error.";
- msg +="The problem was found while processing the source directory: ";
- msg += this->Makefile->GetCurrentSourceDirectory();
- cmSystemTools::Message(msg.c_str(),"Warning");
- // first we add the rules for all the .fl to .h and .cxx files
- size_t lastHeadersClass = this->GeneratedSourcesClasses.size();
-
- // Generate code for all the .fl files
- for(size_t classNum = 0; classNum < lastHeadersClass; classNum++)
- {
- this->Makefile->GetTargets()[this->Target]
- .AddSource(this->GeneratedSourcesClasses[classNum]->GetFullPath());
- }
- }
}
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 62598f4..3fb0dc7 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -269,7 +269,9 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
DebugIncludesDone(false),
DebugCompileOptionsDone(false),
DebugCompileFeaturesDone(false),
- DebugCompileDefinitionsDone(false)
+ DebugCompileDefinitionsDone(false),
+ DebugSourcesDone(false),
+ LinkImplementationLanguageIsContextDependent(true)
{
this->Makefile = this->Target->GetMakefile();
this->LocalGenerator = lg;
@@ -296,6 +298,11 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
t->GetCompileDefinitionsEntries(),
t->GetCompileDefinitionsBacktraces(),
this->CompileDefinitionsEntries);
+
+ CreatePropertyGeneratorExpressions(
+ t->GetSourceEntries(),
+ t->GetSourceBacktraces(),
+ this->SourceEntries, true);
}
cmGeneratorTarget::~cmGeneratorTarget()
@@ -304,6 +311,7 @@ cmGeneratorTarget::~cmGeneratorTarget()
cmDeleteAll(this->CompileOptionsEntries);
cmDeleteAll(this->CompileFeaturesEntries);
cmDeleteAll(this->CompileDefinitionsEntries);
+ cmDeleteAll(this->SourceEntries);
cmDeleteAll(this->LinkInformation);
this->LinkInformation.clear();
}
@@ -402,12 +410,42 @@ std::string cmGeneratorTarget::GetOutputName(const std::string& config,
return i->second;
}
+void cmGeneratorTarget::AddSource(const std::string& src)
+{
+ this->Target->AddSource(src);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ cmGeneratorExpression ge(lfbt);
+ cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(src);
+ cge->SetEvaluateForBuildsystem(true);
+ this->SourceEntries.push_back(
+ new TargetPropertyEntry(cge));
+ this->SourceFilesMap.clear();
+ this->LinkImplementationLanguageIsContextDependent = true;
+}
+
+void cmGeneratorTarget::AddTracedSources(std::vector<std::string> const& srcs)
+{
+ this->Target->AddTracedSources(srcs);
+ if (!srcs.empty())
+ {
+ std::string srcFiles = cmJoin(srcs, ";");
+ this->SourceFilesMap.clear();
+ this->LinkImplementationLanguageIsContextDependent = true;
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ cmGeneratorExpression ge(lfbt);
+ cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(srcFiles);
+ cge->SetEvaluateForBuildsystem(true);
+ this->SourceEntries.push_back(
+ new cmGeneratorTarget::TargetPropertyEntry(cge));
+ }
+}
+
//----------------------------------------------------------------------------
std::vector<cmSourceFile*> const*
cmGeneratorTarget::GetSourceDepends(cmSourceFile const* sf) const
{
- SourceEntriesType::const_iterator i = this->SourceEntries.find(sf);
- if(i != this->SourceEntries.end())
+ SourceEntriesType::const_iterator i = this->SourceDepends.find(sf);
+ if(i != this->SourceDepends.end())
{
return &i->second.Depends;
}
@@ -449,7 +487,7 @@ static void handleSystemIncludesDep(cmMakefile *mf, cmTarget const* depTgt,
#define IMPLEMENT_VISIT_IMPL(DATA, DATATYPE) \
{ \
std::vector<cmSourceFile*> sourceFiles; \
- this->Target->GetSourceFiles(sourceFiles, config); \
+ this->GetSourceFiles(sourceFiles, config); \
TagVisitor<DATA ## Tag DATATYPE> visitor(this, data); \
for(std::vector<cmSourceFile*>::const_iterator si = sourceFiles.begin(); \
si != sourceFiles.end(); ++si) \
@@ -802,10 +840,257 @@ bool cmGeneratorTarget::GetPropertyAsBool(const std::string& prop) const
}
//----------------------------------------------------------------------------
+static void AddInterfaceEntries(
+ cmGeneratorTarget const* thisTarget, std::string const& config,
+ std::string const& prop,
+ std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries)
+{
+ if(cmLinkImplementationLibraries const* impl =
+ thisTarget->Target->GetLinkImplementationLibraries(config))
+ {
+ for (std::vector<cmLinkImplItem>::const_iterator
+ it = impl->Libraries.begin(), end = impl->Libraries.end();
+ it != end; ++it)
+ {
+ if(it->Target)
+ {
+ std::string genex =
+ "$<TARGET_PROPERTY:" + *it + "," + prop + ">";
+ cmGeneratorExpression ge(it->Backtrace);
+ cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(genex);
+ cge->SetEvaluateForBuildsystem(true);
+ entries.push_back(
+ new cmGeneratorTarget::TargetPropertyEntry(cge, *it));
+ }
+ }
+ }
+}
+
+//----------------------------------------------------------------------------
+static bool processSources(cmGeneratorTarget const* tgt,
+ const std::vector<cmGeneratorTarget::TargetPropertyEntry*> &entries,
+ std::vector<std::string> &srcs,
+ UNORDERED_SET<std::string> &uniqueSrcs,
+ cmGeneratorExpressionDAGChecker *dagChecker,
+ std::string const& config, bool debugSources)
+{
+ cmMakefile *mf = tgt->Target->GetMakefile();
+
+ bool contextDependent = false;
+
+ for (std::vector<cmGeneratorTarget::TargetPropertyEntry*>::const_iterator
+ it = entries.begin(), end = entries.end(); it != end; ++it)
+ {
+ cmLinkImplItem const& item = (*it)->LinkImplItem;
+ std::string const& targetName = item;
+ std::vector<std::string> entrySources;
+ cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf,
+ config,
+ false,
+ tgt->Target,
+ tgt->Target,
+ dagChecker),
+ entrySources);
+
+ if ((*it)->ge->GetHadContextSensitiveCondition())
+ {
+ contextDependent = true;
+ }
+
+ for(std::vector<std::string>::iterator i = entrySources.begin();
+ i != entrySources.end(); ++i)
+ {
+ std::string& src = *i;
+ cmSourceFile* sf = mf->GetOrCreateSource(src);
+ std::string e;
+ std::string fullPath = sf->GetFullPath(&e);
+ if(fullPath.empty())
+ {
+ if(!e.empty())
+ {
+ cmake* cm = mf->GetCMakeInstance();
+ cm->IssueMessage(cmake::FATAL_ERROR, e,
+ tgt->Target->GetBacktrace());
+ }
+ return contextDependent;
+ }
+
+ if (!targetName.empty() && !cmSystemTools::FileIsFullPath(src.c_str()))
+ {
+ std::ostringstream err;
+ if (!targetName.empty())
+ {
+ err << "Target \"" << targetName << "\" contains relative "
+ "path in its INTERFACE_SOURCES:\n"
+ " \"" << src << "\"";
+ }
+ else
+ {
+ err << "Found relative path while evaluating sources of "
+ "\"" << tgt->GetName() << "\":\n \"" << src << "\"\n";
+ }
+ tgt->GetLocalGenerator()->IssueMessage(cmake::FATAL_ERROR, err.str());
+ return contextDependent;
+ }
+ src = fullPath;
+ }
+ std::string usedSources;
+ for(std::vector<std::string>::iterator
+ li = entrySources.begin(); li != entrySources.end(); ++li)
+ {
+ std::string src = *li;
+
+ if(uniqueSrcs.insert(src).second)
+ {
+ srcs.push_back(src);
+ if (debugSources)
+ {
+ usedSources += " * " + src + "\n";
+ }
+ }
+ }
+ if (!usedSources.empty())
+ {
+ mf->GetCMakeInstance()->IssueMessage(cmake::LOG,
+ std::string("Used sources for target ")
+ + tgt->GetName() + ":\n"
+ + usedSources, (*it)->ge->GetBacktrace());
+ }
+ }
+ return contextDependent;
+}
+
+//----------------------------------------------------------------------------
+void cmGeneratorTarget::GetSourceFiles(std::vector<std::string> &files,
+ const std::string& config) const
+{
+ assert(this->GetType() != cmTarget::INTERFACE_LIBRARY);
+
+ if (!this->Makefile->GetGlobalGenerator()->GetConfigureDoneCMP0026())
+ {
+ // At configure-time, this method can be called as part of getting the
+ // LOCATION property or to export() a file to be include()d. However
+ // there is no cmGeneratorTarget at configure-time, so search the SOURCES
+ // for TARGET_OBJECTS instead for backwards compatibility with OLD
+ // behavior of CMP0024 and CMP0026 only.
+
+ cmStringRange sourceEntries = this->Target->GetSourceEntries();
+ for(cmStringRange::const_iterator
+ i = sourceEntries.begin();
+ i != sourceEntries.end(); ++i)
+ {
+ std::string const& entry = *i;
+
+ std::vector<std::string> items;
+ cmSystemTools::ExpandListArgument(entry, items);
+ for (std::vector<std::string>::const_iterator
+ li = items.begin(); li != items.end(); ++li)
+ {
+ if(cmHasLiteralPrefix(*li, "$<TARGET_OBJECTS:") &&
+ (*li)[li->size() - 1] == '>')
+ {
+ continue;
+ }
+ files.push_back(*li);
+ }
+ }
+ return;
+ }
+
+ std::vector<std::string> debugProperties;
+ const char *debugProp =
+ this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
+ if (debugProp)
+ {
+ cmSystemTools::ExpandListArgument(debugProp, debugProperties);
+ }
+
+ bool debugSources = !this->DebugSourcesDone
+ && std::find(debugProperties.begin(),
+ debugProperties.end(),
+ "SOURCES")
+ != debugProperties.end();
+
+ if (this->Makefile->GetGlobalGenerator()->GetConfigureDoneCMP0026())
+ {
+ this->DebugSourcesDone = true;
+ }
+
+ cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
+ "SOURCES", 0, 0);
+
+ UNORDERED_SET<std::string> uniqueSrcs;
+ bool contextDependentDirectSources = processSources(this,
+ this->SourceEntries,
+ files,
+ uniqueSrcs,
+ &dagChecker,
+ config,
+ debugSources);
+
+ std::vector<cmGeneratorTarget::TargetPropertyEntry*>
+ linkInterfaceSourcesEntries;
+
+ AddInterfaceEntries(
+ this, config, "INTERFACE_SOURCES",
+ linkInterfaceSourcesEntries);
+
+ std::vector<std::string>::size_type numFilesBefore = files.size();
+ bool contextDependentInterfaceSources = processSources(this,
+ linkInterfaceSourcesEntries,
+ files,
+ uniqueSrcs,
+ &dagChecker,
+ config,
+ debugSources);
+
+ if (!contextDependentDirectSources
+ && !(contextDependentInterfaceSources && numFilesBefore < files.size()))
+ {
+ this->LinkImplementationLanguageIsContextDependent = false;
+ }
+
+ cmDeleteAll(linkInterfaceSourcesEntries);
+}
+
+//----------------------------------------------------------------------------
void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*> &files,
const std::string& config) const
{
- this->Target->GetSourceFiles(files, config);
+
+ // Lookup any existing link implementation for this configuration.
+ std::string key = cmSystemTools::UpperCase(config);
+
+ if(!this->LinkImplementationLanguageIsContextDependent)
+ {
+ files = this->SourceFilesMap.begin()->second;
+ return;
+ }
+
+ SourceFilesMapType::iterator
+ it = this->SourceFilesMap.find(key);
+ if(it != this->SourceFilesMap.end())
+ {
+ files = it->second;
+ }
+ else
+ {
+ std::vector<std::string> srcs;
+ this->GetSourceFiles(srcs, config);
+
+ std::set<cmSourceFile*> emitted;
+
+ for(std::vector<std::string>::const_iterator i = srcs.begin();
+ i != srcs.end(); ++i)
+ {
+ cmSourceFile* sf = this->Makefile->GetOrCreateSource(*i);
+ if (emitted.insert(sf).second)
+ {
+ files.push_back(sf);
+ }
+ }
+ this->SourceFilesMap[key] = files;
+ }
}
//----------------------------------------------------------------------------
@@ -1683,7 +1968,7 @@ cmTargetTraceDependencies
ci != configs.end(); ++ci)
{
std::vector<cmSourceFile*> sources;
- this->Target->GetSourceFiles(sources, *ci);
+ this->GeneratorTarget->GetSourceFiles(sources, *ci);
for(std::vector<cmSourceFile*>::const_iterator si = sources.begin();
si != sources.end(); ++si)
{
@@ -1723,7 +2008,7 @@ void cmTargetTraceDependencies::Trace()
// Get the next source from the queue.
cmSourceFile* sf = this->SourceQueue.front();
this->SourceQueue.pop();
- this->CurrentEntry = &this->GeneratorTarget->SourceEntries[sf];
+ this->CurrentEntry = &this->GeneratorTarget->SourceDepends[sf];
// Queue dependencies added explicitly by the user.
if(const char* additionalDeps = sf->GetProperty("OBJECT_DEPENDS"))
@@ -1755,7 +2040,7 @@ void cmTargetTraceDependencies::Trace()
}
this->CurrentEntry = 0;
- this->Target->AddTracedSources(this->NewSources);
+ this->GeneratorTarget->AddTracedSources(this->NewSources);
}
//----------------------------------------------------------------------------
@@ -2167,34 +2452,6 @@ static void processIncludeDirectories(cmGeneratorTarget const* tgt,
}
}
-
-//----------------------------------------------------------------------------
-static void AddInterfaceEntries(
- cmGeneratorTarget const* thisTarget, std::string const& config,
- std::string const& prop,
- std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries)
-{
- if(cmLinkImplementationLibraries const* impl =
- thisTarget->Target->GetLinkImplementationLibraries(config))
- {
- for (std::vector<cmLinkImplItem>::const_iterator
- it = impl->Libraries.begin(), end = impl->Libraries.end();
- it != end; ++it)
- {
- if(it->Target)
- {
- std::string genex =
- "$<TARGET_PROPERTY:" + *it + "," + prop + ">";
- cmGeneratorExpression ge(it->Backtrace);
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(genex);
- cge->SetEvaluateForBuildsystem(true);
- entries.push_back(
- new cmGeneratorTarget::TargetPropertyEntry(cge, *it));
- }
- }
- }
-}
-
//----------------------------------------------------------------------------
std::vector<std::string>
cmGeneratorTarget::GetIncludeDirectories(const std::string& config,
@@ -4444,12 +4701,12 @@ bool cmGeneratorTarget::GetConfigCommonSourceFiles(
std::vector<std::string>::const_iterator it = configs.begin();
const std::string& firstConfig = *it;
- this->Target->GetSourceFiles(files, firstConfig);
+ this->GetSourceFiles(files, firstConfig);
for ( ; it != configs.end(); ++it)
{
std::vector<cmSourceFile*> configFiles;
- this->Target->GetSourceFiles(configFiles, *it);
+ this->GetSourceFiles(configFiles, *it);
if (configFiles != files)
{
std::string firstConfigFiles;
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 916f281..e8c5e04 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -296,6 +296,9 @@ public:
// Get the target base name.
std::string GetOutputName(const std::string& config, bool implib) const;
+ void AddSource(const std::string& src);
+ void AddTracedSources(std::vector<std::string> const& srcs);
+
/**
* Flags for a given source file as used in this target. Typically assigned
* via SET_TARGET_PROPERTIES when the property is a list of source files.
@@ -370,7 +373,7 @@ private:
friend class cmTargetTraceDependencies;
struct SourceEntry { std::vector<cmSourceFile*> Depends; };
typedef std::map<cmSourceFile const*, SourceEntry> SourceEntriesType;
- SourceEntriesType SourceEntries;
+ SourceEntriesType SourceDepends;
mutable std::map<cmSourceFile const*, std::string> Objects;
std::set<cmSourceFile const*> ExplicitObjectName;
mutable std::map<std::string, std::vector<std::string> > SystemIncludesCache;
@@ -438,10 +441,15 @@ private:
GetImportLinkInterface(const std::string& config, cmTarget const* head,
bool usage_requirements_only) const;
+ typedef std::map<std::string, std::vector<cmSourceFile*> >
+ SourceFilesMapType;
+ mutable SourceFilesMapType SourceFilesMap;
+
std::vector<TargetPropertyEntry*> IncludeDirectoriesEntries;
std::vector<TargetPropertyEntry*> CompileOptionsEntries;
std::vector<TargetPropertyEntry*> CompileFeaturesEntries;
std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
+ std::vector<TargetPropertyEntry*> SourceEntries;
void ExpandLinkItems(std::string const& prop, std::string const& value,
std::string const& config, cmTarget const* headTarget,
@@ -451,6 +459,9 @@ private:
void LookupLinkItems(std::vector<std::string> const& names,
std::vector<cmLinkItem>& items) const;
+ void GetSourceFiles(std::vector<std::string>& files,
+ const std::string& config) const;
+
typedef std::pair<std::string, bool> OutputNameKey;
typedef std::map<OutputNameKey, std::string> OutputNameMapType;
mutable OutputNameMapType OutputNameMap;
@@ -459,6 +470,8 @@ private:
mutable bool DebugCompileOptionsDone;
mutable bool DebugCompileFeaturesDone;
mutable bool DebugCompileDefinitionsDone;
+ mutable bool DebugSourcesDone;
+ mutable bool LinkImplementationLanguageIsContextDependent;
public:
std::vector<cmTarget const*> const&
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index cae5c2f..bfcef43 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -27,7 +27,7 @@ cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget *target)
, LocalGenerator(static_cast<cmLocalGhsMultiGenerator *>(
target->GetLocalGenerator()))
, Makefile(target->Target->GetMakefile())
- , TargetGroup(DetermineIfTargetGroup(target->Target))
+ , TargetGroup(DetermineIfTargetGroup(target))
, DynamicDownload(false)
{
this->RelBuildFilePath = this->GetRelBuildFilePath(target->Target);
@@ -172,16 +172,17 @@ std::vector<cmSourceFile *> cmGhsMultiTargetGenerator::GetSources() const
{
std::vector<cmSourceFile *> output;
std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
- this->Target->GetSourceFiles(output, config);
+ this->GeneratorTarget->GetSourceFiles(output, config);
return output;
}
GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag() const
{
- return cmGhsMultiTargetGenerator::GetGpjTag(this->Target);
+ return cmGhsMultiTargetGenerator::GetGpjTag(this->GeneratorTarget);
}
-GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag(const cmTarget *target)
+GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag(
+ const cmGeneratorTarget *target)
{
GhsMultiGpj::Types output;
if (cmGhsMultiTargetGenerator::DetermineIfTargetGroup(target))
@@ -566,12 +567,13 @@ bool cmGhsMultiTargetGenerator::IsNotKernel(std::string const &config,
return output;
}
-bool cmGhsMultiTargetGenerator::DetermineIfTargetGroup(const cmTarget *target)
+bool cmGhsMultiTargetGenerator::DetermineIfTargetGroup(
+ const cmGeneratorTarget *target)
{
bool output = false;
std::vector<cmSourceFile *> sources;
std::string config =
- target->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE");
+ target->Target->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE");
target->GetSourceFiles(sources, config);
for (std::vector<cmSourceFile *>::const_iterator sources_i = sources.begin();
sources.end() != sources_i; ++sources_i)
diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h
index c29a31e..d1c17f4 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -36,7 +36,7 @@ public:
bool IncludeThisTarget();
std::vector<cmSourceFile *> GetSources() const;
GhsMultiGpj::Types GetGpjTag() const;
- static GhsMultiGpj::Types GetGpjTag(const cmTarget *target);
+ static GhsMultiGpj::Types GetGpjTag(const cmGeneratorTarget* target);
const char *GetAbsBuildFilePath() const
{
return this->AbsBuildFilePath.c_str();
@@ -95,7 +95,7 @@ private:
std::string GetOutputFilename(const std::string &config) const;
bool IsNotKernel(std::string const &config, const std::string &language);
- static bool DetermineIfTargetGroup(const cmTarget *target);
+ static bool DetermineIfTargetGroup(const cmGeneratorTarget* target);
bool DetermineIfDynamicDownload(std::string const &config,
const std::string &language);
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 05f1029..eb4dfee 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1108,16 +1108,16 @@ void cmGlobalGenerator::Configure()
this->FirstTimeProgress = 0.0f;
this->ClearGeneratorMembers();
- cmMakefile* dirMf =
- new cmMakefile(this, this->GetCMakeInstance()->GetCurrentSnapshot());
- this->Makefiles.push_back(dirMf);
+ cmState::Snapshot snapshot = this->CMakeInstance->GetCurrentSnapshot();
- // set the Start directories
- dirMf->SetCurrentSourceDirectory
+ snapshot.GetDirectory().SetCurrentSource
(this->CMakeInstance->GetHomeDirectory());
- dirMf->SetCurrentBinaryDirectory
+ snapshot.GetDirectory().SetCurrentBinary
(this->CMakeInstance->GetHomeOutputDirectory());
+ cmMakefile* dirMf = new cmMakefile(this, snapshot);
+ this->Makefiles.push_back(dirMf);
+
this->BinaryDirectories.insert(
this->CMakeInstance->GetHomeOutputDirectory());
@@ -2949,10 +2949,12 @@ void cmGlobalGenerator::WriteSummary(cmTarget* target)
{
configs.push_back("");
}
+ cmGeneratorTarget* gt =
+ this->GetGeneratorTarget(target);
for(std::vector<std::string>::const_iterator ci = configs.begin();
ci != configs.end(); ++ci)
{
- target->GetSourceFiles(sources, *ci);
+ gt->GetSourceFiles(sources, *ci);
}
std::vector<cmSourceFile*>::const_iterator sourcesEnd
= cmRemoveDuplicates(sources);
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 6dde1e3..87cf58f 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -509,7 +509,8 @@ void cmGlobalGhsMultiGenerator::UpdateBuildFiles(
splitPath.back());
*this->TargetFolderBuildStreams[folderName] << foldNameRelBuildFile
<< " ";
- GhsMultiGpj::WriteGpjTag(cmGhsMultiTargetGenerator::GetGpjTag(tgt),
+ GhsMultiGpj::WriteGpjTag(cmGhsMultiTargetGenerator::GetGpjTag(
+ tgtsI->second),
this->TargetFolderBuildStreams[folderName]);
}
}
@@ -520,7 +521,8 @@ bool cmGlobalGhsMultiGenerator::IsTgtForBuild(const cmTarget *tgt)
const std::string config =
tgt->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE");
std::vector<cmSourceFile *> tgtSources;
- tgt->GetSourceFiles(tgtSources, config);
+ cmGeneratorTarget* gt = this->GetGeneratorTarget(tgt);
+ gt->GetSourceFiles(tgtSources, config);
bool tgtInBuild = true;
char const *excludeFromAll = tgt->GetProperty("EXCLUDE_FROM_ALL");
if (NULL != excludeFromAll && '1' == excludeFromAll[0] &&
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index 138ddbb..c40f846 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -139,7 +139,9 @@ bool cmGlobalKdevelopGenerator
ti != targets.end(); ti++)
{
std::vector<cmSourceFile*> sources;
- ti->second.GetSourceFiles(sources, ti->second.GetMakefile()
+ cmGeneratorTarget* gt =
+ this->GlobalGenerator->GetGeneratorTarget(&ti->second);
+ gt->GetSourceFiles(sources, ti->second.GetMakefile()
->GetSafeDefinition("CMAKE_BUILD_TYPE"));
for (std::vector<cmSourceFile*>::const_iterator si=sources.begin();
si!=sources.end(); si++)
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 0064713..cb13fcf 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -585,12 +585,11 @@ void cmGlobalUnixMakefileGenerator3
else
{
cmState::Snapshot snapshot = this->CMakeInstance->GetCurrentSnapshot();
- mf = new cmMakefile(this, snapshot);
- // set the Start directories
- mf->SetCurrentSourceDirectory
+ snapshot.GetDirectory().SetCurrentSource
(this->CMakeInstance->GetHomeDirectory());
- mf->SetCurrentBinaryDirectory
+ snapshot.GetDirectory().SetCurrentBinary
(this->CMakeInstance->GetHomeOutputDirectory());
+ mf = new cmMakefile(this, snapshot);
}
std::string tname = targetName;
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 86a8f87..ab9d7e7 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -336,7 +336,7 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
no_main_dependency, commandLines, "Checking Build System",
no_working_directory, true))
{
- tgt->AddSource(file->GetFullPath());
+ gt->AddSource(file->GetFullPath());
}
else
{
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 746e1a7..3d52e3a 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -463,7 +463,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
std::string listfile = mf->GetCurrentSourceDirectory();
listfile += "/";
listfile += "CMakeLists.txt";
- allbuild->AddSourceCMP0049(listfile.c_str());
+ allBuildGt->AddSource(listfile.c_str());
// Add XCODE depend helper
std::string dir = mf->GetCurrentBinaryDirectory();
@@ -553,11 +553,13 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
allbuild->AddUtility(target.GetName());
}
+ cmGeneratorTarget* targetGT = this->GetGeneratorTarget(&target);
+
// Refer to the build configuration file for easy editing.
listfile = lg->GetMakefile()->GetCurrentSourceDirectory();
listfile += "/";
listfile += "CMakeLists.txt";
- target.AddSourceCMP0049(listfile.c_str());
+ targetGT->AddSource(listfile.c_str());
}
}
}
@@ -1401,7 +1403,7 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget)
if(cmSourceFile* sf = mf->GetOrCreateSource(fname.c_str()))
{
sf->SetProperty("LANGUAGE", llang.c_str());
- cmtarget.AddSource(fname);
+ gtgt->AddSource(fname);
}
}
@@ -3069,17 +3071,18 @@ bool cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
continue;
}
+ cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget);
+
// add the soon to be generated Info.plist file as a source for a
// MACOSX_BUNDLE file
if(cmtarget.GetPropertyAsBool("MACOSX_BUNDLE"))
{
std::string plist = this->ComputeInfoPListLocation(cmtarget);
mf->GetOrCreateSource(plist, true);
- cmtarget.AddSource(plist);
+ gtgt->AddSource(plist);
}
std::vector<cmSourceFile*> classes;
- cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget);
if (!gtgt->GetConfigCommonSourceFiles(classes))
{
return false;
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index cc94cd4..ab215d1 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -243,7 +243,8 @@ void cmLocalVisualStudio6Generator::AddDSPBuildRule(cmTarget& tgt)
no_working_directory, true);
if(this->Makefile->GetSource(makefileIn.c_str()))
{
- tgt.AddSource(makefileIn);
+ cmGeneratorTarget* gt = this->GlobalGenerator->GetGeneratorTarget(&tgt);
+ gt->AddSource(makefileIn);
}
else
{
@@ -595,7 +596,8 @@ cmLocalVisualStudio6Generator
origCommand.GetCommandLines(), comment,
origCommand.GetWorkingDirectory().c_str()))
{
- target.AddSource(outsf->GetFullPath());
+ cmGeneratorTarget* gt = this->GlobalGenerator->GetGeneratorTarget(&target);
+ gt->AddSource(outsf->GetFullPath());
}
// Replace the dependencies with the output of this rule so that the
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index a4bce8a..8924564 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -112,7 +112,9 @@ void cmLocalVisualStudio7Generator::AddCMakeListsRules()
}
if(l->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET)
{
- l->second.AddSource(sf->GetFullPath());
+ cmGeneratorTarget* gt =
+ this->GlobalGenerator->GetGeneratorTarget(&l->second);
+ gt->AddSource(sf->GetFullPath());
}
}
}
@@ -148,7 +150,9 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
force.c_str(), no_depends, no_main_dependency,
force_commands, " ", 0, true))
{
- tgt.AddSource(file->GetFullPath());
+ cmGeneratorTarget* gt =
+ this->GlobalGenerator->GetGeneratorTarget(&tgt);
+ gt->AddSource(file->GetFullPath());
}
}
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 077470d..c060505 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -120,15 +120,34 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
this->AddSourceGroup("Object Files", "\\.(lo|o|obj)$");
#endif
+ this->AddDefinition("CMAKE_SOURCE_DIR",
+ this->GetCMakeInstance()->GetHomeDirectory());
+ this->AddDefinition("CMAKE_BINARY_DIR",
+ this->GetCMakeInstance()->GetHomeOutputDirectory());
{
- const char* dir = this->GetCMakeInstance()->GetHomeDirectory();
- this->AddDefinition("CMAKE_SOURCE_DIR", dir);
- this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", dir);
+ const char* dir = this->StateSnapshot.GetDirectory().GetCurrentSource();
+ if (dir)
+ {
+ this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", dir);
+ }
+ else
+ {
+ this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
+ this->GetCMakeInstance()->GetHomeDirectory());
+ }
}
{
- const char* dir = this->GetCMakeInstance()->GetHomeOutputDirectory();
- this->AddDefinition("CMAKE_BINARY_DIR", dir);
- this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", dir);
+ const char* dir = this->StateSnapshot.GetDirectory().GetCurrentBinary();
+ if (dir)
+ {
+ cmSystemTools::MakeDirectory(dir);
+ this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", dir);
+ }
+ else
+ {
+ this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
+ this->GetCMakeInstance()->GetHomeOutputDirectory());
+ }
}
}
@@ -1472,13 +1491,6 @@ void cmMakefile::AddLinkLibrary(const std::string& lib)
void cmMakefile::InitializeFromParent(cmMakefile* parent)
{
- this->StateSnapshot.InitializeFromParent();
-
- this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
- this->GetCurrentSourceDirectory());
- this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
- this->GetCurrentBinaryDirectory());
-
this->SystemIncludeDirectories = parent->SystemIncludeDirectories;
// define flags
@@ -1749,12 +1761,12 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
this->ContextStack.back()->Name,
this->ContextStack.back()->Line);
+ newSnapshot.GetDirectory().SetCurrentSource(srcPath);
+ newSnapshot.GetDirectory().SetCurrentBinary(binPath);
+
cmMakefile* subMf = new cmMakefile(this->GlobalGenerator, newSnapshot);
this->GetGlobalGenerator()->AddMakefile(subMf);
- // set the subdirs start dirs
- subMf->SetCurrentSourceDirectory(srcPath);
- subMf->SetCurrentBinaryDirectory(binPath);
if(excludeFromAll)
{
subMf->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
@@ -1770,26 +1782,11 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
}
}
-void cmMakefile::SetCurrentSourceDirectory(const std::string& dir)
-{
- this->StateSnapshot.GetDirectory().SetCurrentSource(dir);
- this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
- this->StateSnapshot.GetDirectory().GetCurrentSource());
-}
-
const char* cmMakefile::GetCurrentSourceDirectory() const
{
return this->StateSnapshot.GetDirectory().GetCurrentSource();
}
-void cmMakefile::SetCurrentBinaryDirectory(const std::string& dir)
-{
- this->StateSnapshot.GetDirectory().SetCurrentBinary(dir);
- const char* binDir = this->StateSnapshot.GetDirectory().GetCurrentBinary();
- cmSystemTools::MakeDirectory(binDir);
- this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", binDir);
-}
-
const char* cmMakefile::GetCurrentBinaryDirectory() const
{
return this->StateSnapshot.GetDirectory().GetCurrentBinary();
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 8724c6e..459d34c 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -353,9 +353,7 @@ public:
*/
void SetArgcArgv(const std::vector<std::string>& args);
- void SetCurrentSourceDirectory(const std::string& dir);
const char* GetCurrentSourceDirectory() const;
- void SetCurrentBinaryDirectory(const std::string& dir);
const char* GetCurrentBinaryDirectory() const;
//@}
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index b278087..cd499f6 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1149,7 +1149,7 @@ cmMakefileTargetGenerator
{
// Depend on all custom command outputs.
std::vector<cmSourceFile*> sources;
- this->Target->GetSourceFiles(sources,
+ this->GeneratorTarget->GetSourceFiles(sources,
this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
source != sources.end(); ++source)
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 84c19a3..24fcaf4 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -112,7 +112,7 @@ void cmNinjaNormalTargetGenerator::WriteLanguagesRules()
// Write rules for languages compiled in this target.
std::set<std::string> languages;
std::vector<cmSourceFile*> sourceFiles;
- this->GetTarget()->GetSourceFiles(sourceFiles,
+ this->GetGeneratorTarget()->GetSourceFiles(sourceFiles,
this->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE"));
for(std::vector<cmSourceFile*>::const_iterator
i = sourceFiles.begin(); i != sourceFiles.end(); ++i)
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index 58b901a..df43c61 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -58,7 +58,7 @@ void cmNinjaUtilityTargetGenerator::Generate()
std::vector<cmSourceFile*> sources;
std::string config = this->GetMakefile()
->GetSafeDefinition("CMAKE_BUILD_TYPE");
- this->GetTarget()->GetSourceFiles(sources, config);
+ this->GetGeneratorTarget()->GetSourceFiles(sources, config);
for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
source != sources.end(); ++source)
{
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 2703f4c..378f132 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -101,7 +101,7 @@ static void SetupSourceFiles(cmGeneratorTarget const* target,
fileIt != newRccFiles.end();
++fileIt)
{
- const_cast<cmTarget*>(target->Target)->AddSource(*fileIt);
+ const_cast<cmGeneratorTarget*>(target)->AddSource(*fileIt);
}
}
@@ -709,7 +709,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenSources(
makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
mocCppFile.c_str(), false);
- target->Target->AddSource(mocCppFile);
+ target->AddSource(mocCppFile);
}
}
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index bbeb3dc..36b1305 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -178,9 +178,10 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory,
cmGlobalGenerator gg(&cm);
cmState::Snapshot snapshot = cm.GetCurrentSnapshot();
+ snapshot.GetDirectory().SetCurrentBinary(targetDirectory);
+ snapshot.GetDirectory().SetCurrentSource(targetDirectory);
+
cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, snapshot));
- mf->SetCurrentBinaryDirectory(targetDirectory);
- mf->SetCurrentSourceDirectory(targetDirectory);
gg.SetCurrentMakefile(mf.get());
this->ReadAutogenInfoFile(mf.get(), targetDirectory, config);
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index ce9ff32..db7519b 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -805,8 +805,10 @@ cmState::CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot,
pos->Parent = origin;
pos->Root = origin;
pos->Vars = this->VarTree.Extend(origin);
+
cmState::Snapshot snapshot = cmState::Snapshot(this, pos);
originSnapshot.Position->BuildSystemDirectory->Children.push_back(snapshot);
+ snapshot.InitializeFromParent();
return snapshot;
}
diff --git a/Source/cmState.h b/Source/cmState.h
index 99e537c..1ffc4bf 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -75,8 +75,6 @@ public:
Snapshot GetCallStackParent() const;
SnapshotType GetType() const;
- void InitializeFromParent();
-
void SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status);
cmPolicies::PolicyStatus GetPolicy(cmPolicies::PolicyID id) const;
bool HasDefinedPolicyCMP0011();
@@ -105,6 +103,9 @@ public:
friend class cmState;
friend class Directory;
friend struct StrictWeakOrder;
+
+ void InitializeFromParent();
+
cmState* State;
cmState::PositionType Position;
};
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index bb44956..abfc40b 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -101,23 +101,9 @@ public:
HeadToLinkImplementationMap> LinkImplMapType;
LinkImplMapType LinkImplMap;
- typedef std::map<std::string, std::vector<cmSourceFile*> >
- SourceFilesMapType;
- SourceFilesMapType SourceFilesMap;
-
std::set<cmLinkItem> UtilityItems;
bool UtilityItemsDone;
- class TargetPropertyEntry {
- static cmLinkImplItem NoLinkImplItem;
- public:
- TargetPropertyEntry(cmsys::auto_ptr<cmCompiledGeneratorExpression> cge,
- cmLinkImplItem const& item = NoLinkImplItem)
- : ge(cge), LinkImplItem(item)
- {}
- const cmsys::auto_ptr<cmCompiledGeneratorExpression> ge;
- cmLinkImplItem const& LinkImplItem;
- };
std::vector<std::string> IncludeDirectoriesEntries;
std::vector<cmListFileBacktrace> IncludeDirectoriesBacktraces;
std::vector<std::string> CompileOptionsEntries;
@@ -126,16 +112,11 @@ public:
std::vector<cmListFileBacktrace> CompileFeaturesBacktraces;
std::vector<std::string> CompileDefinitionsEntries;
std::vector<cmListFileBacktrace> CompileDefinitionsBacktraces;
- std::vector<TargetPropertyEntry*> SourceEntries;
+ std::vector<std::string> SourceEntries;
+ std::vector<cmListFileBacktrace> SourceBacktraces;
std::vector<cmValueWithOrigin> LinkImplementationPropertyEntries;
-
- void AddInterfaceEntries(
- cmTarget const* thisTarget, std::string const& config,
- std::string const& prop, std::vector<TargetPropertyEntry*>& entries);
};
-cmLinkImplItem cmTargetInternals::TargetPropertyEntry::NoLinkImplItem;
-
//----------------------------------------------------------------------------
cmTargetInternals::~cmTargetInternals()
{
@@ -154,8 +135,6 @@ cmTarget::cmTarget()
this->IsApple = false;
this->IsImportedTarget = false;
this->BuildInterfaceIncludesAppended = false;
- this->DebugSourcesDone = false;
- this->LinkImplementationLanguageIsContextDependent = true;
}
void cmTarget::SetType(TargetType type, const std::string& name)
@@ -382,21 +361,6 @@ void cmTarget::SetMakefile(cmMakefile* mf)
}
}
-void CreatePropertyGeneratorExpressions(
- std::vector<std::string> const& entries,
- std::vector<cmListFileBacktrace> const& backtraces,
- std::vector<cmTargetInternals::TargetPropertyEntry*>& items)
-{
- std::vector<cmListFileBacktrace>::const_iterator btIt = backtraces.begin();
- for (std::vector<std::string>::const_iterator it = entries.begin();
- it != entries.end(); ++it, ++btIt)
- {
- cmGeneratorExpression ge(*btIt);
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*it);
- items.push_back(new cmTargetInternals::TargetPropertyEntry(cge));
- }
-}
-
//----------------------------------------------------------------------------
void cmTarget::AddUtility(const std::string& u, cmMakefile *makefile)
{
@@ -454,9 +418,7 @@ void cmTarget::FinishConfigure()
//----------------------------------------------------------------------------
void cmTarget::ClearLinkMaps()
{
- this->LinkImplementationLanguageIsContextDependent = true;
this->Internal->LinkImplMap.clear();
- this->Internal->SourceFilesMap.clear();
}
//----------------------------------------------------------------------------
@@ -538,247 +500,13 @@ bool cmTarget::IsXCTestOnApple() const
}
//----------------------------------------------------------------------------
-static bool processSources(cmTarget const* tgt,
- const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
- std::vector<std::string> &srcs,
- UNORDERED_SET<std::string> &uniqueSrcs,
- cmGeneratorExpressionDAGChecker *dagChecker,
- std::string const& config, bool debugSources)
-{
- cmMakefile *mf = tgt->GetMakefile();
-
- bool contextDependent = false;
-
- for (std::vector<cmTargetInternals::TargetPropertyEntry*>::const_iterator
- it = entries.begin(), end = entries.end(); it != end; ++it)
- {
- cmLinkImplItem const& item = (*it)->LinkImplItem;
- std::string const& targetName = item;
- std::vector<std::string> entrySources;
- cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf,
- config,
- false,
- tgt,
- tgt,
- dagChecker),
- entrySources);
-
- if ((*it)->ge->GetHadContextSensitiveCondition())
- {
- contextDependent = true;
- }
-
- for(std::vector<std::string>::iterator i = entrySources.begin();
- i != entrySources.end(); ++i)
- {
- std::string& src = *i;
- cmSourceFile* sf = mf->GetOrCreateSource(src);
- std::string e;
- std::string fullPath = sf->GetFullPath(&e);
- if(fullPath.empty())
- {
- if(!e.empty())
- {
- cmake* cm = mf->GetCMakeInstance();
- cm->IssueMessage(cmake::FATAL_ERROR, e,
- tgt->GetBacktrace());
- }
- return contextDependent;
- }
-
- if (!targetName.empty() && !cmSystemTools::FileIsFullPath(src.c_str()))
- {
- std::ostringstream err;
- if (!targetName.empty())
- {
- err << "Target \"" << targetName << "\" contains relative "
- "path in its INTERFACE_SOURCES:\n"
- " \"" << src << "\"";
- }
- else
- {
- err << "Found relative path while evaluating sources of "
- "\"" << tgt->GetName() << "\":\n \"" << src << "\"\n";
- }
- tgt->GetMakefile()->IssueMessage(cmake::FATAL_ERROR, err.str());
- return contextDependent;
- }
- src = fullPath;
- }
- std::string usedSources;
- for(std::vector<std::string>::iterator
- li = entrySources.begin(); li != entrySources.end(); ++li)
- {
- std::string src = *li;
-
- if(uniqueSrcs.insert(src).second)
- {
- srcs.push_back(src);
- if (debugSources)
- {
- usedSources += " * " + src + "\n";
- }
- }
- }
- if (!usedSources.empty())
- {
- mf->GetCMakeInstance()->IssueMessage(cmake::LOG,
- std::string("Used sources for target ")
- + tgt->GetName() + ":\n"
- + usedSources, (*it)->ge->GetBacktrace());
- }
- }
- return contextDependent;
-}
-
-//----------------------------------------------------------------------------
-void cmTarget::GetSourceFiles(std::vector<std::string> &files,
- const std::string& config) const
-{
- assert(this->GetType() != INTERFACE_LIBRARY);
-
- if (!this->GetMakefile()->GetGlobalGenerator()->GetConfigureDoneCMP0026())
- {
- // At configure-time, this method can be called as part of getting the
- // LOCATION property or to export() a file to be include()d. However
- // there is no cmGeneratorTarget at configure-time, so search the SOURCES
- // for TARGET_OBJECTS instead for backwards compatibility with OLD
- // behavior of CMP0024 and CMP0026 only.
-
- typedef cmTargetInternals::TargetPropertyEntry
- TargetPropertyEntry;
- for(std::vector<TargetPropertyEntry*>::const_iterator
- i = this->Internal->SourceEntries.begin();
- i != this->Internal->SourceEntries.end(); ++i)
- {
- std::string entry = (*i)->ge->GetInput();
-
- std::vector<std::string> items;
- cmSystemTools::ExpandListArgument(entry, items);
- for (std::vector<std::string>::const_iterator
- li = items.begin(); li != items.end(); ++li)
- {
- if(cmHasLiteralPrefix(*li, "$<TARGET_OBJECTS:") &&
- (*li)[li->size() - 1] == '>')
- {
- continue;
- }
- files.push_back(*li);
- }
- }
- return;
- }
-
- std::vector<std::string> debugProperties;
- const char *debugProp =
- this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
- if (debugProp)
- {
- cmSystemTools::ExpandListArgument(debugProp, debugProperties);
- }
-
- bool debugSources = !this->DebugSourcesDone
- && std::find(debugProperties.begin(),
- debugProperties.end(),
- "SOURCES")
- != debugProperties.end();
-
- if (this->GetMakefile()->GetGlobalGenerator()->GetConfigureDoneCMP0026())
- {
- this->DebugSourcesDone = true;
- }
-
- cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
- "SOURCES", 0, 0);
-
- UNORDERED_SET<std::string> uniqueSrcs;
- bool contextDependentDirectSources = processSources(this,
- this->Internal->SourceEntries,
- files,
- uniqueSrcs,
- &dagChecker,
- config,
- debugSources);
-
- std::vector<cmTargetInternals::TargetPropertyEntry*>
- linkInterfaceSourcesEntries;
-
- this->Internal->AddInterfaceEntries(
- this, config, "INTERFACE_SOURCES",
- linkInterfaceSourcesEntries);
-
- std::vector<std::string>::size_type numFilesBefore = files.size();
- bool contextDependentInterfaceSources = processSources(this,
- linkInterfaceSourcesEntries,
- files,
- uniqueSrcs,
- &dagChecker,
- config,
- debugSources);
-
- if (!contextDependentDirectSources
- && !(contextDependentInterfaceSources && numFilesBefore < files.size()))
- {
- this->LinkImplementationLanguageIsContextDependent = false;
- }
-
- cmDeleteAll(linkInterfaceSourcesEntries);
-}
-
-//----------------------------------------------------------------------------
-void cmTarget::GetSourceFiles(std::vector<cmSourceFile*> &files,
- const std::string& config) const
-{
-
- // Lookup any existing link implementation for this configuration.
- std::string key = cmSystemTools::UpperCase(config);
-
- if(!this->LinkImplementationLanguageIsContextDependent)
- {
- files = this->Internal->SourceFilesMap.begin()->second;
- return;
- }
-
- cmTargetInternals::SourceFilesMapType::iterator
- it = this->Internal->SourceFilesMap.find(key);
- if(it != this->Internal->SourceFilesMap.end())
- {
- files = it->second;
- }
- else
- {
- std::vector<std::string> srcs;
- this->GetSourceFiles(srcs, config);
-
- std::set<cmSourceFile*> emitted;
-
- for(std::vector<std::string>::const_iterator i = srcs.begin();
- i != srcs.end(); ++i)
- {
- cmSourceFile* sf = this->Makefile->GetOrCreateSource(*i);
- if (emitted.insert(sf).second)
- {
- files.push_back(sf);
- }
- }
- this->Internal->SourceFilesMap[key] = files;
- }
-}
-
-//----------------------------------------------------------------------------
void cmTarget::AddTracedSources(std::vector<std::string> const& srcs)
{
- std::string srcFiles = cmJoin(srcs, ";");
- if (!srcFiles.empty())
+ if (!srcs.empty())
{
- this->Internal->SourceFilesMap.clear();
- this->LinkImplementationLanguageIsContextDependent = true;
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- cmGeneratorExpression ge(lfbt);
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(srcFiles);
- cge->SetEvaluateForBuildsystem(true);
- this->Internal->SourceEntries.push_back(
- new cmTargetInternals::TargetPropertyEntry(cge));
+ this->Internal->SourceEntries.push_back(cmJoin(srcs, ";"));
+ this->Internal->SourceBacktraces.push_back(lfbt);
}
}
@@ -811,14 +539,9 @@ void cmTarget::AddSources(std::vector<std::string> const& srcs)
}
if (!srcFiles.empty())
{
- this->Internal->SourceFilesMap.clear();
- this->LinkImplementationLanguageIsContextDependent = true;
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- cmGeneratorExpression ge(lfbt);
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(srcFiles);
- cge->SetEvaluateForBuildsystem(true);
- this->Internal->SourceEntries.push_back(
- new cmTargetInternals::TargetPropertyEntry(cge));
+ this->Internal->SourceEntries.push_back(srcFiles);
+ this->Internal->SourceBacktraces.push_back(lfbt);
}
}
@@ -922,10 +645,10 @@ public:
}
- bool operator()(cmTargetInternals::TargetPropertyEntry* entry)
+ bool operator()(std::string const& entry)
{
std::vector<std::string> files;
- cmSystemTools::ExpandListArgument(entry->ge->GetInput(), files);
+ cmSystemTools::ExpandListArgument(entry, files);
std::vector<cmSourceFileLocation> locations(files.size());
std::transform(files.begin(), files.end(), locations.begin(),
CreateLocation(this->Needle.GetMakefile()));
@@ -944,14 +667,9 @@ cmSourceFile* cmTarget::AddSource(const std::string& src)
TargetPropertyEntryFinder(sfl))
== this->Internal->SourceEntries.end())
{
- this->Internal->SourceFilesMap.clear();
- this->LinkImplementationLanguageIsContextDependent = true;
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- cmGeneratorExpression ge(lfbt);
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(src);
- cge->SetEvaluateForBuildsystem(true);
- this->Internal->SourceEntries.push_back(
- new cmTargetInternals::TargetPropertyEntry(cge));
+ this->Internal->SourceEntries.push_back(src);
+ this->Internal->SourceBacktraces.push_back(lfbt);
}
if (cmGeneratorExpression::Find(src) != std::string::npos)
{
@@ -1254,6 +972,16 @@ cmBacktraceRange cmTarget::GetCompileDefinitionsBacktraces() const
return cmMakeRange(this->Internal->CompileDefinitionsBacktraces);
}
+cmStringRange cmTarget::GetSourceEntries() const
+{
+ return cmMakeRange(this->Internal->SourceEntries);
+}
+
+cmBacktraceRange cmTarget::GetSourceBacktraces() const
+{
+ return cmMakeRange(this->Internal->SourceBacktraces);
+}
+
#if defined(_WIN32) && !defined(__CYGWIN__)
//----------------------------------------------------------------------------
void
@@ -1669,14 +1397,15 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
return;
}
- this->Internal->SourceFilesMap.clear();
- cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- cmGeneratorExpression ge(lfbt);
- cmDeleteAll(this->Internal->SourceEntries);
+
this->Internal->SourceEntries.clear();
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
- this->Internal->SourceEntries.push_back(
- new cmTargetInternals::TargetPropertyEntry(cge));
+ this->Internal->SourceBacktraces.clear();
+ if (value)
+ {
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ this->Internal->SourceEntries.push_back(value);
+ this->Internal->SourceBacktraces.push_back(lfbt);
+ }
}
else
{
@@ -1767,12 +1496,9 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
return;
}
- this->Internal->SourceFilesMap.clear();
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- cmGeneratorExpression ge(lfbt);
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
- this->Internal->SourceEntries.push_back(
- new cmTargetInternals::TargetPropertyEntry(cge));
+ this->Internal->SourceEntries.push_back(value);
+ this->Internal->SourceBacktraces.push_back(lfbt);
}
else
{
@@ -2409,13 +2135,11 @@ const char *cmTarget::GetProperty(const std::string& prop,
std::ostringstream ss;
const char* sep = "";
- typedef cmTargetInternals::TargetPropertyEntry
- TargetPropertyEntry;
- for(std::vector<TargetPropertyEntry*>::const_iterator
+ for(std::vector<std::string>::const_iterator
i = this->Internal->SourceEntries.begin();
i != this->Internal->SourceEntries.end(); ++i)
{
- std::string entry = (*i)->ge->GetInput();
+ std::string const& entry = *i;
std::vector<std::string> files;
cmSystemTools::ExpandListArgument(entry, files);
@@ -3067,13 +2791,11 @@ cmTarget::GetObjectLibrariesCMP0026(std::vector<cmTarget*>& objlibs) const
// there is no cmGeneratorTarget at configure-time, so search the SOURCES
// for TARGET_OBJECTS instead for backwards compatibility with OLD
// behavior of CMP0024 and CMP0026 only.
- typedef cmTargetInternals::TargetPropertyEntry
- TargetPropertyEntry;
- for(std::vector<TargetPropertyEntry*>::const_iterator
+ for(std::vector<std::string>::const_iterator
i = this->Internal->SourceEntries.begin();
i != this->Internal->SourceEntries.end(); ++i)
{
- std::string entry = (*i)->ge->GetInput();
+ std::string const& entry = *i;
std::vector<std::string> files;
cmSystemTools::ExpandListArgument(entry, files);
@@ -3448,32 +3170,6 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
}
}
-//----------------------------------------------------------------------------
-void cmTargetInternals::AddInterfaceEntries(
- cmTarget const* thisTarget, std::string const& config,
- std::string const& prop, std::vector<TargetPropertyEntry*>& entries)
-{
- if(cmLinkImplementationLibraries const* impl =
- thisTarget->GetLinkImplementationLibraries(config))
- {
- for (std::vector<cmLinkImplItem>::const_iterator
- it = impl->Libraries.begin(), end = impl->Libraries.end();
- it != end; ++it)
- {
- if(it->Target)
- {
- std::string genex =
- "$<TARGET_PROPERTY:" + *it + "," + prop + ">";
- cmGeneratorExpression ge(it->Backtrace);
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(genex);
- cge->SetEvaluateForBuildsystem(true);
- entries.push_back(
- new cmTargetInternals::TargetPropertyEntry(cge, *it));
- }
- }
- }
-}
-
cmOptionalLinkImplementation&
cmTarget::GetLinkImplMap(std::string const& config) const
{
@@ -3736,7 +3432,6 @@ cmTargetInternalPointer
//----------------------------------------------------------------------------
cmTargetInternalPointer::~cmTargetInternalPointer()
{
- cmDeleteAll(this->Pointer->SourceEntries);
delete this->Pointer;
}
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 3e71dbd..354eda2 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -134,11 +134,6 @@ public:
{this->PostBuildCommands.push_back(cmd);}
/**
- * Get the list of the source files used by this target
- */
- void GetSourceFiles(std::vector<cmSourceFile*> &files,
- const std::string& config) const;
- /**
* Add sources to the target.
*/
void AddSources(std::vector<std::string> const& srcs);
@@ -388,6 +383,9 @@ public:
cmStringRange GetCompileDefinitionsEntries() const;
cmBacktraceRange GetCompileDefinitionsBacktraces() const;
+ cmStringRange GetSourceEntries() const;
+ cmBacktraceRange GetSourceBacktraces() const;
+
#if defined(_WIN32) && !defined(__CYGWIN__)
const LinkLibraryVectorType &GetLinkLibrariesForVS6() const {
return this->LinkLibrariesForVS6;}
@@ -466,9 +464,6 @@ private:
std::string ImportedGetFullPath(const std::string& config,
bool implib) const;
-
- void GetSourceFiles(std::vector<std::string> &files,
- const std::string& config) const;
private:
mutable cmPropertyMap Properties;
std::set<std::string> SystemIncludeDirectories;
@@ -502,8 +497,6 @@ private:
bool IsApple;
bool IsImportedTarget;
bool BuildInterfaceIncludesAppended;
- mutable bool DebugSourcesDone;
- mutable bool LinkImplementationLanguageIsContextDependent;
#if defined(_WIN32) && !defined(__CYGWIN__)
bool LinkLibrariesForVS6Analyzed;
#endif
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 2aa092a..fececfd 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -377,11 +377,11 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
this->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory());
this->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory());
cmState::Snapshot snapshot = this->GetCurrentSnapshot();
- cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(gg, snapshot));
- mf->SetCurrentBinaryDirectory
+ snapshot.GetDirectory().SetCurrentBinary
(cmSystemTools::GetCurrentWorkingDirectory());
- mf->SetCurrentSourceDirectory
+ snapshot.GetDirectory().SetCurrentSource
(cmSystemTools::GetCurrentWorkingDirectory());
+ cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(gg, snapshot));
if (this->GetWorkingMode() != NORMAL_MODE)
{
std::string file(cmSystemTools::CollapseFullPath(path));
@@ -418,13 +418,13 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
this->SetGlobalGenerator(gg);
cmState::Snapshot snapshot = this->GetCurrentSnapshot();
+ snapshot.GetDirectory().SetCurrentBinary
+ (cmSystemTools::GetCurrentWorkingDirectory());
+ snapshot.GetDirectory().SetCurrentSource
+ (cmSystemTools::GetCurrentWorkingDirectory());
// read in the list file to fill the cache
cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(gg, snapshot));
cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator(mf.get()));
- mf->SetCurrentBinaryDirectory
- (cmSystemTools::GetCurrentWorkingDirectory());
- mf->SetCurrentSourceDirectory
- (cmSystemTools::GetCurrentWorkingDirectory());
mf->SetArgcArgv(args);
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index f44c77d..ca46111 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -769,11 +769,13 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
{
cm.SetGlobalGenerator(ggd);
cmState::Snapshot snapshot = cm.GetCurrentSnapshot();
+ snapshot.GetDirectory().SetCurrentBinary
+ (cmSystemTools::GetCurrentWorkingDirectory());
+ snapshot.GetDirectory().SetCurrentSource
+ (cmSystemTools::GetCurrentWorkingDirectory());
cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(ggd, snapshot));
cmsys::auto_ptr<cmLocalGenerator> lgd(
ggd->CreateLocalGenerator(mf.get()));
- lgd->GetMakefile()->SetCurrentSourceDirectory(startDir);
- lgd->GetMakefile()->SetCurrentBinaryDirectory(startOutDir);
// Actually scan dependencies.
return lgd->UpdateDependencies(depInfo.c_str(),
diff --git a/Source/kwsys/EncodingCXX.cxx b/Source/kwsys/EncodingCXX.cxx
index 7d9b3e4..597d4bd 100644
--- a/Source/kwsys/EncodingCXX.cxx
+++ b/Source/kwsys/EncodingCXX.cxx
@@ -38,6 +38,7 @@
// Windows API.
#if defined(_WIN32)
# include <windows.h>
+# include <shellapi.h>
#endif
namespace KWSYS_NAMESPACE
diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in
index d2d1d40..bba5a5c 100644
--- a/Source/kwsys/SystemTools.hxx.in
+++ b/Source/kwsys/SystemTools.hxx.in
@@ -703,13 +703,13 @@ public:
/**
* Create a symbolic link if the platform supports it. Returns whether
- * creation succeded.
+ * creation succeeded.
*/
static bool CreateSymlink(const std::string& origName, const std::string& newName);
/**
* Read the contents of a symbolic link. Returns whether reading
- * succeded.
+ * succeeded.
*/
static bool ReadSymlink(const std::string& newName, std::string& origName);
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index c82cb68..3f28c25 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -687,12 +687,12 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
if(CMAKE_BUILD_NIGHTLY_RELEASES)
ADD_NIGHTLY_BUILD_TEST(CMakeNightlyWindows
dash2win64_release.cmake)
- ADD_NIGHTLY_BUILD_TEST(CMakeNightlyMac
- dashmacmini2_release.cmake)
- ADD_NIGHTLY_BUILD_TEST(CMakeNightlyMac64
+ ADD_NIGHTLY_BUILD_TEST(CMakeNightlyOSX
dashmacmini5_release.cmake)
- ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux
+ ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux32
magrathea_release.cmake)
+ ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux64
+ linux64_release.cmake)
endif()
# add tests with more complex invocations
diff --git a/Tests/RunCMake/CommandLine/P_working-dir.cmake b/Tests/RunCMake/CommandLine/P_working-dir.cmake
new file mode 100644
index 0000000..4ea0293
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/P_working-dir.cmake
@@ -0,0 +1,14 @@
+if(NOT IS_DIRECTORY "${EXPECTED_WORKING_DIR}")
+ message(FATAL_ERROR "EXPECTED_WORKING_DIR is not a directory: ${EXPECTED_WORKING_DIR}")
+endif()
+
+foreach(d CMAKE_BINARY_DIR CMAKE_CURRENT_BINARY_DIR CMAKE_SOURCE_DIR CMAKE_CURRENT_SOURCE_DIR)
+ if(NOT DEFINED ${d})
+ message(FATAL_ERROR "${d} is not defined")
+ endif()
+ if(EXPECTED_WORKING_DIR STREQUAL "${${d}}")
+ message(STATUS "${d} is the expected working directory (${EXPECTED_WORKING_DIR})")
+ else()
+ message(FATAL_ERROR "${d} = \"${${d}}\" is not the expected working directory (${EXPECTED_WORKING_DIR})")
+ endif()
+endforeach()
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index cef6368..2d94e29 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -115,6 +115,7 @@ run_cmake_command(E_sleep-bad-arg2 ${CMAKE_COMMAND} -E sleep 1 -1)
run_cmake_command(E_sleep-one-tenth ${CMAKE_COMMAND} -E sleep 0.1)
run_cmake_command(P_directory ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR})
+run_cmake_command(P_working-dir ${CMAKE_COMMAND} -DEXPECTED_WORKING_DIR=${RunCMake_BINARY_DIR}/P_working-dir-build -P ${RunCMake_SOURCE_DIR}/P_working-dir.cmake)
set(RunCMake_TEST_OPTIONS
"-DFOO=-DBAR:BOOL=BAZ")
diff --git a/Utilities/Release/create-cmake-release.cmake b/Utilities/Release/create-cmake-release.cmake
index 4cfa2ed..76057d1 100644
--- a/Utilities/Release/create-cmake-release.cmake
+++ b/Utilities/Release/create-cmake-release.cmake
@@ -7,8 +7,7 @@ file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/logs)
set(RELEASE_SCRIPTS_BATCH_1
dash2win64_release.cmake # Windows
- dashmacmini2_release.cmake # Mac Darwin universal ppc;i386
- dashmacmini5_release.cmake # Mac Darwin64 universal x86_64;i386
+ dashmacmini5_release.cmake # OS X x86_64
magrathea_release.cmake # Linux
linux64_release.cmake # Linux x86_64
)
diff --git a/Utilities/Release/dash2win64_cygwin.cmake b/Utilities/Release/dash2win64_cygwin.cmake
index c0cd761..ca590ed 100644
--- a/Utilities/Release/dash2win64_cygwin.cmake
+++ b/Utilities/Release/dash2win64_cygwin.cmake
@@ -28,4 +28,6 @@ get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
# allows us to produce cygwin builds in the short term.
set(EXTRA_CTEST_ARGS "-E ExternalProject")
+set(LOCAL_DIR cygwin)
+
include(${path}/release_cmake.cmake)
diff --git a/Utilities/Release/dashmacmini2_release.cmake b/Utilities/Release/dashmacmini2_release.cmake
deleted file mode 100644
index cd4c5a1..0000000
--- a/Utilities/Release/dashmacmini2_release.cmake
+++ /dev/null
@@ -1,25 +0,0 @@
-set(PROCESSORS 2)
-set(CMAKE_RELEASE_DIRECTORY /Users/kitware/CMakeReleaseDirectory)
-set(USER_OVERRIDE "set(CMAKE_CXX_LINK_EXECUTABLE \\\"gcc <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -shared-libgcc -lstdc++-static\\\")")
-set(BOOTSTRAP_ARGS "--prefix=/ --docdir=doc/cmake")
-set(HOST dashmacmini2)
-set(MAKE_PROGRAM "make")
-set(MAKE "${MAKE_PROGRAM} -j2")
-set(CPACK_BINARY_GENERATORS "DragNDrop TGZ TZ")
-set(CPACK_DMG_FORMAT "UDBZ") #build using bzip2 for smaller package size
-set(INITIAL_CACHE "
-CMAKE_BUILD_TYPE:STRING=Release
-CMAKE_OSX_ARCHITECTURES:STRING=ppc;i386
-CMAKE_USE_OPENSSL:BOOL=ON
-OPENSSL_CRYPTO_LIBRARY:FILEPATH=/Users/kitware/openssl-1.0.1g-install/lib/libcrypto.a
-OPENSSL_INCLUDE_DIR:PATH=/Users/kitware/openssl-1.0.1g-install/include
-OPENSSL_SSL_LIBRARY:FILEPATH=/Users/kitware/openssl-1.0.1g-install/lib/libssl.a
-CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
-CPACK_SYSTEM_NAME:STRING=Darwin-universal
-BUILD_QtDialog:BOOL=TRUE
-CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:BOOL=TRUE
-CMake_INSTALL_DEPENDENCIES:BOOL=ON
-QT_QMAKE_EXECUTABLE:FILEPATH=/Users/kitware/Support/qt-4.8.0/install/bin/qmake
-")
-get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
-include(${path}/release_cmake.cmake)
diff --git a/Utilities/Release/release_cmake.cmake b/Utilities/Release/release_cmake.cmake
index 4c4dd8a..c50602d 100644
--- a/Utilities/Release/release_cmake.cmake
+++ b/Utilities/Release/release_cmake.cmake
@@ -119,27 +119,34 @@ foreach(gen ${generators})
set(SUFFIXES ${SUFFIXES} "*.exe")
endif()
endforeach()
+
+if(LOCAL_DIR)
+ file(MAKE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${LOCAL_DIR}")
+else()
+ set(LOCAL_DIR .)
+endif()
+
# copy all the files over from the remote machine
set(PROJECT_PREFIX cmake-)
foreach(suffix ${SUFFIXES})
- message("scp ${HOST}:${FINAL_PATH}/${PROJECT_PREFIX}${suffix} .")
+ message("scp ${HOST}:${FINAL_PATH}/${PROJECT_PREFIX}${suffix} ${LOCAL_DIR}")
execute_process(COMMAND
- scp ${HOST}:${FINAL_PATH}/${PROJECT_PREFIX}${suffix} .
+ scp ${HOST}:${FINAL_PATH}/${PROJECT_PREFIX}${suffix} ${LOCAL_DIR}
RESULT_VARIABLE result)
if(${result} GREATER 0)
- message("error getting file back scp ${HOST}:${FINAL_PATH}/${PROJECT_PREFIX}${suffix} .")
+ message("error getting file back scp ${HOST}:${FINAL_PATH}/${PROJECT_PREFIX}${suffix} ${LOCAL_DIR}")
endif()
endforeach()
# if there are extra files to copy get them as well
if(extra_files)
foreach(f ${extra_files})
- message("scp ${HOST}:${FINAL_PATH}/${f} .")
+ message("scp ${HOST}:${FINAL_PATH}/${f} ${LOCAL_DIR}")
execute_process(COMMAND
- scp ${HOST}:${FINAL_PATH}/${f} .
+ scp ${HOST}:${FINAL_PATH}/${f} ${LOCAL_DIR}
RESULT_VARIABLE result)
if(${result} GREATER 0)
- message("error getting file back scp ${HOST}:${FINAL_PATH}/${f} .")
+ message("error getting file back scp ${HOST}:${FINAL_PATH}/${f} ${LOCAL_DIR}")
endif()
endforeach()
endif()
diff --git a/bootstrap b/bootstrap
index 31e9b89..ca4fd5e 100755
--- a/bootstrap
+++ b/bootstrap
@@ -572,7 +572,7 @@ cmake_try_run ()
echo "Test produced non-zero return code"
return 3
fi
- echo "Test succeded"
+ echo "Test succeeded"
return 0
}