summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/CPackNSIS.cmake5
-rw-r--r--Modules/FindBoost.cmake16
-rw-r--r--Modules/Platform/Darwin-Initialize.cmake6
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx41
-rw-r--r--Source/CPack/cmCPackNSISGenerator.h5
-rw-r--r--Source/cmNinjaTargetGenerator.cxx12
-rw-r--r--Tests/FortranModules/CMakeLists.txt2
-rw-r--r--Tests/FortranModules/non_pp_include.f903
-rw-r--r--Tests/FortranModules/test_non_pp_include_main.f905
10 files changed, 88 insertions, 9 deletions
diff --git a/Modules/CPackNSIS.cmake b/Modules/CPackNSIS.cmake
index db5984a..4693ce5 100644
--- a/Modules/CPackNSIS.cmake
+++ b/Modules/CPackNSIS.cmake
@@ -96,6 +96,11 @@
# Contact information for questions and comments about the installation
# process.
#
+# .. variable:: CPACK_NSIS_<compName>_INSTALL_DIRECTORY
+#
+# Custom install directory for the specified component <compName> instead
+# of $INSTDIR.
+#
# .. variable:: CPACK_NSIS_CREATE_ICONS_EXTRA
#
# Additional NSIS commands for creating start menu shortcuts.
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 1f03841..b3e8db9 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -742,6 +742,21 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ elseif(NOT Boost_VERSION VERSION_LESS 106200 AND Boost_VERSION VERSION_LESS 106300)
+ set(_Boost_CHRONO_DEPENDENCIES system)
+ set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
+ set(_Boost_COROUTINE_DEPENDENCIES context system)
+ set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
+ set(_Boost_FILESYSTEM_DEPENDENCIES system)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+ set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
+ set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
+ set(_Boost_MPI_DEPENDENCIES serialization)
+ set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
+ set(_Boost_RANDOM_DEPENDENCIES system)
+ set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
+ set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
else()
message(WARNING "Imported targets not available for Boost version ${Boost_VERSION}")
set(_Boost_IMPORTED_TARGETS FALSE)
@@ -777,6 +792,7 @@ function(_Boost_COMPONENT_HEADERS component _hdrs)
set(_Boost_COROUTINE_HEADERS "boost/coroutine/all.hpp")
set(_Boost_EXCEPTION_HEADERS "boost/exception/exception.hpp")
set(_Boost_DATE_TIME_HEADERS "boost/date_time/date.hpp")
+ set(_Boost_FIBER_HEADERS "boost/fiber/all.hpp")
set(_Boost_FILESYSTEM_HEADERS "boost/filesystem/path.hpp")
set(_Boost_GRAPH_HEADERS "boost/graph/adjacency_list.hpp")
set(_Boost_GRAPH_PARALLEL_HEADERS "boost/graph/adjacency_list.hpp")
diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake
index 91c2cf3..427909d 100644
--- a/Modules/Platform/Darwin-Initialize.cmake
+++ b/Modules/Platform/Darwin-Initialize.cmake
@@ -125,8 +125,10 @@ if(CMAKE_OSX_SYSROOT)
set(_CMAKE_OSX_SYSROOT_ORIG "")
endif()
set(_CMAKE_OSX_SYSROOT_PATH "${CMAKE_OSX_SYSROOT}")
- else()
- # Transform the sdk name into a path.
+ endif()
+
+ if(CMAKE_OSX_SYSROOT)
+ # Transform the (maybe unversioned) sysroot into a versioned path.
execute_process(
COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version Path
OUTPUT_VARIABLE _stdout
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 9a10ddb..9eb99ea 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 6)
-set(CMake_VERSION_PATCH 20160926)
+set(CMake_VERSION_PATCH 20160927)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 2db94f1..b49da7f 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -71,14 +71,26 @@ int cmCPackNSISGenerator::PackageFiles()
std::ostringstream str;
std::vector<std::string>::const_iterator it;
for (it = files.begin(); it != files.end(); ++it) {
+ std::string outputDir = "$INSTDIR";
std::string fileN =
cmSystemTools::RelativePath(toplevel.c_str(), it->c_str());
if (!this->Components.empty()) {
+ const std::string::size_type pos = fileN.find('/');
+
+ // Use the custom component install directory if we have one
+ if (pos != std::string::npos) {
+ const std::string componentName = fileN.substr(0, pos);
+ outputDir = CustomComponentInstallDirectory(componentName);
+ } else {
+ outputDir = CustomComponentInstallDirectory(fileN);
+ }
+
// Strip off the component part of the path.
- fileN = fileN.substr(fileN.find('/') + 1, std::string::npos);
+ fileN = fileN.substr(pos + 1, std::string::npos);
}
std::replace(fileN.begin(), fileN.end(), '/', '\\');
- str << " Delete \"$INSTDIR\\" << fileN << "\"" << std::endl;
+
+ str << " Delete \"" << outputDir << "\\" << fileN << "\"" << std::endl;
}
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Files: " << str.str()
<< std::endl);
@@ -108,7 +120,12 @@ int cmCPackNSISGenerator::PackageFiles()
}
}
std::replace(fileN.begin(), fileN.end(), '/', '\\');
- dstr << " RMDir \"$INSTDIR\\" << fileN << "\"" << std::endl;
+
+ const std::string componentOutputDir =
+ CustomComponentInstallDirectory(componentName);
+
+ dstr << " RMDir \"" << componentOutputDir << "\\" << fileN << "\""
+ << std::endl;
if (!componentName.empty()) {
this->Components[componentName].Directories.push_back(fileN);
}
@@ -650,7 +667,10 @@ std::string cmCPackNSISGenerator::CreateComponentDescription(
}
componentCode += " SectionIn" + out.str() + "\n";
}
- componentCode += " SetOutPath \"$INSTDIR\"\n";
+
+ const std::string componentOutputDir =
+ CustomComponentInstallDirectory(component->Name);
+ componentCode += " SetOutPath \"" + componentOutputDir + "\"\n";
// Create the actual installation commands
if (component->IsDownloaded) {
@@ -796,13 +816,13 @@ std::string cmCPackNSISGenerator::CreateComponentDescription(
++pathIt) {
path = *pathIt;
std::replace(path.begin(), path.end(), '/', '\\');
- macrosOut << " Delete \"$INSTDIR\\" << path << "\"\n";
+ macrosOut << " Delete \"" << componentOutputDir << "\\" << path << "\"\n";
}
for (pathIt = component->Directories.begin();
pathIt != component->Directories.end(); ++pathIt) {
path = *pathIt;
std::replace(path.begin(), path.end(), '/', '\\');
- macrosOut << " RMDir \"$INSTDIR\\" << path << "\"\n";
+ macrosOut << " RMDir \"" << componentOutputDir << "\\" << path << "\"\n";
}
macrosOut << " noremove_" << component->Name << ":\n";
macrosOut << "!macroend\n";
@@ -914,6 +934,15 @@ std::string cmCPackNSISGenerator::CreateComponentGroupDescription(
return code;
}
+std::string cmCPackNSISGenerator::CustomComponentInstallDirectory(
+ const std::string& componentName)
+{
+ const char* outputDir =
+ this->GetOption("CPACK_NSIS_" + componentName + "_INSTALL_DIRECTORY");
+ const std::string componentOutputDir = (outputDir ? outputDir : "$INSTDIR");
+ return componentOutputDir;
+}
+
std::string cmCPackNSISGenerator::TranslateNewlines(std::string str)
{
cmSystemTools::ReplaceString(str, "\n", "$\\r$\\n");
diff --git a/Source/CPack/cmCPackNSISGenerator.h b/Source/CPack/cmCPackNSISGenerator.h
index ae03e6b..bd7d752 100644
--- a/Source/CPack/cmCPackNSISGenerator.h
+++ b/Source/CPack/cmCPackNSISGenerator.h
@@ -84,6 +84,11 @@ protected:
std::string CreateComponentGroupDescription(cmCPackComponentGroup* group,
std::ostream& macrosOut);
+ /// Returns the custom install directory if available for the specified
+ /// component, otherwise $INSTDIR is returned.
+ std::string CustomComponentInstallDirectory(
+ const std::string& componentName);
+
/// Translations any newlines found in the string into \\r\\n, so that the
/// resulting string can be used within NSIS.
static std::string TranslateNewlines(std::string str);
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index b418ce3..f88eb7b 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -841,6 +841,18 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
// directive.
ppVars["INCLUDES"] = vars["INCLUDES"];
+ // Prepend source file's original directory as an include directory
+ // so e.g. Fortran INCLUDE statements can look for files in it.
+ std::vector<std::string> sourceDirectory;
+ sourceDirectory.push_back(
+ cmSystemTools::GetParentDirectory(source->GetFullPath()));
+
+ std::string sourceDirectoryFlag = this->LocalGenerator->GetIncludeFlags(
+ sourceDirectory, this->GeneratorTarget, language, false, false,
+ this->GetConfigName());
+
+ vars["INCLUDES"] = sourceDirectoryFlag + " " + vars["INCLUDES"];
+
// Explicit preprocessing always uses a depfile.
ppVars["DEP_FILE"] =
cmGlobalNinjaGenerator::EncodeDepfileSpace(ppFileName + ".d");
diff --git a/Tests/FortranModules/CMakeLists.txt b/Tests/FortranModules/CMakeLists.txt
index ff12771..3996600 100644
--- a/Tests/FortranModules/CMakeLists.txt
+++ b/Tests/FortranModules/CMakeLists.txt
@@ -52,6 +52,8 @@ add_definitions(-DFOO -DBAR=1)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
add_executable(test_preprocess test_preprocess.F90 test_preprocess_module.F90)
+add_executable(test_non_pp_include test_non_pp_include_main.f90)
+
# Build the external project separately using a custom target.
# Make sure it uses the same build configuration as this test.
if(CMAKE_CONFIGURATION_TYPES)
diff --git a/Tests/FortranModules/non_pp_include.f90 b/Tests/FortranModules/non_pp_include.f90
new file mode 100644
index 0000000..7eb1725
--- /dev/null
+++ b/Tests/FortranModules/non_pp_include.f90
@@ -0,0 +1,3 @@
+SUBROUTINE NON_PP_INCLUDE_SUBROUTINE
+ PRINT *, "Hello World!"
+END SUBROUTINE NON_PP_INCLUDE_SUBROUTINE
diff --git a/Tests/FortranModules/test_non_pp_include_main.f90 b/Tests/FortranModules/test_non_pp_include_main.f90
new file mode 100644
index 0000000..8a04fbd
--- /dev/null
+++ b/Tests/FortranModules/test_non_pp_include_main.f90
@@ -0,0 +1,5 @@
+INCLUDE "non_pp_include.f90"
+
+PROGRAM MAINF90
+ CALL NON_PP_INCLUDE_SUBROUTINE
+END PROGRAM MAINF90