diff options
Diffstat (limited to 'Help/manual')
-rw-r--r-- | Help/manual/cmake-buildsystem.7.rst | 6 | ||||
-rw-r--r-- | Help/manual/cmake-commands.7.rst | 1 | ||||
-rw-r--r-- | Help/manual/cmake-compile-features.7.rst | 2 | ||||
-rw-r--r-- | Help/manual/cmake-developer.7.rst | 56 | ||||
-rw-r--r-- | Help/manual/cmake-generators.7.rst | 2 | ||||
-rw-r--r-- | Help/manual/cmake-language.7.rst | 6 | ||||
-rw-r--r-- | Help/manual/cmake-modules.7.rst | 1 | ||||
-rw-r--r-- | Help/manual/cmake-packages.7.rst | 34 | ||||
-rw-r--r-- | Help/manual/cmake-policies.7.rst | 7 | ||||
-rw-r--r-- | Help/manual/cmake-toolchains.7.rst | 17 | ||||
-rw-r--r-- | Help/manual/ctest.1.rst | 2 |
11 files changed, 73 insertions, 61 deletions
diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst index 43f0e97..002f2c2 100644 --- a/Help/manual/cmake-buildsystem.7.rst +++ b/Help/manual/cmake-buildsystem.7.rst @@ -270,7 +270,11 @@ be specified in the order ``lib3`` ``lib1`` ``lib2``: target_link_libraries(myExe lib1 lib2 lib3) target_include_directories(myExe - PRIVATE $<TARGET_PROPERTY:INTERFACE_INCLUDE_DIRECTORIES:lib3>) + PRIVATE $<TARGET_PROPERTY:lib3,INTERFACE_INCLUDE_DIRECTORIES>) + +Note that care must be taken when specifying usage requirements for targets +which will be exported for installation using the :command:`install(EXPORT)` +command. See :ref:`Creating Packages` for more. .. _`Compatible Interface Properties`: diff --git a/Help/manual/cmake-commands.7.rst b/Help/manual/cmake-commands.7.rst index 9c1d3b9..4616dd1 100644 --- a/Help/manual/cmake-commands.7.rst +++ b/Help/manual/cmake-commands.7.rst @@ -31,6 +31,7 @@ These commands may be used freely in CMake projects. /command/cmake_minimum_required /command/cmake_policy /command/configure_file + /command/continue /command/create_test_sourcelist /command/define_property /command/elseif diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst index 4259224..7a6c249 100644 --- a/Help/manual/cmake-compile-features.7.rst +++ b/Help/manual/cmake-compile-features.7.rst @@ -28,7 +28,7 @@ CMake knows are known to the compiler, regardless of language standard or compile flags needed to use them. Features known to CMake are named mostly following the same convention -as the Clang feature test macros. The are some execptions, such as +as the Clang feature test macros. The are some exceptions, such as CMake using ``cxx_final`` and ``cxx_override`` instead of the single ``cxx_override_control`` used by Clang. diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst index 0884a59..672c9b7 100644 --- a/Help/manual/cmake-developer.7.rst +++ b/Help/manual/cmake-developer.7.rst @@ -21,32 +21,6 @@ CMake is required to build with ancient C++ compilers and standard library implementations. Some common C++ constructs may not be used in CMake in order to build with such toolchains. -std::vector::at ---------------- - -The ``at()`` member function of ``std::vector`` may not be used. Use -``operator[]`` instead: - -.. code-block:: c++ - - std::vector<int> someVec = getVec(); - int i1 = someVec.at(5); // Wrong - int i2 = someVec[5]; // Ok - -std::string::append and std::string::clear ------------------------------------------- - -The ``append()`` and ``clear()`` member functions of ``std::string`` may not -be used. Use ``operator+=`` and ``operator=`` instead: - -.. code-block:: c++ - - std::string stringBuilder; - stringBuilder.append("chunk"); // Wrong - stringBuilder.clear(); // Wrong - stringBuilder += "chunk"; // Ok - stringBuilder = ""; // Ok - std::set const iterators ------------------------ @@ -73,28 +47,6 @@ The return value of ``find()`` must be assigned to an intermediate // ... } -Char Array to ``string`` Conversions with Algorithms ----------------------------------------------------- - -In some implementations, algorithms operating on iterators to a container of -``std::string`` can not accept a ``const char*`` value: - -.. code-block:: c++ - - const char* dir = /*...*/; - std::vector<std::string> vec; - // ... - std::binary_search(vec.begin(), vec.end(), dir); // Wrong - -The ``std::string`` may need to be explicitly constructed: - -.. code-block:: c++ - - const char* dir = /*...*/; - std::vector<std::string> vec; - // ... - std::binary_search(vec.begin(), vec.end(), std::string(dir)); // Ok - std::auto_ptr ------------- @@ -147,7 +99,7 @@ A loop must be used instead: theSet.insert(*it); } -.. MSVC6, SunCC 5.9 +.. SunCC 5.9 Template Parameter Defaults --------------------------- @@ -177,12 +129,6 @@ this does not work with other ancient compilers: and invoke it with the value ``0`` explicitly in all cases. -std::min and std::max ---------------------- - -``min`` and ``max`` are defined as macros on some systems. ``std::min`` and -``std::max`` may not be used. Use ``cmMinimum`` and ``cmMaximum`` instead. - size_t ------ diff --git a/Help/manual/cmake-generators.7.rst b/Help/manual/cmake-generators.7.rst index 4bc8c5f..bda7eef 100644 --- a/Help/manual/cmake-generators.7.rst +++ b/Help/manual/cmake-generators.7.rst @@ -64,7 +64,7 @@ one may launch CMake from any environment. /generator/Visual Studio 10 2010 /generator/Visual Studio 11 2012 /generator/Visual Studio 12 2013 - /generator/Visual Studio 14 + /generator/Visual Studio 14 2015 /generator/Xcode Extra Generators diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst index 9c511ca..15c101f 100644 --- a/Help/manual/cmake-language.7.rst +++ b/Help/manual/cmake-language.7.rst @@ -469,8 +469,10 @@ Loops The :command:`foreach`/:command:`endforeach` and :command:`while`/:command:`endwhile` commands delimit code -blocks to be executed in a loop. The :command:`break` command -may be used inside such blocks to terminate the loop early. +blocks to be executed in a loop. Inside such blocks the +:command:`break` command may be used to terminate the loop +early whereas the :command:`continue` command may be used +to start with the next iteration immediately. Command Definitions ------------------- diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst index f5a35b3..083ed7a 100644 --- a/Help/manual/cmake-modules.7.rst +++ b/Help/manual/cmake-modules.7.rst @@ -118,6 +118,7 @@ All Modules /module/FindIce /module/FindIcotool /module/FindImageMagick + /module/FindIntl /module/FindITK /module/FindJasper /module/FindJava diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst index 13e2ba0..0d18fd7 100644 --- a/Help/manual/cmake-packages.7.rst +++ b/Help/manual/cmake-packages.7.rst @@ -260,6 +260,8 @@ The variables report the version of the package that was actually found. The ``<package>`` part of their name matches the argument given to the :command:`find_package` command. +.. _`Creating Packages`: + Creating Packages ================= @@ -369,6 +371,38 @@ attempt to use version 3 together with version 4. Packages can choose to employ such a pattern if different major versions of the package are designed to be incompatible. +Note that it is not advisable to populate any properties which may contain +paths, such as :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and +:prop_tgt:`INTERFACE_LINK_LIBRARIES`, with paths relevnt to dependencies. +That would hard-code into installed packages the include directory or library +paths for dependencies **as found on the machine the package was made on**. + +That is, code like this is incorrect for targets which will be used to +generate config file packages: + +.. code-block:: cmake + + target_link_libraries(ClimbingStats INTERFACE + ${Boost_LIBRARIES};${OtherDep_LIBRARIES}> + ) + target_include_directories(ClimbingStats INTERFACE + $<INSTALL_INTERFACE:${Boost_INCLUDE_DIRS};${OtherDep_INCLUDE_DIRS}> + ) + +Dependencies must provide their own :ref:`IMPORTED targets <Imported Targets>` +which have their own :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and +:prop_tgt:`IMPORTED_LOCATION` populated appropriately. Those +:ref:`IMPORTED targets <Imported Targets>` may then be +used with the :command:`target_link_libraries` command for ``ClimbingStats``. + +That way, when a consumer uses the installed package, the +consumer will run the appropriate :command:`find_package` command (via the +find_dependency macro described below) to find +the dependencies on their own machine and populate the +:ref:`IMPORTED targets <Imported Targets>` with appropriate paths. Note that +many modules currently shipped with CMake do not currently provide +:ref:`IMPORTED targets <Imported Targets>`. + A ``NAMESPACE`` with double-colons is specified when exporting the targets for installation. This convention of double-colons gives CMake a hint that the name is an :prop_tgt:`IMPORTED` target when it is used by downstreams diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index dfa423e..742fd63 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -20,6 +20,12 @@ for a policy, also avoiding the warning. Each policy can also be set to either ``NEW`` or ``OLD`` behavior explicitly on the command line with the :variable:`CMAKE_POLICY_DEFAULT_CMP<NNNN>` variable. +Note that policies are not reliable feature toggles. A policy should +almost never be set to ``OLD``, except to silence warnings in an otherwise +frozen or stable codebase, or temporarily as part of a larger migration +path. The ``OLD`` behavior of each policy is undesirable and will be +replaced with an error condition in a future release. + The :command:`cmake_minimum_required` command does more than report an error if a too-old version of CMake is used to build a project. It also sets all policies introduced in that CMake version or earlier to @@ -106,3 +112,4 @@ All Policies /policy/CMP0052 /policy/CMP0053 /policy/CMP0054 + /policy/CMP0055 diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst index afc8ba2..44ffb3b 100644 --- a/Help/manual/cmake-toolchains.7.rst +++ b/Help/manual/cmake-toolchains.7.rst @@ -241,3 +241,20 @@ Windows Store may look like this: set(CMAKE_SYSTEM_NAME WindowsStore) set(CMAKE_SYSTEM_VERSION 8.1) + +Cross Compiling using NVIDIA Nsight Tegra +----------------------------------------- + +A toolchain file to configure a Visual Studio generator to +build using NVIDIA Nsight Tegra targeting Android may look +like this: + +.. code-block:: cmake + + set(CMAKE_SYSTEM_NAME Android) + +The :variable:`CMAKE_GENERATOR_TOOLSET` may be set to select +the Nsight Tegra "Toolchain Version" value. + +See the :prop_tgt:`ANDROID_API` and :prop_tgt:`ANDROID_GUI` +target properties to configure targets within the project. diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst index 03e86af..cc132c2 100644 --- a/Help/manual/ctest.1.rst +++ b/Help/manual/ctest.1.rst @@ -58,7 +58,7 @@ Options will have no effect. ``-j <jobs>, --parallel <jobs>`` - Run the tests in parallel using thegiven number of jobs. + Run the tests in parallel using the given number of jobs. This option tells ctest to run the tests in parallel using given number of jobs. This option can also be set by setting the |