[Cmake-commits] CMake branch, next, updated. v3.5.0-rc1-28-g599f02d
Brad King
brad.king at kitware.com
Fri Feb 5 09:29:31 EST 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 599f02d90301a61a10a9ef9273f0f6c1332242d3 (commit)
via c5eb21b6d1f4187778ad49545761a818e1126541 (commit)
from d57db1d14df72ff5a13aa169a5334a453121ca2c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=599f02d90301a61a10a9ef9273f0f6c1332242d3
commit 599f02d90301a61a10a9ef9273f0f6c1332242d3
Merge: d57db1d c5eb21b
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Feb 5 09:29:30 2016 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Feb 5 09:29:30 2016 -0500
Merge topic 'fix-Fortran-module-in-subdir' into next
c5eb21b6 Fix dependency scanning configuration in subdirectories
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c5eb21b6d1f4187778ad49545761a818e1126541
commit c5eb21b6d1f4187778ad49545761a818e1126541
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Feb 5 08:55:15 2016 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Feb 5 09:26:44 2016 -0500
Fix dependency scanning configuration in subdirectories
Refactoring in commit v3.5.0-rc1~347^2~2 (Set the current dirs on the
snapshot before creating the cmMakefile) accidentally changed the
source and binary directories configured in `cmake -E cmake_depends`
for use during dependency scanning. This can cause the wrong directory
information to be loaded. It also breaks Fortran module dependency
scanning for modules provided by targets in subdirectories that do
not have Fortran_MODULE_DIRECTORY set.
Fix the dependency scanning directory configuration and add a test to
cover the Fortran module case in which the breakage was observed.
Reported-by: Kelly Thompson <kgt at lanl.gov>
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 1dc304c..e9d77b2 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -813,10 +813,8 @@ 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());
+ snapshot.GetDirectory().SetCurrentBinary(startOutDir);
+ snapshot.GetDirectory().SetCurrentSource(startDir);
cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(ggd, snapshot));
cmsys::auto_ptr<cmLocalGenerator> lgd(
ggd->CreateLocalGenerator(mf.get()));
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt
index 753ce27..ecf38a6 100644
--- a/Tests/Fortran/CMakeLists.txt
+++ b/Tests/Fortran/CMakeLists.txt
@@ -223,5 +223,6 @@ if(TEST_MODULE_DEPENDS)
endif()
add_subdirectory(Library)
+ add_subdirectory(Subdir)
add_subdirectory(Executable)
endif()
diff --git a/Tests/Fortran/Executable/CMakeLists.txt b/Tests/Fortran/Executable/CMakeLists.txt
index 55f21ad..de08d86 100644
--- a/Tests/Fortran/Executable/CMakeLists.txt
+++ b/Tests/Fortran/Executable/CMakeLists.txt
@@ -3,6 +3,6 @@ include_directories(${External_BINARY_DIR})
link_directories(${External_BINARY_DIR})
add_executable(subdir_exe2 main.f90)
-target_link_libraries(subdir_exe2 subdir_mods)
+target_link_libraries(subdir_exe2 subdir_mods subdir_mods2)
add_dependencies(subdir_exe2 ExternalTarget)
target_link_libraries(subdir_exe2 myext)
diff --git a/Tests/Fortran/Executable/main.f90 b/Tests/Fortran/Executable/main.f90
index f21156c..640259c 100644
--- a/Tests/Fortran/Executable/main.f90
+++ b/Tests/Fortran/Executable/main.f90
@@ -1,6 +1,7 @@
PROGRAM MAINF90
USE libraryModuleA
USE libraryModuleB
+ USE subdirModuleA
USE externalMod
CALL printExtModGreeting
END PROGRAM MAINF90
diff --git a/Tests/Fortran/Subdir/CMakeLists.txt b/Tests/Fortran/Subdir/CMakeLists.txt
new file mode 100644
index 0000000..52683e5
--- /dev/null
+++ b/Tests/Fortran/Subdir/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_library(subdir_mods2 subdir.f90)
+target_include_directories(subdir_mods2 INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
diff --git a/Tests/Fortran/Subdir/subdir.f90 b/Tests/Fortran/Subdir/subdir.f90
new file mode 100644
index 0000000..68955f6
--- /dev/null
+++ b/Tests/Fortran/Subdir/subdir.f90
@@ -0,0 +1,2 @@
+MODULE subdirModuleA
+END MODULE
-----------------------------------------------------------------------
Summary of changes:
Source/cmcmd.cxx | 6 ++----
Tests/Fortran/CMakeLists.txt | 1 +
Tests/Fortran/Executable/CMakeLists.txt | 2 +-
Tests/Fortran/Executable/main.f90 | 1 +
Tests/Fortran/Subdir/CMakeLists.txt | 2 ++
Tests/Fortran/Subdir/subdir.f90 | 2 ++
6 files changed, 9 insertions(+), 5 deletions(-)
create mode 100644 Tests/Fortran/Subdir/CMakeLists.txt
create mode 100644 Tests/Fortran/Subdir/subdir.f90
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list