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 382dcfc4eea6ed4ff12fe1a1dfd5fe243fd3774d (commit) via 4ce9742ae33678d8fce189d172c2fffb1a43061c (commit) from 5373eeccbd6911aa862ecddbbd8fa520646447e6 (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=382dcfc4eea6ed4ff12fe1a1dfd5fe243fd3774d commit 382dcfc4eea6ed4ff12fe1a1dfd5fe243fd3774d Merge: 5373eec 4ce9742 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Sun Nov 8 08:20:27 2015 -0500 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Sun Nov 8 08:20:27 2015 -0500 Merge topic 'fix-alias-target-access' into next 4ce9742a Alias: Fix access at generate-time (#15832) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4ce9742ae33678d8fce189d172c2fffb1a43061c commit 4ce9742ae33678d8fce189d172c2fffb1a43061c Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Sun Nov 8 13:31:25 2015 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Sun Nov 8 13:54:49 2015 +0100 Alias: Fix access at generate-time (#15832) Commit c389f8bb (cmLocalGenerator: Port Find method away from GetGeneratorTarget, 2015-10-25) ported the implementation of FindGeneratorTargetToUse away from the FindTargetToUse method, but neglected to handle alias targets. The latter method has a parameter to determine whether to include alias targets in the search, but as that is only needed at configure time, this generate-time equivalent does not need the condition. diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 3d2db42..2126c71 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2274,6 +2274,12 @@ cmGlobalGenerator::FindTarget(const std::string& name, cmGeneratorTarget* cmGlobalGenerator::FindGeneratorTarget(const std::string& name) const { + std::map<std::string, std::string>::const_iterator ai = + this->AliasTargets.find(name); + if (ai != this->AliasTargets.end()) + { + return this->FindGeneratorTargetImpl(ai->second); + } if (cmGeneratorTarget* tgt = this->FindGeneratorTargetImpl(name)) { return tgt; diff --git a/Tests/AliasTarget/CMakeLists.txt b/Tests/AliasTarget/CMakeLists.txt index c50b4e6..e1d8966 100644 --- a/Tests/AliasTarget/CMakeLists.txt +++ b/Tests/AliasTarget/CMakeLists.txt @@ -37,7 +37,9 @@ target_include_directories(bat PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") add_executable(targetgenerator targetgenerator.cpp) add_executable(Generator::Target ALIAS targetgenerator) -add_custom_target(usealias Generator::Target) +add_subdirectory(subdir) + +add_custom_target(usealias Generator::Target $<TARGET_FILE:Sub::tgt>) add_dependencies(bat usealias) if (NOT TARGET Another::Alias) diff --git a/Tests/AliasTarget/subdir/CMakeLists.txt b/Tests/AliasTarget/subdir/CMakeLists.txt new file mode 100644 index 0000000..8c84aea --- /dev/null +++ b/Tests/AliasTarget/subdir/CMakeLists.txt @@ -0,0 +1,3 @@ + +add_library(tgt STATIC empty.cpp) +add_library(Sub::tgt ALIAS tgt) diff --git a/Tests/AliasTarget/subdir/empty.cpp b/Tests/AliasTarget/subdir/empty.cpp new file mode 100644 index 0000000..b19427a --- /dev/null +++ b/Tests/AliasTarget/subdir/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int main(void) +{ + return 0; +} ----------------------------------------------------------------------- Summary of changes: Tests/AliasTarget/subdir/CMakeLists.txt | 3 +++ Tests/AliasTarget/{ => subdir}/empty.cpp | 0 2 files changed, 3 insertions(+) create mode 100644 Tests/AliasTarget/subdir/CMakeLists.txt copy Tests/AliasTarget/{ => subdir}/empty.cpp (100%) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/mailman/listinfo/cmake-commits