[Cmake-commits] CMake branch, master, updated. v3.11.1-814-g9d143ce
Kitware Robot
kwrobot at kitware.com
Wed May 16 10:05:07 EDT 2018
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, master has been updated
via 9d143ce38cca0f8631655f5c19c8d454359ebb6f (commit)
via cd5d6dfadae4d177c1ce79530fbc6d7cbc7e43e9 (commit)
via c8c07c24dd6692f5a5d6bfa604e25a8e2275588c (commit)
via d32ceffb1ea28d78780fd2f4d34842fcb81331cb (commit)
via c9349cc1b94a08b4f5ed86a397e72ceed50847dd (commit)
via 71a033616a748d1bb4286ca0667cedf6b57df217 (commit)
via c2934b025da8f2fd266a050b17043f6b5ead1147 (commit)
via b88e1383698ca6e6252ea96fae36a764054f2443 (commit)
from c698dbd45d0f51b5b13d728a2216308c6a11478e (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=9d143ce38cca0f8631655f5c19c8d454359ebb6f
commit 9d143ce38cca0f8631655f5c19c8d454359ebb6f
Merge: cd5d6df c2934b0
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed May 16 14:04:33 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed May 16 10:04:38 2018 -0400
Merge topic 'findqt4-extra-dirs'
c2934b025d FindQt4: New IMPORTS, PLUGINS and MKSPECS handling
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !2060
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cd5d6dfadae4d177c1ce79530fbc6d7cbc7e43e9
commit cd5d6dfadae4d177c1ce79530fbc6d7cbc7e43e9
Merge: c8c07c2 c9349cc
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed May 16 14:03:33 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed May 16 10:03:39 2018 -0400
Merge topic 'subdirectory-linking'
c9349cc1b9 target_link_libraries: Allow use with targets in other directories
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !2040
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c8c07c24dd6692f5a5d6bfa604e25a8e2275588c
commit c8c07c24dd6692f5a5d6bfa604e25a8e2275588c
Merge: d32ceff 71a0336
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed May 16 14:02:42 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed May 16 10:02:48 2018 -0400
Merge topic 'dotnet_target_fw_init'
71a033616a added CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION variable
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !2032
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d32ceffb1ea28d78780fd2f4d34842fcb81331cb
commit d32ceffb1ea28d78780fd2f4d34842fcb81331cb
Merge: c698dbd b88e138
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed May 16 14:01:48 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed May 16 10:01:57 2018 -0400
Merge topic 'vs-nitpicks'
b88e138369 cmVisualStudio10TargetGenerator: minor code cleanup
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !2063
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c9349cc1b94a08b4f5ed86a397e72ceed50847dd
commit c9349cc1b94a08b4f5ed86a397e72ceed50847dd
Author: Patrick Stotko <stotko at cs.uni-bonn.de>
AuthorDate: Fri May 11 18:06:53 2018 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue May 15 10:22:35 2018 -0400
target_link_libraries: Allow use with targets in other directories
Previously the command did not allow naming targets on the LHS that
were not created in the calling directory. Lift this restriction to
enable more flexible use by projects.
Fixes: #17943
diff --git a/Copyright.txt b/Copyright.txt
index 660455f..743c634 100644
--- a/Copyright.txt
+++ b/Copyright.txt
@@ -78,6 +78,7 @@ The following individuals and institutions are among the Contributors:
* Nikita Krupen'ko <krnekit at gmail.com>
* NVIDIA Corporation <www.nvidia.com>
* OpenGamma Ltd. <opengamma.com>
+* Patrick Stotko <stotko at cs.uni-bonn.de>
* Per Øyvind Karlsen <peroyvind at mandriva.org>
* Peter Collingbourne <peter at pcc.me.uk>
* Petr Gotthard <gotthard at honeywell.com>
diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst
index fcc2c07..6379730 100644
--- a/Help/command/target_link_libraries.rst
+++ b/Help/command/target_link_libraries.rst
@@ -18,7 +18,7 @@ All of them have the general form::
target_link_libraries(<target> ... <item>... ...)
-The named ``<target>`` must have been created in the current directory by
+The named ``<target>`` must have been created by
a command such as :command:`add_executable` or :command:`add_library` and
must not be an :ref:`ALIAS target <Alias Targets>`.
Repeated calls for the same ``<target>`` append items in the order called.
diff --git a/Help/release/dev/subdirectory-linking.rst b/Help/release/dev/subdirectory-linking.rst
new file mode 100644
index 0000000..1909c36
--- /dev/null
+++ b/Help/release/dev/subdirectory-linking.rst
@@ -0,0 +1,5 @@
+subdirectory-linking
+--------------------
+
+* The :command:`target_link_libraries` command may now be called
+ to modify targets created outside the current directory.
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 699fff8..53f1213 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -364,7 +364,7 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
if (this->CurrentProcessingState != ProcessingKeywordLinkInterface &&
this->CurrentProcessingState != ProcessingPlainLinkInterface) {
- // Assure that the target on the LHS was created in the current directory.
+ // Find target on the LHS locally
cmTarget* t =
this->Makefile->FindLocalNonAliasTarget(this->Target->GetName());
if (!t) {
@@ -377,11 +377,18 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
}
}
}
+
+ // If no local target has been found, find it in the global scope
+ if (!t) {
+ t = this->Makefile->GetGlobalGenerator()->FindTarget(
+ this->Target->GetName(), true);
+ }
+
if (!t) {
std::ostringstream e;
e << "Attempt to add link library \"" << lib << "\" to target \""
<< this->Target->GetName()
- << "\" which is not built in this directory.";
+ << "\" which does not exist or is an alias target.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
return false;
}
diff --git a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
index 97b0888..d61fa5f 100644
--- a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
@@ -8,7 +8,10 @@ run_cmake(ImportedTarget)
run_cmake(ImportedTargetFailure)
run_cmake(MixedSignature)
run_cmake(Separate-PRIVATE-LINK_PRIVATE-uses)
+run_cmake(SubDirImportedTarget)
run_cmake(SubDirTarget)
+run_cmake(SubDirTarget-UNKNOWN-IMPORTED)
+run_cmake(SubDirTarget-UNKNOWN-IMPORTED-GLOBAL)
run_cmake(SharedDepNotTarget)
run_cmake(StaticPrivateDepNotExported)
run_cmake(StaticPrivateDepNotTarget)
diff --git a/Tests/RunCMake/target_link_libraries/SubDirImportedTarget-stdout.txt b/Tests/RunCMake/target_link_libraries/SubDirImportedTarget-stdout.txt
new file mode 100644
index 0000000..a7ef260
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/SubDirImportedTarget-stdout.txt
@@ -0,0 +1,4 @@
+-- mainexeUnknownImportedGlobal: mainlib;sublib
+-- mainlibUnknownImportedGlobal: mainlib;sublib
+-- subexeUnknownImportedGlobal: mainlib;sublib
+-- sublibUnknownImportedGlobal: mainlib;sublib
diff --git a/Tests/RunCMake/target_link_libraries/SubDirImportedTarget.cmake b/Tests/RunCMake/target_link_libraries/SubDirImportedTarget.cmake
new file mode 100644
index 0000000..738280b
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/SubDirImportedTarget.cmake
@@ -0,0 +1,17 @@
+enable_language(C)
+
+add_executable(mainexeUnknownImportedGlobal IMPORTED GLOBAL)
+add_library(mainlibUnknownImportedGlobal UNKNOWN IMPORTED GLOBAL)
+add_library(mainlib empty.c)
+
+add_subdirectory(SubDirImportedTarget)
+
+target_link_libraries(subexeUnknownImportedGlobal INTERFACE mainlib)
+target_link_libraries(subexeUnknownImportedGlobal INTERFACE sublib)
+get_property(subexeUnknownImportedGlobal_libs TARGET subexeUnknownImportedGlobal PROPERTY INTERFACE_LINK_LIBRARIES)
+message(STATUS "subexeUnknownImportedGlobal: ${subexeUnknownImportedGlobal_libs}")
+
+target_link_libraries(sublibUnknownImportedGlobal INTERFACE mainlib)
+target_link_libraries(sublibUnknownImportedGlobal INTERFACE sublib)
+get_property(sublibUnknownImportedGlobal_libs TARGET sublibUnknownImportedGlobal PROPERTY INTERFACE_LINK_LIBRARIES)
+message(STATUS "sublibUnknownImportedGlobal: ${sublibUnknownImportedGlobal_libs}")
diff --git a/Tests/RunCMake/target_link_libraries/SubDirImportedTarget/CMakeLists.txt b/Tests/RunCMake/target_link_libraries/SubDirImportedTarget/CMakeLists.txt
new file mode 100644
index 0000000..d67a01c
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/SubDirImportedTarget/CMakeLists.txt
@@ -0,0 +1,13 @@
+add_executable(subexeUnknownImportedGlobal IMPORTED GLOBAL)
+add_library(sublibUnknownImportedGlobal UNKNOWN IMPORTED GLOBAL)
+add_library(sublib ../empty.c)
+
+target_link_libraries(mainexeUnknownImportedGlobal INTERFACE mainlib)
+target_link_libraries(mainexeUnknownImportedGlobal INTERFACE sublib)
+get_property(mainexeUnknownImportedGlobal_libs TARGET mainexeUnknownImportedGlobal PROPERTY INTERFACE_LINK_LIBRARIES)
+message(STATUS "mainexeUnknownImportedGlobal: ${mainexeUnknownImportedGlobal_libs}")
+
+target_link_libraries(mainlibUnknownImportedGlobal INTERFACE mainlib)
+target_link_libraries(mainlibUnknownImportedGlobal INTERFACE sublib)
+get_property(mainlibUnknownImportedGlobal_libs TARGET mainlibUnknownImportedGlobal PROPERTY INTERFACE_LINK_LIBRARIES)
+message(STATUS "mainlibUnknownImportedGlobal: ${mainlibUnknownImportedGlobal_libs}")
diff --git a/Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED-GLOBAL-stdout.txt b/Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED-GLOBAL-stdout.txt
new file mode 100644
index 0000000..a8c77cb
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED-GLOBAL-stdout.txt
@@ -0,0 +1,2 @@
+-- mainexe: mainlibUnknownImportedGlobal;sublibUnknownImportedGlobal
+-- subexe: mainlibUnknownImportedGlobal;sublibUnknownImportedGlobal
diff --git a/Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED-GLOBAL.cmake b/Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED-GLOBAL.cmake
new file mode 100644
index 0000000..04d64e6
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED-GLOBAL.cmake
@@ -0,0 +1,11 @@
+enable_language(C)
+
+add_executable(mainexe empty.c)
+add_library(mainlibUnknownImportedGlobal UNKNOWN IMPORTED GLOBAL)
+
+add_subdirectory(SubDirTarget-UNKNOWN-IMPORTED-GLOBAL)
+
+target_link_libraries(subexe mainlibUnknownImportedGlobal)
+target_link_libraries(subexe sublibUnknownImportedGlobal)
+get_property(subexe_libs TARGET subexe PROPERTY INTERFACE_LINK_LIBRARIES)
+message(STATUS "subexe: ${subexe_libs}")
diff --git a/Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED-GLOBAL/CMakeLists.txt b/Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED-GLOBAL/CMakeLists.txt
new file mode 100644
index 0000000..6c0c8b2
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED-GLOBAL/CMakeLists.txt
@@ -0,0 +1,7 @@
+add_executable(subexe ../empty.c)
+add_library(sublibUnknownImportedGlobal UNKNOWN IMPORTED GLOBAL)
+
+target_link_libraries(mainexe mainlibUnknownImportedGlobal)
+target_link_libraries(mainexe sublibUnknownImportedGlobal)
+get_property(mainexe_libs TARGET mainexe PROPERTY INTERFACE_LINK_LIBRARIES)
+message(STATUS "mainexe: ${mainexe_libs}")
diff --git a/Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED-stdout.txt b/Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED-stdout.txt
new file mode 100644
index 0000000..4980dc9
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED-stdout.txt
@@ -0,0 +1,2 @@
+-- mainexe: mainlibUnknownImported;sublibUnknownImported
+-- subexe: mainlibUnknownImported;sublibUnknownImported
diff --git a/Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED.cmake b/Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED.cmake
new file mode 100644
index 0000000..e476a3f
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED.cmake
@@ -0,0 +1,11 @@
+enable_language(C)
+
+add_executable(mainexe empty.c)
+add_library(mainlibUnknownImported UNKNOWN IMPORTED)
+
+add_subdirectory(SubDirTarget-UNKNOWN-IMPORTED)
+
+target_link_libraries(subexe mainlibUnknownImported)
+target_link_libraries(subexe sublibUnknownImported)
+get_property(subexe_libs TARGET subexe PROPERTY INTERFACE_LINK_LIBRARIES)
+message(STATUS "subexe: ${subexe_libs}")
diff --git a/Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED/CMakeLists.txt b/Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED/CMakeLists.txt
new file mode 100644
index 0000000..4a40a68
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED/CMakeLists.txt
@@ -0,0 +1,7 @@
+add_executable(subexe ../empty.c)
+add_library(sublibUnknownImported UNKNOWN IMPORTED)
+
+target_link_libraries(mainexe mainlibUnknownImported)
+target_link_libraries(mainexe sublibUnknownImported)
+get_property(mainexe_libs TARGET mainexe PROPERTY INTERFACE_LINK_LIBRARIES)
+message(STATUS "mainexe: ${mainexe_libs}")
diff --git a/Tests/RunCMake/target_link_libraries/SubDirTarget-result.txt b/Tests/RunCMake/target_link_libraries/SubDirTarget-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/target_link_libraries/SubDirTarget-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/target_link_libraries/SubDirTarget-stderr.txt b/Tests/RunCMake/target_link_libraries/SubDirTarget-stderr.txt
deleted file mode 100644
index 5cd1f23..0000000
--- a/Tests/RunCMake/target_link_libraries/SubDirTarget-stderr.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-^CMake Error at SubDirTarget.cmake:[0-9]+ \(target_link_libraries\):
- Attempt to add link library "m" to target "subexe" which is not built in
- this directory.
-Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/target_link_libraries/SubDirTarget-stdout.txt b/Tests/RunCMake/target_link_libraries/SubDirTarget-stdout.txt
new file mode 100644
index 0000000..646f984
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/SubDirTarget-stdout.txt
@@ -0,0 +1,2 @@
+-- mainexe: mainlib;sublib
+-- subexe: mainlib;sublib
diff --git a/Tests/RunCMake/target_link_libraries/SubDirTarget.cmake b/Tests/RunCMake/target_link_libraries/SubDirTarget.cmake
index 32431ce..55c658d 100644
--- a/Tests/RunCMake/target_link_libraries/SubDirTarget.cmake
+++ b/Tests/RunCMake/target_link_libraries/SubDirTarget.cmake
@@ -1,3 +1,11 @@
enable_language(C)
+
+add_executable(mainexe empty.c)
+add_library(mainlib empty.c)
+
add_subdirectory(SubDirTarget)
-target_link_libraries(subexe m)
+
+target_link_libraries(subexe mainlib)
+target_link_libraries(subexe sublib)
+get_property(subexe_libs TARGET subexe PROPERTY INTERFACE_LINK_LIBRARIES)
+message(STATUS "subexe: ${subexe_libs}")
diff --git a/Tests/RunCMake/target_link_libraries/SubDirTarget/CMakeLists.txt b/Tests/RunCMake/target_link_libraries/SubDirTarget/CMakeLists.txt
index b0b2380..3d956a8 100644
--- a/Tests/RunCMake/target_link_libraries/SubDirTarget/CMakeLists.txt
+++ b/Tests/RunCMake/target_link_libraries/SubDirTarget/CMakeLists.txt
@@ -1 +1,7 @@
add_executable(subexe ../empty.c)
+add_library(sublib ../empty.c)
+
+target_link_libraries(mainexe mainlib)
+target_link_libraries(mainexe sublib)
+get_property(mainexe_libs TARGET mainexe PROPERTY INTERFACE_LINK_LIBRARIES)
+message(STATUS "mainexe: ${mainexe_libs}")
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=71a033616a748d1bb4286ca0667cedf6b57df217
commit 71a033616a748d1bb4286ca0667cedf6b57df217
Author: Michael Stürmer <michael.stuermer at schaeffler.com>
AuthorDate: Thu May 3 06:57:08 2018 +0200
Commit: Michael Stürmer <michael.stuermer at schaeffler.com>
CommitDate: Tue May 15 09:00:31 2018 +0200
added CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION variable
Fixes: #17955
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index b3e2fec..b313f38 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -171,6 +171,7 @@ Properties on Targets
/prop_tgt/DEBUG_POSTFIX
/prop_tgt/DEFINE_SYMBOL
/prop_tgt/DEPLOYMENT_REMOTE_DIRECTORY
+ /prop_tgt/DOTNET_TARGET_FRAMEWORK_VERSION
/prop_tgt/EchoString
/prop_tgt/ENABLE_EXPORTS
/prop_tgt/EXCLUDE_FROM_ALL
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 7636305..0f8502c 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -34,6 +34,7 @@ Variables that Provide Information
/variable/CMAKE_CURRENT_SOURCE_DIR
/variable/CMAKE_DIRECTORY_LABELS
/variable/CMAKE_DL_LIBS
+ /variable/CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION
/variable/CMAKE_EDIT_COMMAND
/variable/CMAKE_EXECUTABLE_SUFFIX
/variable/CMAKE_EXTRA_GENERATOR
diff --git a/Help/prop_tgt/DOTNET_TARGET_FRAMEWORK_VERSION.rst b/Help/prop_tgt/DOTNET_TARGET_FRAMEWORK_VERSION.rst
new file mode 100644
index 0000000..a2f7d7d
--- /dev/null
+++ b/Help/prop_tgt/DOTNET_TARGET_FRAMEWORK_VERSION.rst
@@ -0,0 +1,13 @@
+DOTNET_TARGET_FRAMEWORK_VERSION
+-------------------------------
+
+Specify the .NET target framework version.
+
+Used to specify the .NET target framework version for C++/CLI. For
+example, "v4.5".
+
+This property is only evaluated for :ref:`Visual Studio Generators`
+VS 2010 and above.
+
+Can be initialized for all targets using the variable
+:variable:`CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION`.
diff --git a/Help/prop_tgt/VS_DOTNET_TARGET_FRAMEWORK_VERSION.rst b/Help/prop_tgt/VS_DOTNET_TARGET_FRAMEWORK_VERSION.rst
index 829d696..9f5a313 100644
--- a/Help/prop_tgt/VS_DOTNET_TARGET_FRAMEWORK_VERSION.rst
+++ b/Help/prop_tgt/VS_DOTNET_TARGET_FRAMEWORK_VERSION.rst
@@ -5,3 +5,6 @@ Specify the .NET target framework version.
Used to specify the .NET target framework version for C++/CLI. For
example, "v4.5".
+
+This property is deprecated and should not be used anymore. Use
+:prop_tgt:`DOTNET_TARGET_FRAMEWORK_VERSION` instead.
diff --git a/Help/release/dev/dotnet-target-framework-ver-init.rst b/Help/release/dev/dotnet-target-framework-ver-init.rst
new file mode 100644
index 0000000..fd1490c
--- /dev/null
+++ b/Help/release/dev/dotnet-target-framework-ver-init.rst
@@ -0,0 +1,11 @@
+dotnet-target-fw-initialization
+-------------------------------
+
+* The :prop_tgt:`DOTNET_TARGET_FRAMEWORK_VERSION` target property
+ was introduced as replacement for
+ :prop_tgt:`VS_DOTNET_TARGET_FRAMEWORK_VERSION`, which is considered
+ deprecated now.
+
+* The :variable:`CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION` variable
+ was defined to initialize all
+ :prop_tgt:`DOTNET_TARGET_FRAMEWORK_VERSION` target properties.
diff --git a/Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION.rst b/Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION.rst
new file mode 100644
index 0000000..124fefe
--- /dev/null
+++ b/Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION.rst
@@ -0,0 +1,16 @@
+CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION
+-------------------------------------
+
+Default value for :prop_tgt:`DOTNET_TARGET_FRAMEWORK_VERSION`
+property of targets.
+
+This variable is used to initialize the
+:prop_tgt:`DOTNET_TARGET_FRAMEWORK_VERSION` property on all
+targets. See that target property for additional information.
+
+Setting ``CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION`` may be necessary
+when working with ``C#`` and newer .NET framework versions to
+avoid referencing errors with the ``ALL_BUILD`` CMake target.
+
+This variable is only evaluated for :ref:`Visual Studio Generators`
+VS 2010 and above.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index d17a85a..7dcba74 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -399,6 +399,10 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
this->SetPropertyDefault("JOB_POOL_COMPILE", nullptr);
this->SetPropertyDefault("JOB_POOL_LINK", nullptr);
}
+
+ if (this->TargetTypeValue <= cmStateEnums::UTILITY) {
+ this->SetPropertyDefault("DOTNET_TARGET_FRAMEWORK_VERSION", nullptr);
+ }
}
cmGlobalGenerator* cmTarget::GetGlobalGenerator() const
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index fcea48b..839c7d3 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -481,10 +481,17 @@ void cmVisualStudio10TargetGenerator::Generate()
projLabel = this->Name.c_str();
}
e1.Element("ProjectName", projLabel);
- if (const char* targetFrameworkVersion =
- this->GeneratorTarget->GetProperty(
- "VS_DOTNET_TARGET_FRAMEWORK_VERSION")) {
- e1.Element("TargetFrameworkVersion", targetFrameworkVersion);
+ {
+ // TODO: add deprecation warning for VS_* property?
+ const char* targetFrameworkVersion = this->GeneratorTarget->GetProperty(
+ "VS_DOTNET_TARGET_FRAMEWORK_VERSION");
+ if (!targetFrameworkVersion) {
+ targetFrameworkVersion = this->GeneratorTarget->GetProperty(
+ "DOTNET_TARGET_FRAMEWORK_VERSION");
+ }
+ if (targetFrameworkVersion) {
+ e1.Element("TargetFrameworkVersion", targetFrameworkVersion);
+ }
}
// Disable the project upgrade prompt that is displayed the first time a
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c2934b025da8f2fd266a050b17043f6b5ead1147
commit c2934b025da8f2fd266a050b17043f6b5ead1147
Author: Christian Pfeiffer <cpfeiffer at live.de>
AuthorDate: Thu May 10 19:40:51 2018 +0200
Commit: Christian Pfeiffer <cpfeiffer at live.de>
CommitDate: Mon May 14 13:34:59 2018 +0200
FindQt4: New IMPORTS, PLUGINS and MKSPECS handling
Fixes: #14155
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 5a7eadb..847a798 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -547,15 +547,11 @@ if (QT_QMAKE_EXECUTABLE AND
if(NOT WIN32)
string(REPLACE ":" ";" qt_mkspecs_dirs "${qt_mkspecs_dirs}")
endif()
- set(qt_cross_paths)
- foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
- set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/mkspecs")
- endforeach()
- set(QT_MKSPECS_DIR NOTFOUND)
+
find_path(QT_MKSPECS_DIR NAMES qconfig.pri
- HINTS ${qt_cross_paths} ${qt_mkspecs_dirs}
- DOC "The location of the Qt mkspecs containing qconfig.pri"
- NO_CMAKE_FIND_ROOT_PATH)
+ HINTS ${qt_mkspecs_dirs}
+ PATH_SUFFIXES mkspecs share/qt4/mkspecs
+ DOC "The location of the Qt mkspecs containing qconfig.pri")
endif()
if(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
@@ -709,14 +705,15 @@ if (QT_QMAKE_EXECUTABLE AND
# ask qmake for the plugins directory
if (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED)
_qt4_query_qmake(QT_INSTALL_PLUGINS qt_plugins_dir)
- set(QT_PLUGINS_DIR NOTFOUND)
- foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
- set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/plugins")
- endforeach()
- find_path(QT_PLUGINS_DIR NAMES accessible imageformats sqldrivers codecs designer
- HINTS ${qt_cross_paths} ${qt_plugins_dir}
- DOC "The location of the Qt plugins"
- NO_CMAKE_FIND_ROOT_PATH)
+ if(CMAKE_CROSSCOMPILING OR NOT qt_plugins_dir)
+ find_path(QT_PLUGINS_DIR
+ NAMES accessible bearer codecs designer graphicssystems iconengines imageformats inputmethods qmltooling script sqldrivers
+ HINTS ${qt_plugins_dir}
+ PATH_SUFFIXES plugins lib/qt4/plugins
+ DOC "The location of the Qt plugins")
+ else()
+ set(QT_PLUGINS_DIR ${qt_plugins_dir} CACHE PATH "The location of the Qt plugins")
+ endif()
endif ()
# ask qmake for the translations directory
@@ -728,18 +725,13 @@ if (QT_QMAKE_EXECUTABLE AND
# ask qmake for the imports directory
if (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED)
_qt4_query_qmake(QT_INSTALL_IMPORTS qt_imports_dir)
- if(qt_imports_dir)
- set(QT_IMPORTS_DIR NOTFOUND)
- foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
- set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/imports")
- endforeach()
+ if(CMAKE_CROSSCOMPILING OR NOT qt_imports_dir)
find_path(QT_IMPORTS_DIR NAMES Qt
- HINTS ${qt_cross_paths} ${qt_imports_dir}
- DOC "The location of the Qt imports"
- NO_CMAKE_FIND_ROOT_PATH
- NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH
- NO_CMAKE_SYSTEM_PATH)
- mark_as_advanced(QT_IMPORTS_DIR)
+ HINTS ${qt_imports_dir}
+ PATH_SUFFIXES imports lib/qt4/imports
+ DOC "The location of the Qt imports")
+ else()
+ set(QT_IMPORTS_DIR ${qt_imports_dir} CACHE PATH "The location of the Qt imports")
endif()
endif ()
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b88e1383698ca6e6252ea96fae36a764054f2443
commit b88e1383698ca6e6252ea96fae36a764054f2443
Author: Vitaly Stakhovsky <vvs31415 at gitlab.org>
AuthorDate: Fri May 11 10:05:51 2018 -0400
Commit: Vitaly Stakhovsky <vvs31415 at gitlab.org>
CommitDate: Fri May 11 10:05:51 2018 -0400
cmVisualStudio10TargetGenerator: minor code cleanup
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 2d3465f..6c81d76 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -40,13 +40,13 @@ static std::string cmVS10EscapeAttr(std::string arg)
struct cmVisualStudio10TargetGenerator::Elem
{
std::ostream& S;
- int Indent;
+ const int Indent;
bool HasElements = false;
std::string Tag;
- Elem(std::ostream& s, int i)
+ Elem(std::ostream& s)
: S(s)
- , Indent(i)
+ , Indent(0)
{
}
Elem(const Elem&) = delete;
@@ -94,15 +94,19 @@ struct cmVisualStudio10TargetGenerator::Elem
{
S << ">" << cmVS10EscapeXML(val) << "</" << this->Tag << ">\n";
}
- void WriteEndTag(const std::string& tag)
+ void EndElement()
{
if (HasElements) {
- this->WriteString("</") << tag << ">\n";
+ this->WriteString("</") << this->Tag << ">";
+ if (this->Indent > 0) {
+ this->S << '\n';
+ } else {
+ // special case: don't print EOL at EOF
+ }
} else {
this->S << " />\n";
}
}
- void EndElement() { this->WriteEndTag(this->Tag); }
void WritePlatformConfigTag(const char* tag, const std::string& cond,
const std::string& content);
@@ -374,14 +378,11 @@ void cmVisualStudio10TargetGenerator::Generate()
(*this->BuildFileStream) << "<?xml version=\"1.0\" encoding=\"" +
this->GlobalGenerator->Encoding() + "\"?>\n";
- Elem e0(*this->BuildFileStream, 0);
+ Elem e0(*this->BuildFileStream);
e0.StartElement("Project");
e0.Attribute("DefaultTargets", "Build");
- // get the tools version to use
- const std::string toolsVer(this->GlobalGenerator->GetToolsVersion());
- e0.Attribute("ToolsVersion", toolsVer);
+ e0.Attribute("ToolsVersion", this->GlobalGenerator->GetToolsVersion());
e0.Attribute("xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");
- e0.SetHasElements();
if (this->NsightTegra) {
Elem e1(e0, "PropertyGroup");
@@ -430,11 +431,11 @@ void cmVisualStudio10TargetGenerator::Generate()
const char* vsProjectTypes =
this->GeneratorTarget->GetProperty("VS_GLOBAL_PROJECT_TYPES");
if (vsProjectTypes) {
- std::string tagName = "ProjectTypes";
+ const char* tagName = "ProjectTypes";
if (this->ProjectType == csproj) {
tagName = "ProjectTypeGuids";
}
- e1.Element(tagName.c_str(), vsProjectTypes);
+ e1.Element(tagName, vsProjectTypes);
}
const char* vsProjectName =
@@ -675,16 +676,16 @@ void cmVisualStudio10TargetGenerator::Generate()
e1.EndElement();
}
if (this->ProjectType == csproj) {
- for (std::string const& i : this->Configurations) {
+ for (std::string const& c : this->Configurations) {
Elem e1(e0, "PropertyGroup");
- e1.Attribute("Condition", "'$(Configuration)' == '" + i + "'");
+ e1.Attribute("Condition", "'$(Configuration)' == '" + c + "'");
e1.SetHasElements();
- this->WriteEvents(e1, i);
+ this->WriteEvents(e1, c);
e1.EndElement();
}
// make sure custom commands are executed before build (if necessary)
- Elem e1(e0, "PropertyGroup");
{
+ Elem e1(e0, "PropertyGroup");
std::ostringstream oss;
oss << "\n";
for (std::string const& i : this->CSharpCustomCommandNames) {
@@ -693,10 +694,11 @@ void cmVisualStudio10TargetGenerator::Generate()
oss << " "
<< "$(BuildDependsOn)\n";
e1.Element("BuildDependsOn", oss.str());
+ e1.EndElement();
}
- e1.EndElement();
}
- e0.WriteString("</Project>");
+ e0.EndElement();
+
// The groups are stored in a separate file for VS 10
this->WriteGroups();
}
@@ -833,7 +835,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup(Elem& e0)
std::string hFileName = obj.substr(0, obj.find_last_of(".")) + ".h";
e2.Element("DependentUpon", hFileName);
- for (std::string const& i : this->Configurations) {
+ for (std::string const& c : this->Configurations) {
std::string s;
if (this->GeneratorTarget->GetProperty("VS_GLOBAL_ROOTNAMESPACE") ||
// Handle variant of VS_GLOBAL_<variable> for RootNamespace.
@@ -841,7 +843,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup(Elem& e0)
s = "$(RootNamespace).";
}
s += "%(Filename).resources";
- e2.WritePlatformConfigTag("LogicalName", CalcCondition(i), s);
+ e2.WritePlatformConfigTag("LogicalName", this->CalcCondition(c), s);
}
} else {
std::string binDir = this->Makefile->GetCurrentBinaryDirectory();
@@ -911,8 +913,7 @@ void cmVisualStudio10TargetGenerator::WriteXamlFilesGroup(Elem& e0)
std::vector<cmSourceFile const*> xamlObjs;
this->GeneratorTarget->GetXamlSources(xamlObjs, "");
if (!xamlObjs.empty()) {
- Elem e1(e0);
- e1.StartElement("ItemGroup");
+ Elem e1(e0, "ItemGroup");
for (cmSourceFile const* oi : xamlObjs) {
std::string obj = oi->GetFullPath();
const char* xamlType;
@@ -1032,8 +1033,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurations(Elem& e0)
void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0)
{
for (std::string const& c : this->Configurations) {
- Elem e1(e0);
- e1.StartElement("PropertyGroup");
+ Elem e1(e0, "PropertyGroup");
e1.Attribute("Condition", this->CalcCondition(c));
e1.Attribute("Label", "Configuration");
@@ -1041,7 +1041,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0)
std::string configType;
if (const char* vsConfigurationType =
this->GeneratorTarget->GetProperty("VS_CONFIGURATION_TYPE")) {
- configType = cmVS10EscapeXML(vsConfigurationType);
+ configType = vsConfigurationType;
} else {
switch (this->GeneratorTarget->GetType()) {
case cmStateEnums::SHARED_LIBRARY:
@@ -1416,16 +1416,13 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
char magic[] = { char(0xEF), char(0xBB), char(0xBF) };
fout.write(magic, 3);
- // get the tools version to use
- const std::string toolsVer(this->GlobalGenerator->GetToolsVersion());
fout << "<?xml version=\"1.0\" encoding=\""
<< this->GlobalGenerator->Encoding() << "\"?>\n";
- Elem e0(fout, 0);
+ Elem e0(fout);
e0.StartElement("Project");
- e0.Attribute("ToolsVersion", toolsVer);
+ e0.Attribute("ToolsVersion", this->GlobalGenerator->GetToolsVersion());
e0.Attribute("xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");
- e0.SetHasElements();
for (auto const& ti : this->Tools) {
this->WriteGroupSources(e0, ti.first, ti.second, sourceGroups);
@@ -1512,6 +1509,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
e1.EndElement();
e0.EndElement();
+ fout << '\n';
if (fout.Close()) {
this->GlobalGenerator->FileReplacedDuringGenerate(path);
@@ -1866,7 +1864,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
// write source file specific tags
this->WriteCSharpSourceProperties(e2, sourceFileTags);
}
- e2.WriteEndTag(tool);
+ e2.EndElement();
}
void cmVisualStudio10TargetGenerator::WriteSource(Elem& e2,
@@ -1919,6 +1917,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
return;
}
Elem e1(e0, "ItemGroup");
+ e1.SetHasElements();
std::vector<size_t> all_configs;
for (size_t ci = 0; ci < this->Configurations.size(); ++ci) {
@@ -2096,7 +2095,6 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
// for the first time we need a new line if there is something
// produced here.
if (!objectName.empty()) {
- e2.SetHasElements();
if (lang == "CUDA") {
e2.Element("CompileOut", "$(IntDir)/" + objectName);
} else {
@@ -2193,7 +2191,6 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
}
}
if (this->IsXamlSource(source->GetFullPath())) {
- e2.SetHasElements();
const std::string& fileName = source->GetFullPath();
std::string xamlFileName = fileName.substr(0, fileName.find_last_of("."));
e2.Element("DependentUpon", xamlFileName);
@@ -2391,8 +2388,8 @@ std::vector<std::string> cmVisualStudio10TargetGenerator::GetIncludes(
bool cmVisualStudio10TargetGenerator::ComputeClOptions()
{
- for (std::string const& i : this->Configurations) {
- if (!this->ComputeClOptions(i)) {
+ for (std::string const& c : this->Configurations) {
+ if (!this->ComputeClOptions(c)) {
return false;
}
}
@@ -2658,8 +2655,8 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
bool cmVisualStudio10TargetGenerator::ComputeRcOptions()
{
- for (std::string const& i : this->Configurations) {
- if (!this->ComputeRcOptions(i)) {
+ for (std::string const& c : this->Configurations) {
+ if (!this->ComputeRcOptions(c)) {
return false;
}
}
@@ -2716,8 +2713,8 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions()
if (!this->GlobalGenerator->IsCudaEnabled()) {
return true;
}
- for (std::string const& i : this->Configurations) {
- if (!this->ComputeCudaOptions(i)) {
+ for (std::string const& c : this->Configurations) {
+ if (!this->ComputeCudaOptions(c)) {
return false;
}
}
@@ -2864,8 +2861,8 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaLinkOptions()
if (!this->GlobalGenerator->IsCudaEnabled()) {
return true;
}
- for (std::string const& i : this->Configurations) {
- if (!this->ComputeCudaLinkOptions(i)) {
+ for (std::string const& c : this->Configurations) {
+ if (!this->ComputeCudaLinkOptions(c)) {
return false;
}
}
@@ -2932,8 +2929,8 @@ bool cmVisualStudio10TargetGenerator::ComputeMasmOptions()
if (!this->GlobalGenerator->IsMasmEnabled()) {
return true;
}
- for (std::string const& i : this->Configurations) {
- if (!this->ComputeMasmOptions(i)) {
+ for (std::string const& c : this->Configurations) {
+ if (!this->ComputeMasmOptions(c)) {
return false;
}
}
@@ -2989,8 +2986,8 @@ bool cmVisualStudio10TargetGenerator::ComputeNasmOptions()
if (!this->GlobalGenerator->IsNasmEnabled()) {
return true;
}
- for (std::string const& i : this->Configurations) {
- if (!this->ComputeNasmOptions(i)) {
+ for (std::string const& c : this->Configurations) {
+ if (!this->ComputeNasmOptions(c)) {
return false;
}
}
@@ -3121,8 +3118,8 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
}
}
- Elem e2(e1, "AntBuild");
// Tell MSBuild to launch Ant.
+ Elem e2(e1, "AntBuild");
{
std::string antBuildPath = rootDir;
ConvertToWindowsSlash(antBuildPath);
@@ -3213,8 +3210,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions()
if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE ||
this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY ||
this->GeneratorTarget->GetType() == cmStateEnums::MODULE_LIBRARY) {
- for (std::string const& i : this->Configurations) {
- if (!this->ComputeLinkOptions(i)) {
+ for (std::string const& c : this->Configurations) {
+ if (!this->ComputeLinkOptions(c)) {
return false;
}
}
@@ -3446,8 +3443,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
bool cmVisualStudio10TargetGenerator::ComputeLibOptions()
{
if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) {
- for (std::string const& i : this->Configurations) {
- if (!this->ComputeLibOptions(i)) {
+ for (std::string const& c : this->Configurations) {
+ if (!this->ComputeLibOptions(c)) {
return false;
}
}
@@ -3624,10 +3621,10 @@ void cmVisualStudio10TargetGenerator::WriteMidlOptions(
for (std::string const& i : includes) {
oss << i << ";";
}
+ oss << "%(AdditionalIncludeDirectories)";
Elem e2(e1, "Midl");
- e2.Element("AdditionalIncludeDirectories",
- oss.str() + "%(AdditionalIncludeDirectories)");
+ e2.Element("AdditionalIncludeDirectories", oss.str());
e2.Element("OutputDirectory", "$(ProjectDir)/$(IntDir)");
e2.Element("HeaderFileName", "%(Filename).h");
e2.Element("TypeLibraryName", "%(Filename).tlb");
@@ -3641,36 +3638,36 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups(Elem& e0)
if (this->ProjectType == csproj) {
return;
}
- for (const auto& i : this->Configurations) {
+ for (const std::string& c : this->Configurations) {
Elem e1(e0, "ItemDefinitionGroup");
- e1.Attribute("Condition", this->CalcCondition(i));
+ e1.Attribute("Condition", this->CalcCondition(c));
// output cl compile flags <ClCompile></ClCompile>
if (this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY) {
- this->WriteClOptions(e1, i);
+ this->WriteClOptions(e1, c);
// output rc compile flags <ResourceCompile></ResourceCompile>
- this->WriteRCOptions(e1, i);
- this->WriteCudaOptions(e1, i);
- this->WriteMasmOptions(e1, i);
- this->WriteNasmOptions(e1, i);
+ this->WriteRCOptions(e1, c);
+ this->WriteCudaOptions(e1, c);
+ this->WriteMasmOptions(e1, c);
+ this->WriteNasmOptions(e1, c);
}
// output midl flags <Midl></Midl>
- this->WriteMidlOptions(e1, i);
+ this->WriteMidlOptions(e1, c);
// write events
if (this->ProjectType != csproj) {
- this->WriteEvents(e1, i);
+ this->WriteEvents(e1, c);
}
// output link flags <Link></Link>
- this->WriteLinkOptions(e1, i);
- this->WriteCudaLinkOptions(e1, i);
+ this->WriteLinkOptions(e1, c);
+ this->WriteCudaLinkOptions(e1, c);
// output lib flags <Lib></Lib>
- this->WriteLibOptions(e1, i);
+ this->WriteLibOptions(e1, c);
// output manifest flags <Manifest></Manifest>
- this->WriteManifestOptions(e1, i);
+ this->WriteManifestOptions(e1, c);
if (this->NsightTegra &&
this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE &&
this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI")) {
- this->WriteAntBuildOptions(e1, i);
+ this->WriteAntBuildOptions(e1, c);
}
e1.EndElement();
}
@@ -3707,13 +3704,12 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
if (commands.empty()) {
return;
}
- Elem e2(e1, name);
cmLocalVisualStudio7Generator* lg = this->LocalGenerator;
std::string script;
const char* pre = "";
std::string comment;
- for (cmCustomCommand const& i : commands) {
- cmCustomCommandGenerator ccg(i, configName, this->LocalGenerator);
+ for (cmCustomCommand const& cc : commands) {
+ cmCustomCommandGenerator ccg(cc, configName, lg);
if (!ccg.HasOnlyEmptyCommandLines()) {
comment += pre;
comment += lg->ConstructComment(ccg);
@@ -3724,6 +3720,7 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
}
comment = cmVS10EscapeComment(comment);
if (this->ProjectType != csproj) {
+ Elem e2(e1, name);
e2.Element("Message", comment);
e2.Element("Command", script);
e2.EndElement();
@@ -3737,7 +3734,7 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
oss << "echo " << comment << "\n";
}
oss << script << "\n";
- e2.Content(oss.str());
+ e1.Element(name, oss.str());
}
}
@@ -3750,8 +3747,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0)
OrderedTargetDependSet depends(unordered, CMAKE_CHECK_BUILD_SYSTEM_TARGET);
Elem e1(e0, "ItemGroup");
e1.SetHasElements();
- for (cmTargetDepend const& i : depends) {
- cmGeneratorTarget const* dt = i;
+ for (cmGeneratorTarget const* dt : depends) {
if (dt->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
continue;
}
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 8c0b6ca..a5ea38c 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -144,7 +144,7 @@ private:
void WriteGroups();
void WriteProjectReferences(Elem& e0);
void WriteApplicationTypeSettings(Elem& e1);
- void OutputSourceSpecificFlags(Elem&, cmSourceFile const* source);
+ void OutputSourceSpecificFlags(Elem& e2, cmSourceFile const* source);
void AddLibraries(const cmComputeLinkInformation& cli,
std::vector<std::string>& libVec,
std::vector<std::string>& vsTargetVec,
-----------------------------------------------------------------------
Summary of changes:
Copyright.txt | 1 +
Help/command/target_link_libraries.rst | 2 +-
Help/manual/cmake-properties.7.rst | 1 +
Help/manual/cmake-variables.7.rst | 1 +
Help/prop_tgt/DOTNET_TARGET_FRAMEWORK_VERSION.rst | 13 ++
.../VS_DOTNET_TARGET_FRAMEWORK_VERSION.rst | 3 +
.../dev/dotnet-target-framework-ver-init.rst | 11 ++
Help/release/dev/subdirectory-linking.rst | 5 +
.../CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION.rst | 16 ++
Modules/FindQt4.cmake | 46 +++---
Source/cmTarget.cxx | 4 +
Source/cmTargetLinkLibrariesCommand.cxx | 11 +-
Source/cmVisualStudio10TargetGenerator.cxx | 157 ++++++++++----------
Source/cmVisualStudio10TargetGenerator.h | 2 +-
.../target_link_libraries/RunCMakeTest.cmake | 3 +
.../SubDirImportedTarget-stdout.txt | 4 +
.../SubDirImportedTarget.cmake | 17 +++
.../SubDirImportedTarget/CMakeLists.txt | 13 ++
...SubDirTarget-UNKNOWN-IMPORTED-GLOBAL-stdout.txt | 2 +
.../SubDirTarget-UNKNOWN-IMPORTED-GLOBAL.cmake | 11 ++
.../CMakeLists.txt | 7 +
.../SubDirTarget-UNKNOWN-IMPORTED-stdout.txt | 2 +
.../SubDirTarget-UNKNOWN-IMPORTED.cmake | 11 ++
.../SubDirTarget-UNKNOWN-IMPORTED/CMakeLists.txt | 7 +
.../target_link_libraries/SubDirTarget-result.txt | 1 -
.../target_link_libraries/SubDirTarget-stderr.txt | 5 -
.../target_link_libraries/SubDirTarget-stdout.txt | 2 +
.../target_link_libraries/SubDirTarget.cmake | 10 +-
.../SubDirTarget/CMakeLists.txt | 6 +
29 files changed, 259 insertions(+), 115 deletions(-)
create mode 100644 Help/prop_tgt/DOTNET_TARGET_FRAMEWORK_VERSION.rst
create mode 100644 Help/release/dev/dotnet-target-framework-ver-init.rst
create mode 100644 Help/release/dev/subdirectory-linking.rst
create mode 100644 Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION.rst
create mode 100644 Tests/RunCMake/target_link_libraries/SubDirImportedTarget-stdout.txt
create mode 100644 Tests/RunCMake/target_link_libraries/SubDirImportedTarget.cmake
create mode 100644 Tests/RunCMake/target_link_libraries/SubDirImportedTarget/CMakeLists.txt
create mode 100644 Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED-GLOBAL-stdout.txt
create mode 100644 Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED-GLOBAL.cmake
create mode 100644 Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED-GLOBAL/CMakeLists.txt
create mode 100644 Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED-stdout.txt
create mode 100644 Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED.cmake
create mode 100644 Tests/RunCMake/target_link_libraries/SubDirTarget-UNKNOWN-IMPORTED/CMakeLists.txt
delete mode 100644 Tests/RunCMake/target_link_libraries/SubDirTarget-result.txt
delete mode 100644 Tests/RunCMake/target_link_libraries/SubDirTarget-stderr.txt
create mode 100644 Tests/RunCMake/target_link_libraries/SubDirTarget-stdout.txt
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list