diff options
19 files changed, 80 insertions, 17 deletions
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 76561b9..3499da8 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -4,10 +4,10 @@ Contributing to CMake Community ========= -CMake is maintained by `Kitware, Inc.`_ and developed in +CMake is maintained and supported by `Kitware`_ and developed in collaboration with a productive community of contributors. -.. _`Kitware, Inc.`: http://www.kitware.com +.. _`Kitware`: http://www.kitware.com/cmake The preferred entry point for new contributors is the mailing list. Please subscribe and post to the `CMake Developers List`_ to offer diff --git a/Help/command/target_include_directories.rst b/Help/command/target_include_directories.rst index 75f917d..581bace 100644 --- a/Help/command/target_include_directories.rst +++ b/Help/command/target_include_directories.rst @@ -40,3 +40,17 @@ Arguments to ``target_include_directories`` may use "generator expressions" with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem properties. + +Include directories usage requirements commonly differ between the build-tree +and the install-tree. The ``BUILD_INTERFACE`` and ``INSTALL_INTERFACE`` +generator expressions can be used to describe separate usage requirements +based on the usage location. Relative paths are allowed within the +``INSTALL_INTERFACE`` expression and are interpreted relative to the +installation prefix. For example: + +.. code-block:: cmake + + target_include_directories(mylib PUBLIC + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/mylib> + $<INSTALL_INTERFACE:include/mylib> # <prefix>/include/mylib + ) diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst index 501b924..f3a5770 100644 --- a/Help/manual/cmake-buildsystem.7.rst +++ b/Help/manual/cmake-buildsystem.7.rst @@ -578,9 +578,19 @@ expands to the installation prefix when imported by a consuming project. Include directories usage requirements commonly differ between the build-tree and the install-tree. The ``BUILD_INTERFACE`` and ``INSTALL_INTERFACE`` generator expressions can be used to describe separate usage requirements -based on the usage location. Relative paths are allowed within these -expressions, and are interpreted relative to the current source directory -or the installation prefix, as appropriate. +based on the usage location. Relative paths are allowed within the +``INSTALL_INTERFACE`` expression and are interpreted relative to the +installation prefix. For example: + +.. code-block:: cmake + + add_library(ClimbingStats climbingstats.cpp) + target_include_directories(ClimbingStats INTERFACE + $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/generated> + $<INSTALL_INTERFACE:/absolute/path> + $<INSTALL_INTERFACE:relative/path> + $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/$<CONFIG>/generated> + ) Two convenience APIs are provided relating to include directories usage requirements. The :variable:`CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE` variable diff --git a/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst b/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst index bf4ab46..899e821 100644 --- a/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst +++ b/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst @@ -3,6 +3,10 @@ INTERFACE_INCLUDE_DIRECTORIES List of public include directories for a library. +The :command:`target_include_directories` command populates this property +with values given to the ``PUBLIC`` and ``INTERFACE`` keywords. Projects +may also get and set the property directly. + Targets may populate this property to publish the include directories required to compile against the headers for the target. Consuming targets can add entries to their own :prop_tgt:`INCLUDE_DIRECTORIES` @@ -13,3 +17,17 @@ Contents of ``INTERFACE_INCLUDE_DIRECTORIES`` may use "generator expressions" with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem properties. + +Include directories usage requirements commonly differ between the build-tree +and the install-tree. The ``BUILD_INTERFACE`` and ``INSTALL_INTERFACE`` +generator expressions can be used to describe separate usage requirements +based on the usage location. Relative paths are allowed within the +``INSTALL_INTERFACE`` expression and are interpreted relative to the +installation prefix. For example: + +.. code-block:: cmake + + set_property(TARGET mylib APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/mylib> + $<INSTALL_INTERFACE:include/mylib> # <prefix>/include/mylib + ) diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake index 2bb7a20..872755c 100644 --- a/Modules/Platform/Windows-GNU.cmake +++ b/Modules/Platform/Windows-GNU.cmake @@ -151,6 +151,7 @@ macro(__windows_compiler_gnu_abi lang) find_program(CMAKE_GNUtoMS_VCVARS NAMES vcvars32.bat DOC "Visual Studio vcvars32.bat" PATHS + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0\\Setup\\VC;ProductDir]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VC;ProductDir]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir]/bin" @@ -160,9 +161,10 @@ macro(__windows_compiler_gnu_abi lang) ) set(CMAKE_GNUtoMS_ARCH x86) elseif("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) - find_program(CMAKE_GNUtoMS_VCVARS NAMES vcvarsamd64.bat + find_program(CMAKE_GNUtoMS_VCVARS NAMES vcvars64.bat vcvarsamd64.bat DOC "Visual Studio vcvarsamd64.bat" PATHS + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0\\Setup\\VC;ProductDir]/bin/amd64" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VC;ProductDir]/bin/amd64" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/bin/amd64" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir]/bin/amd64" @@ -11,10 +11,10 @@ For full documentation visit the `CMake Home Page`_ and the .. _`CMake Home Page`: http://www.cmake.org .. _`CMake Documentation Page`: http://www.cmake.org/cmake/help/documentation.html -CMake is maintained by `Kitware, Inc.`_ and developed in +CMake is maintained and supported by `Kitware`_ and developed in collaboration with a productive community of contributors. -.. _`Kitware, Inc.`: http://www.kitware.com +.. _`Kitware`: http://www.kitware.com/cmake License ======= diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index f62afd6..10879c0 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -812,7 +812,7 @@ void CMakeSetupDialog::doAbout() { QString msg = tr( "CMake %1 (cmake.org).\n" - "CMake suite maintained by Kitware, Inc. (kitware.com).\n" + "CMake suite maintained and supported by Kitware (kitware.com/cmake).\n" "Distributed under terms of the BSD 3-Clause License.\n" "\n" "CMake GUI maintained by csimsoft,\n" diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 9e0064e..cc9fa57 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -750,11 +750,7 @@ void cmCacheManager::AddCacheEntry(const char* key, } e.SetProperty("HELPSTRING", helpString? helpString : "(This variable does not exist and should not be used)"); - if (this->Cache[key].Value == e.Value) - { - this->CMakeInstance->UnwatchUnusedCli(key); - } - this->Cache[key] = e; + this->CMakeInstance->UnwatchUnusedCli(key); } bool cmCacheManager::CacheIterator::IsAtEnd() const diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index 5be4d5c..9df1e79 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -102,7 +102,7 @@ bool cmDocumentation::PrintVersion(std::ostream& os) this->GetNameString() << " version " << cmVersion::GetCMakeVersion() << "\n" "\n" - "CMake suite maintained by Kitware, Inc. (kitware.com).\n" + "CMake suite maintained and supported by Kitware (kitware.com/cmake).\n" ; return true; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index abbabe7..7cbc1da 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1231,7 +1231,10 @@ int cmake::HandleDeleteCacheVariables(const char* var) if(ci.Find(save.key.c_str())) { save.type = ci.GetType(); - save.help = ci.GetProperty("HELPSTRING"); + if(const char* help = ci.GetProperty("HELPSTRING")) + { + save.help = help; + } } saved.push_back(save); } @@ -2664,11 +2667,17 @@ int cmake::Build(const std::string& dir, } if(!it.Find("CMAKE_GENERATOR")) { - std::cerr << "Error: could find generator in Cache\n"; + std::cerr << "Error: could not find CMAKE_GENERATOR in Cache\n"; return 1; } cmsys::auto_ptr<cmGlobalGenerator> gen( this->CreateGlobalGenerator(it.GetValue())); + if(!gen.get()) + { + std::cerr << "Error: could create CMAKE_GENERATOR \"" + << it.GetValue() << "\"\n"; + return 1; + } std::string output; std::string projName; if(!it.Find("CMAKE_PROJECT_NAME")) diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index ada4cab..3aaeac0 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -1,5 +1,12 @@ include(RunCMake) +run_cmake_command(build-no-cache + ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}) +run_cmake_command(build-no-generator + ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}/cache-no-generator) +run_cmake_command(build-bad-generator + ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}/cache-bad-generator) + if(UNIX) run_cmake_command(E_create_symlink-missing-dir ${CMAKE_COMMAND} -E create_symlink T missing-dir/L diff --git a/Tests/RunCMake/CommandLine/build-bad-generator-result.txt b/Tests/RunCMake/CommandLine/build-bad-generator-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/build-bad-generator-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/build-bad-generator-stderr.txt b/Tests/RunCMake/CommandLine/build-bad-generator-stderr.txt new file mode 100644 index 0000000..1103407 --- /dev/null +++ b/Tests/RunCMake/CommandLine/build-bad-generator-stderr.txt @@ -0,0 +1 @@ +^Error: could create CMAKE_GENERATOR "Bad Generator"$ diff --git a/Tests/RunCMake/CommandLine/build-no-cache-result.txt b/Tests/RunCMake/CommandLine/build-no-cache-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/build-no-cache-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/build-no-cache-stderr.txt b/Tests/RunCMake/CommandLine/build-no-cache-stderr.txt new file mode 100644 index 0000000..40dd3c0 --- /dev/null +++ b/Tests/RunCMake/CommandLine/build-no-cache-stderr.txt @@ -0,0 +1 @@ +^Error: could not load cache$ diff --git a/Tests/RunCMake/CommandLine/build-no-generator-result.txt b/Tests/RunCMake/CommandLine/build-no-generator-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/build-no-generator-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/build-no-generator-stderr.txt b/Tests/RunCMake/CommandLine/build-no-generator-stderr.txt new file mode 100644 index 0000000..40ad030 --- /dev/null +++ b/Tests/RunCMake/CommandLine/build-no-generator-stderr.txt @@ -0,0 +1 @@ +^Error: could not find CMAKE_GENERATOR in Cache$ diff --git a/Tests/RunCMake/CommandLine/cache-bad-generator/CMakeCache.txt b/Tests/RunCMake/CommandLine/cache-bad-generator/CMakeCache.txt new file mode 100644 index 0000000..e34af44 --- /dev/null +++ b/Tests/RunCMake/CommandLine/cache-bad-generator/CMakeCache.txt @@ -0,0 +1 @@ +CMAKE_GENERATOR:INTERNAL=Bad Generator diff --git a/Tests/RunCMake/CommandLine/cache-no-generator/CMakeCache.txt b/Tests/RunCMake/CommandLine/cache-no-generator/CMakeCache.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CommandLine/cache-no-generator/CMakeCache.txt |