diff options
122 files changed, 1379 insertions, 578 deletions
diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el index c8b9f8b..f1470f3 100644 --- a/Auxiliary/cmake-mode.el +++ b/Auxiliary/cmake-mode.el @@ -202,7 +202,7 @@ the indentation. Otherwise it retains the same position on the line" ;; Keyword highlighting regex-to-face map. ;; (defconst cmake-font-lock-keywords - (list '("^[ \t]*\\(\\w+\\)[ \t]*(" 1 font-lock-function-name-face)) + (list '("^[ \t]*\\([[:word:]_]+\\)[ \t]*(" 1 font-lock-function-name-face)) "Highlighting expressions for CMAKE mode." ) @@ -241,7 +241,6 @@ the indentation. Otherwise it retains the same position on the line" ; Create the syntax table (setq cmake-mode-syntax-table (make-syntax-table)) (set-syntax-table cmake-mode-syntax-table) - (modify-syntax-entry ?_ "w" cmake-mode-syntax-table) (modify-syntax-entry ?\( "()" cmake-mode-syntax-table) (modify-syntax-entry ?\) ")(" cmake-mode-syntax-table) (modify-syntax-entry ?# "<" cmake-mode-syntax-table) diff --git a/CompileFlags.cmake b/CompileFlags.cmake index a4a4a78..7e9fb16 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -65,6 +65,16 @@ if(CMAKE_SYSTEM_NAME MATCHES "HP-UX" AND CMAKE_CXX_COMPILER_ID MATCHES "HP") endif() endif() +# Workaround for short jump tables on PA-RISC +if(CMAKE_SYSTEM_PROCESSOR MATCHES "^parisc") + if(CMAKE_COMPILER_IS_GNUC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlong-calls") + endif() + if(CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlong-calls") + endif() +endif() + # use the ansi CXX compile flag for building cmake if (CMAKE_ANSI_CXXFLAGS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") @@ -74,10 +84,4 @@ if (CMAKE_ANSI_CFLAGS) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") endif () -# avoid binutils problem with large binaries, e.g. when building CMake in debug mode -# See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50230 -if (CMAKE_SYSTEM_NAME STREQUAL Linux AND CMAKE_SYSTEM_PROCESSOR STREQUAL parisc) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--unique=.text._*") -endif () - include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake) diff --git a/Help/command/add_compile_options.rst b/Help/command/add_compile_options.rst index 214f4be..3fe2a33 100644 --- a/Help/command/add_compile_options.rst +++ b/Help/command/add_compile_options.rst @@ -7,15 +7,16 @@ Adds options to the compilation of source files. add_compile_options(<option> ...) -Adds options to the compiler command line for sources in the current -directory and below. This command can be used to add any options, but -alternative commands exist to add preprocessor definitions -(:command:`target_compile_definitions` and :command:`add_definitions`) or -include directories (:command:`target_include_directories` and -:command:`include_directories`). See documentation of the -:prop_tgt:`directory <COMPILE_OPTIONS>` and +Adds options to the compiler command line for targets in the current +directory and below that are added after this command is invoked. +See documentation of the :prop_dir:`directory <COMPILE_OPTIONS>` and :prop_tgt:`target <COMPILE_OPTIONS>` ``COMPILE_OPTIONS`` properties. +This command can be used to add any options, but alternative commands +exist to add preprocessor definitions (:command:`target_compile_definitions` +and :command:`add_definitions`) or include directories +(:command:`target_include_directories` and :command:`include_directories`). + Arguments to ``add_compile_options`` may use "generator expressions" with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-buildsystem(7)` diff --git a/Help/command/add_definitions.rst b/Help/command/add_definitions.rst index 2965c37..a04faf5 100644 --- a/Help/command/add_definitions.rst +++ b/Help/command/add_definitions.rst @@ -7,10 +7,12 @@ Adds -D define flags to the compilation of source files. add_definitions(-DFOO -DBAR ...) -Adds definitions to the compiler command line for sources in the current -directory and below. This command can be used to add any flags, but -it is intended to add preprocessor definitions. Flags -beginning in -D or /D that look like preprocessor definitions are +Adds definitions to the compiler command line for targets in the current +directory and below (whether added before or after this command is invoked). +This command can be used to add any flags, but it is intended to add +preprocessor definitions (see the :command:`add_compile_options` command +to add other flags). +Flags beginning in -D or /D that look like preprocessor definitions are automatically added to the :prop_dir:`COMPILE_DEFINITIONS` directory property for the current directory. Definitions with non-trivial values may be left in the set of flags instead of being converted for reasons of diff --git a/Help/command/add_library.rst b/Help/command/add_library.rst index f86f3c5..7c06203 100644 --- a/Help/command/add_library.rst +++ b/Help/command/add_library.rst @@ -35,7 +35,7 @@ variable :variable:`BUILD_SHARED_LIBS` is ``ON``. For ``SHARED`` and property is set to ``ON`` automatically. By default the library file will be created in the build tree directory -corresponding to the source tree directory in which thecommand was +corresponding to the source tree directory in which the command was invoked. See documentation of the :prop_tgt:`ARCHIVE_OUTPUT_DIRECTORY`, :prop_tgt:`LIBRARY_OUTPUT_DIRECTORY`, and :prop_tgt:`RUNTIME_OUTPUT_DIRECTORY` target properties to change this @@ -133,14 +133,17 @@ Creates an :ref:`Interface Library <Interface Libraries>`. An ``INTERFACE`` library target does not directly create build output, though it may have properties set on it and it may be installed, exported and imported. Typically the ``INTERFACE_*`` properties are populated on -the interface target using the :command:`set_property`, -:command:`target_link_libraries(INTERFACE)`, -:command:`target_include_directories(INTERFACE)`, -:command:`target_compile_options(INTERFACE)`, -:command:`target_compile_definitions(INTERFACE)`, -and :command:`target_sources(INTERFACE)` commands, and then it -is used as an argument to :command:`target_link_libraries` like any other -target. +the interface target using the commands: + +* :command:`set_property`, +* :command:`target_link_libraries(INTERFACE)`, +* :command:`target_include_directories(INTERFACE)`, +* :command:`target_compile_options(INTERFACE)`, +* :command:`target_compile_definitions(INTERFACE)`, and +* :command:`target_sources(INTERFACE)`, + +and then it is used as an argument to :command:`target_link_libraries` +like any other target. An ``INTERFACE`` :ref:`Imported Target <Imported Targets>` may also be created with this signature. An ``IMPORTED`` library target references a diff --git a/Help/command/ctest_submit.rst b/Help/command/ctest_submit.rst index ed801bb..d9b0b78 100644 --- a/Help/command/ctest_submit.rst +++ b/Help/command/ctest_submit.rst @@ -5,7 +5,11 @@ Submit results to a dashboard server. :: - ctest_submit([PARTS ...] [FILES ...] [RETRY_COUNT count] [RETRY_DELAY delay][RETURN_VALUE res]) + ctest_submit([PARTS ...] [FILES ...] + [RETRY_COUNT count] + [RETRY_DELAY delay] + [RETURN_VALUE res] + ) By default all available parts are submitted if no PARTS or FILES are specified. The PARTS option lists a subset of parts to be submitted. diff --git a/Help/command/install.rst b/Help/command/install.rst index 4c52abf..5dd5aaa 100644 --- a/Help/command/install.rst +++ b/Help/command/install.rst @@ -268,7 +268,8 @@ Custom Installation Logic :: - install([[SCRIPT <file>] [CODE <code>]] [...]) + install([[SCRIPT <file>] [CODE <code>]] + [COMPONENT <component>] [...]) The ``SCRIPT`` form will invoke the given CMake script files during installation. If the script file name is a relative path it will be diff --git a/Help/command/target_compile_options.rst b/Help/command/target_compile_options.rst index 0fdeba6..3362c5d 100644 --- a/Help/command/target_compile_options.rst +++ b/Help/command/target_compile_options.rst @@ -12,8 +12,8 @@ Add compile options to a target. Specify compile options to use when compiling a given target. The named ``<target>`` must have been created by a command such as :command:`add_executable` or :command:`add_library` and must not be an -:prop_tgt:`IMPORTED Target`. If ``BEFORE`` is specified, the content will -be prepended to the property instead of being appended. +:ref:`IMPORTED Target <Imported Targets>`. If ``BEFORE`` is specified, +the content will be prepended to the property instead of being appended. This command can be used to add any options, but alternative commands exist to add preprocessor definitions diff --git a/Help/command/target_include_directories.rst b/Help/command/target_include_directories.rst index 581bace..fd433a8 100644 --- a/Help/command/target_include_directories.rst +++ b/Help/command/target_include_directories.rst @@ -9,8 +9,8 @@ Add include directories to a target. <INTERFACE|PUBLIC|PRIVATE> [items1...] [<INTERFACE|PUBLIC|PRIVATE> [items2...] ...]) -Specify include directories or targets to use when compiling a given -target. The named ``<target>`` must have been created by a command such +Specify include directories to use when compiling a given target. +The named ``<target>`` must have been created by a command such as :command:`add_executable` or :command:`add_library` and must not be an :prop_tgt:`IMPORTED` target. diff --git a/Help/command/target_sources.rst b/Help/command/target_sources.rst index ff756b4..d6f148d 100644 --- a/Help/command/target_sources.rst +++ b/Help/command/target_sources.rst @@ -12,7 +12,7 @@ Add sources to a target. Specify sources to use when compiling a given target. The named ``<target>`` must have been created by a command such as :command:`add_executable` or :command:`add_library` and must not be an -:prop_tgt:`IMPORTED Target`. +:ref:`IMPORTED Target <Imported Targets>`. The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to specify the scope of the following arguments. ``PRIVATE`` and ``PUBLIC`` diff --git a/Help/generator/Visual Studio 14.rst b/Help/generator/Visual Studio 14 2015.rst index d621b7e..b35997a 100644 --- a/Help/generator/Visual Studio 14.rst +++ b/Help/generator/Visual Studio 14 2015.rst @@ -1,7 +1,7 @@ -Visual Studio 14 ----------------- +Visual Studio 14 2015 +--------------------- -Generates Visual Studio 14 project files. +Generates Visual Studio 14 (VS 2015) project files. The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set to specify a target platform name. @@ -9,8 +9,8 @@ to specify a target platform name. For compatibility with CMake versions prior to 3.1, one may specify a target platform name optionally at the end of this generator name: -``Visual Studio 14 Win64`` +``Visual Studio 14 2015 Win64`` Specify target platform ``x64``. -``Visual Studio 14 ARM`` +``Visual Studio 14 2015 ARM`` Specify target platform ``ARM``. diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst index 1ce9a7e..43f0e97 100644 --- a/Help/manual/cmake-buildsystem.7.rst +++ b/Help/manual/cmake-buildsystem.7.rst @@ -3,7 +3,7 @@ cmake-buildsystem(7) ******************** -.. only:: html or latex +.. only:: html .. contents:: diff --git a/Help/manual/cmake-commands.7.rst b/Help/manual/cmake-commands.7.rst index 8ff73a4..9c1d3b9 100644 --- a/Help/manual/cmake-commands.7.rst +++ b/Help/manual/cmake-commands.7.rst @@ -3,7 +3,7 @@ cmake-commands(7) ***************** -.. only:: html or latex +.. only:: html .. contents:: diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst index 8a2fe30..4259224 100644 --- a/Help/manual/cmake-compile-features.7.rst +++ b/Help/manual/cmake-compile-features.7.rst @@ -3,7 +3,7 @@ cmake-compile-features(7) ************************* -.. only:: html or latex +.. only:: html .. contents:: @@ -276,10 +276,13 @@ properties: .. code-block:: cmake add_library(foo INTERFACE) + set(with_variadics ${CMAKE_CURRENT_SOURCE_DIR}/with_variadics) + set(no_variadics ${CMAKE_CURRENT_SOURCE_DIR}/no_variadics) target_link_libraries(foo INTERFACE - "$<$<COMPILE_FEATURES:cxx_variadic_templates>:${CMAKE_CURRENT_SOURCE_DIR}/with_variadics>" - "$<$<NOT:$<COMPILE_FEATURES:cxx_variadic_templates>>:${CMAKE_CURRENT_SOURCE_DIR}/no_variadics>") + "$<$<COMPILE_FEATURES:cxx_variadic_templates>:${with_variadics}>" + "$<$<NOT:$<COMPILE_FEATURES:cxx_variadic_templates>>:${no_variadics}>" + ) Consuming code then simply links to the ``foo`` target as usual and uses the feature-appropriate include directory diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst index 625dac0..0884a59 100644 --- a/Help/manual/cmake-developer.7.rst +++ b/Help/manual/cmake-developer.7.rst @@ -3,7 +3,7 @@ cmake-developer(7) ****************** -.. only:: html or latex +.. only:: html .. contents:: @@ -1005,7 +1005,8 @@ projects that do not require a high enough CMake version. .. code-block:: cmake if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.0.0) - message(AUTHOR_WARNING "Your project should require at least CMake 3.0.0 to use FindFoo.cmake") + message(AUTHOR_WARNING + "Your project should require at least CMake 3.0.0 to use FindFoo.cmake") endif() Now the actual libraries and so on have to be found. The code here will diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index 77259a0..c47a7c4 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -3,7 +3,7 @@ cmake-generator-expressions(7) ****************************** -.. only:: html or latex +.. only:: html .. contents:: @@ -38,6 +38,8 @@ create conditional output:: expands to ``DEBUG_MODE`` when the ``Debug`` configuration is used, and otherwise expands to nothing. +Available logical expressions are: + ``$<0:...>`` Empty string (ignores ``...``) ``$<1:...>`` @@ -111,6 +113,8 @@ expands to ``OLD_COMPILER`` if the :variable:`CMAKE_CXX_COMPILER_VERSION <CMAKE_<LANG>_COMPILER_VERSION>` is less than 4.2.0. +Available informational expressions are: + ``$<CONFIGURATION>`` Configuration name. Deprecated. Use ``CONFIG`` instead. ``$<CONFIG>`` @@ -185,7 +189,13 @@ property with each entry preceeded by ``-I``. Note that a more-complete use in this situation would require first checking if the INCLUDE_DIRECTORIES property is non-empty:: - $<$<BOOL:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>>:-I$<JOIN:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>, -I>> + $<$<BOOL:${prop}>:-I$<JOIN:${prop}, -I>> + +where ``${prop}`` refers to a helper variable:: + + set(prop "$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>") + +Available output expressions are: ``$<JOIN:list,...>`` Joins the list with the content of ``...`` diff --git a/Help/manual/cmake-generators.7.rst b/Help/manual/cmake-generators.7.rst index 7f5093f..bda7eef 100644 --- a/Help/manual/cmake-generators.7.rst +++ b/Help/manual/cmake-generators.7.rst @@ -3,7 +3,7 @@ cmake-generators(7) ******************* -.. only:: html or latex +.. only:: html .. contents:: @@ -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 b83dcad..9c511ca 100644 --- a/Help/manual/cmake-language.7.rst +++ b/Help/manual/cmake-language.7.rst @@ -3,7 +3,7 @@ cmake-language(7) ***************** -.. only:: html or latex +.. only:: html .. contents:: @@ -79,6 +79,10 @@ A CMake Language source file consists of zero or more `Command Invocations`_ separated by newlines and optionally spaces and `Comments`_: +.. raw:: latex + + \begin{small} + .. productionlist:: file: `file_element`* file_element: `command_invocation` `line_ending` | @@ -87,6 +91,10 @@ spaces and `Comments`_: space: <match '[ \t]+'> newline: <match '\n'> +.. raw:: latex + + \end{small} + Note that any source file line not inside `Command Arguments`_ or a `Bracket Comment`_ can end in a `Line Comment`_. @@ -98,6 +106,10 @@ Command Invocations A *command invocation* is a name followed by paren-enclosed arguments separated by whitespace: +.. raw:: latex + + \begin{small} + .. productionlist:: command_invocation: `space`* `identifier` `space`* '(' `arguments` ')' identifier: <match '[A-Za-z_][A-Za-z0-9_]*'> @@ -106,6 +118,10 @@ separated by whitespace: : `separation`* '(' `arguments` ')' separation: `space` | `line_ending` +.. raw:: latex + + \end{small} + For example: .. code-block:: cmake @@ -137,9 +153,17 @@ Command Arguments There are three types of arguments within `Command Invocations`_: +.. raw:: latex + + \begin{small} + .. productionlist:: argument: `bracket_argument` | `quoted_argument` | `unquoted_argument` +.. raw:: latex + + \end{small} + .. _`Bracket Argument`: Bracket Argument @@ -149,6 +173,10 @@ A *bracket argument*, inspired by `Lua`_ long bracket syntax, encloses content between opening and closing "brackets" of the same length: +.. raw:: latex + + \begin{small} + .. productionlist:: bracket_argument: `bracket_open` `bracket_content` `bracket_close` bracket_open: '[' '='{len} '[' @@ -156,6 +184,10 @@ same length: : of the same {len} as the `bracket_open`> bracket_close: ']' '='{len} ']' +.. raw:: latex + + \end{small} + An opening bracket of length *len >= 0* is written ``[`` followed by *len* ``=`` followed by ``[`` and the corresponding closing bracket is written ``]`` followed by *len* ``=`` followed by ``]``. @@ -197,6 +229,10 @@ Quoted Argument A *quoted argument* encloses content between opening and closing double-quote characters: +.. raw:: latex + + \begin{small} + .. productionlist:: quoted_argument: '"' `quoted_element`* '"' quoted_element: <any character except '\' or '"'> | @@ -204,6 +240,10 @@ double-quote characters: : `quoted_continuation` quoted_continuation: '\' `newline` +.. raw:: latex + + \end{small} + Quoted argument content consists of all text between opening and closing quotes. Both `Escape Sequences`_ and `Variable References`_ are evaluated. A quoted argument is always given to the command @@ -246,12 +286,20 @@ An *unquoted argument* is not enclosed by any quoting syntax. It may not contain any whitespace, ``(``, ``)``, ``#``, ``"``, or ``\`` except when escaped by a backslash: +.. raw:: latex + + \begin{small} + .. productionlist:: unquoted_argument: `unquoted_element`+ | `unquoted_legacy` unquoted_element: <any character except whitespace or one of '()#"\'> | : `escape_sequence` unquoted_legacy: <see note in text> +.. raw:: latex + + \end{small} + Unquoted argument content consists of all text in a contiguous block of allowed or escaped characters. Both `Escape Sequences`_ and `Variable References`_ are evaluated. The resulting value is divided @@ -294,12 +342,20 @@ Escape Sequences An *escape sequence* is a ``\`` followed by one character: +.. raw:: latex + + \begin{small} + .. productionlist:: escape_sequence: `escape_identity` | `escape_encoded` | `escape_semicolon` escape_identity: '\' <match '[^A-Za-z0-9;]'> escape_encoded: '\t' | '\r' | '\n' escape_semicolon: '\;' +.. raw:: latex + + \end{small} + A ``\`` followed by a non-alphanumeric character simply encodes the literal character without interpreting it as syntax. A ``\t``, ``\r``, or ``\n`` encodes a tab, carriage return, or newline character, respectively. A ``\;`` @@ -348,9 +404,17 @@ Bracket Comment A ``#`` immediately followed by a `Bracket Argument`_ forms a *bracket comment* consisting of the entire bracket enclosure: +.. raw:: latex + + \begin{small} + .. productionlist:: bracket_comment: '#' `bracket_argument` +.. raw:: latex + + \end{small} + For example: .. code-block:: cmake @@ -371,10 +435,18 @@ Line Comment A ``#`` not immediately followed by a `Bracket Argument`_ forms a *line comment* that runs until the end of the line: +.. raw:: latex + + \begin{small} + .. productionlist:: line_comment: '#' <any text not starting in a `bracket_argument` : and not containing a `newline`> +.. raw:: latex + + \end{small} + For example: .. code-block:: cmake diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst index 61e4bb4..f5a35b3 100644 --- a/Help/manual/cmake-modules.7.rst +++ b/Help/manual/cmake-modules.7.rst @@ -3,7 +3,7 @@ cmake-modules(7) **************** -.. only:: html or latex +.. only:: html .. contents:: diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst index c4cca6d..13e2ba0 100644 --- a/Help/manual/cmake-packages.7.rst +++ b/Help/manual/cmake-packages.7.rst @@ -3,7 +3,7 @@ cmake-packages(7) ***************** -.. only:: html or latex +.. only:: html .. contents:: @@ -282,7 +282,8 @@ shared library: generate_export_header(ClimbingStats) set_property(TARGET ClimbingStats PROPERTY VERSION ${Upstream_VERSION}) set_property(TARGET ClimbingStats PROPERTY SOVERSION 3) - set_property(TARGET ClimbingStats PROPERTY INTERFACE_ClimbingStats_MAJOR_VERSION 3) + set_property(TARGET ClimbingStats PROPERTY + INTERFACE_ClimbingStats_MAJOR_VERSION 3) set_property(TARGET ClimbingStats APPEND PROPERTY COMPATIBLE_INTERFACE_STRING ClimbingStats_MAJOR_VERSION ) @@ -316,7 +317,7 @@ shared library: ) configure_file(cmake/ClimbingStatsConfig.cmake "${CMAKE_CURRENT_BINARY_DIR}/ClimbingStats/ClimbingStatsConfig.cmake" - COPY_ONLY + COPYONLY ) set(ConfigPackageLocation lib/cmake/ClimbingStats) @@ -479,7 +480,7 @@ be true. This can be tested with logic in the package configuration file: foreach(_comp ${ClimbingStats_FIND_COMPONENTS}) if (NOT ";${_supported_components};" MATCHES _comp) set(ClimbingStats_FOUND False) - set(ClimbingStats_NOTFOUND_MESSAGE "Specified unsupported component: ${_comp}") + set(ClimbingStats_NOTFOUND_MESSAGE "Unsupported component: ${_comp}") endif() include("${CMAKE_CURRENT_LIST_DIR}/ClimbingStats${_comp}Targets.cmake") endforeach() diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index f1717a0..dfa423e 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -3,7 +3,7 @@ cmake-policies(7) ***************** -.. only:: html or latex +.. only:: html .. contents:: diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 38bcd04..bf456f5 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -3,7 +3,7 @@ cmake-properties(7) ******************* -.. only:: html or latex +.. only:: html .. contents:: diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst index fe8d62d..e8a2c1e 100644 --- a/Help/manual/cmake-qt.7.rst +++ b/Help/manual/cmake-qt.7.rst @@ -3,7 +3,7 @@ cmake-qt(7) *********** -.. only:: html or latex +.. only:: html .. contents:: diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst index 1621b5f..afc8ba2 100644 --- a/Help/manual/cmake-toolchains.7.rst +++ b/Help/manual/cmake-toolchains.7.rst @@ -3,7 +3,7 @@ cmake-toolchains(7) ******************* -.. only:: html or latex +.. only:: html .. contents:: @@ -115,8 +115,9 @@ as: set(CMAKE_SYSROOT /home/devel/rasp-pi-rootfs) set(CMAKE_STAGING_PREFIX /home/devel/stage) - set(CMAKE_C_COMPILER /home/devel/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-gcc) - set(CMAKE_CXX_COMPILER /home/devel/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++) + set(tools /home/devel/gcc-4.7-linaro-rpi-gnueabihf) + set(CMAKE_C_COMPILER ${tools}/bin/arm-linux-gnueabihf-gcc) + set(CMAKE_CXX_COMPILER ${tools}/bin/arm-linux-gnueabihf-g++) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 864ea6e..99088e0 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -3,7 +3,7 @@ cmake-variables(7) ****************** -.. only:: html or latex +.. only:: html .. contents:: @@ -260,6 +260,7 @@ Variables that Control the Build /variable/CMAKE_USE_RELATIVE_PATHS /variable/CMAKE_VISIBILITY_INLINES_HIDDEN /variable/CMAKE_WIN32_EXECUTABLE + /variable/CMAKE_XCODE_ATTRIBUTE_an-attribute /variable/EXECUTABLE_OUTPUT_PATH /variable/LIBRARY_OUTPUT_PATH diff --git a/Help/prop_dir/COMPILE_OPTIONS.rst b/Help/prop_dir/COMPILE_OPTIONS.rst index 5953059..5530860 100644 --- a/Help/prop_dir/COMPILE_OPTIONS.rst +++ b/Help/prop_dir/COMPILE_OPTIONS.rst @@ -6,9 +6,9 @@ List of options to pass to the compiler. This property specifies the list of options given so far to the :command:`add_compile_options` command. -This property is used to populate the :prop_tgt:`COMPILE_OPTIONS` target -property, which is used by the generators to set the options for the -compiler. +This property is used to initialize the :prop_tgt:`COMPILE_OPTIONS` target +property when a target is created, which is used by the generators to set +the options for the compiler. Contents of ``COMPILE_OPTIONS`` may use "generator expressions" with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual diff --git a/Help/prop_inst/CPACK_WIX_ACL.rst b/Help/prop_inst/CPACK_WIX_ACL.rst index ee42666..4e13ec4 100644 --- a/Help/prop_inst/CPACK_WIX_ACL.rst +++ b/Help/prop_inst/CPACK_WIX_ACL.rst @@ -14,5 +14,6 @@ each of which has to match the following format. ``<user>`` and ``<domain>`` specify the windows user and domain for which the ``<Permission>`` element should be generated. -``<permission>`` is any of the YesNoType attributes listed here: -http://wixtoolset.org/documentation/manual/v3/xsd/wix/permission.html +``<permission>`` is any of the YesNoType attributes listed here:: + + http://wixtoolset.org/documentation/manual/v3/xsd/wix/permission.html diff --git a/Help/prop_sf/AUTOUIC_OPTIONS.rst b/Help/prop_sf/AUTOUIC_OPTIONS.rst index 6dfabb0..bb48da9 100644 --- a/Help/prop_sf/AUTOUIC_OPTIONS.rst +++ b/Help/prop_sf/AUTOUIC_OPTIONS.rst @@ -6,7 +6,7 @@ Additional options for ``uic`` when using :prop_tgt:`AUTOUIC` This property holds additional command line options which will be used when ``uic`` is executed during the build via :prop_tgt:`AUTOUIC`, i.e. it is equivalent to the optional ``OPTIONS`` argument of the -:module:`qt4_wrap_ui()<FindQt4>` macro. +:module:`qt4_wrap_ui() <FindQt4>` macro. By default it is empty. diff --git a/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst b/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst index 0be313c..de98c37 100644 --- a/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst +++ b/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst @@ -5,3 +5,6 @@ Set Xcode target attributes directly. Tell the Xcode generator to set '<an-attribute>' to a given value in the generated Xcode project. Ignored on other generators. + +See the :variable:`CMAKE_XCODE_ATTRIBUTE_<an-attribute>` variable +to set attributes on all targets in a directory tree. diff --git a/Help/release/3.1.0.rst b/Help/release/3.1.0.rst index 652bcd3..101c29d 100644 --- a/Help/release/3.1.0.rst +++ b/Help/release/3.1.0.rst @@ -18,7 +18,7 @@ New Features Generators ---------- -* A :generator:`Visual Studio 14` generator was added. +* The :generator:`Visual Studio 14 2015` generator was added. Windows Phone and Windows Store ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -238,10 +238,6 @@ Modules * The :module:`FindPkgConfig` module learned to use the ``PKG_CONFIG`` environment variable value as the ``pkg-config`` executable, if set. -* The :module:`FindVTK` module dropped support for finding VTK 4.0. - It is now a thin-wrapper around ``find_package(VTK ... NO_MODULE)``. - This produces much clearer error messages when VTK is not found. - * The :module:`FindZLIB` module now provides imported targets. * The :module:`GenerateExportHeader` module ``generate_export_header`` @@ -356,6 +352,17 @@ Deprecated and Removed Features it is deprecated and should not longer be used. Use the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable instead. +* The :module:`FindITK` module has been removed altogether. + It was a thin-wrapper around ``find_package(ITK ... NO_MODULE)``. + This produces much clearer error messages when ITK is not found. + +* The :module:`FindVTK` module has been removed altogether. + It was a thin-wrapper around ``find_package(VTK ... NO_MODULE)``. + This produces much clearer error messages when VTK is not found. + + The module also provided compatibility support for finding VTK 4.0. + This capability has been dropped. + Other Changes ============= @@ -379,3 +386,7 @@ Other Changes the Open Watcom external version numbering. The external version numbers are lower than the internal version number by 11. + +* The ``cmake-mode.el`` major Emacs editing mode no longer + treats ``_`` as part of words, making it more consistent + with other major modes. diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst deleted file mode 100644 index e4cc01e..0000000 --- a/Help/release/dev/0-sample-topic.rst +++ /dev/null @@ -1,7 +0,0 @@ -0-sample-topic --------------- - -* This is a sample release note for the change in a topic. - Developers should add similar notes for each topic branch - making a noteworthy change. Each document should be named - and titled to match the topic name to avoid merge conflicts. diff --git a/Help/release/index.rst b/Help/release/index.rst index abc19b8..616a582 100644 --- a/Help/release/index.rst +++ b/Help/release/index.rst @@ -5,8 +5,6 @@ CMake Release Notes This file should include the adjacent "dev.txt" file in development versions but not in release versions. -.. include:: dev.txt - Releases ======== diff --git a/Help/variable/CMAKE_INSTALL_PREFIX.rst b/Help/variable/CMAKE_INSTALL_PREFIX.rst index 72c8d41..ee9b615 100644 --- a/Help/variable/CMAKE_INSTALL_PREFIX.rst +++ b/Help/variable/CMAKE_INSTALL_PREFIX.rst @@ -27,3 +27,8 @@ which cannot be prepended with some other prefix. The installation prefix is also added to CMAKE_SYSTEM_PREFIX_PATH so that find_package, find_program, find_library, find_path, and find_file will search the prefix for other software. + +.. note:: + + Use the :module:`GNUInstallDirs` module to provide GNU-style + options for the layout of directories within the installation. diff --git a/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst b/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst new file mode 100644 index 0000000..096f64e --- /dev/null +++ b/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst @@ -0,0 +1,10 @@ +CMAKE_XCODE_ATTRIBUTE_<an-attribute> +------------------------------------ + +Set Xcode target attributes directly. + +Tell the Xcode generator to set '<an-attribute>' to a given value in +the generated Xcode project. Ignored on other generators. + +See the :prop_tgt:`XCODE_ATTRIBUTE_<an-attribute>` target property +to set attributes on a specific target. diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index 445c719..fee0a7c 100644 --- a/Modules/BundleUtilities.cmake +++ b/Modules/BundleUtilities.cmake @@ -655,8 +655,12 @@ function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_ite if(EXISTS "${resolved_resources}") #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy_directory '${resolved_resources}' '${resolved_embedded_resources}'") execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${resolved_resources}" "${resolved_embedded_resources}") - else() - # Otherwise try at least copy Contents/Info.plist to Resources/Info.plist, if it exists: + endif() + + # Some frameworks e.g. Qt put Info.plist in wrong place, so when it is + # missing in resources, copy it from other well known incorrect locations: + if(NOT EXISTS "${resolved_resources}/Info.plist") + # Check for Contents/Info.plist in framework root (older Qt SDK): string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1/Contents/Info.plist" resolved_info_plist "${resolved_item}") string(REGEX REPLACE "^(.*)/[^/]+$" "\\1/Resources/Info.plist" resolved_embedded_info_plist "${resolved_embedded_item}") if(EXISTS "${resolved_info_plist}") @@ -674,6 +678,16 @@ function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_ite if(NOT EXISTS "${resolved_embedded_versions}/Current") execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${resolved_embedded_version}" "${resolved_embedded_versions}/Current") endif() + # Restore symlinks in framework root pointing to current framework + # binary and resources: + string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1" resolved_embedded_root "${resolved_embedded_item}") + string(REGEX REPLACE "^.*/([^/]+)$" "\\1" resolved_embedded_item_basename "${resolved_embedded_item}") + if(NOT EXISTS "${resolved_embedded_root}/${resolved_embedded_item_basename}") + execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "Versions/Current/${resolved_embedded_item_basename}" "${resolved_embedded_root}/${resolved_embedded_item_basename}") + endif() + if(NOT EXISTS "${resolved_embedded_root}/Resources") + execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "Versions/Current/Resources" "${resolved_embedded_root}/Resources") + endif() endif() endif() if(UNIX AND NOT APPLE) diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index a7b5760..6c6a914 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -261,11 +261,20 @@ Id flags: ${testflags} else() set(id_deployment_target "") endif() + set(id_product_type "com.apple.product-type.tool") if(CMAKE_OSX_SYSROOT) set(id_sdkroot "SDKROOT = \"${CMAKE_OSX_SYSROOT}\";") + if(CMAKE_OSX_SYSROOT MATCHES "(^|/)[Ii][Pp][Hh][Oo][Nn][Ee]") + set(id_product_type "com.apple.product-type.bundle.unit-test") + endif() else() set(id_sdkroot "") endif() + if(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY) + set(id_code_sign_identity "CODE_SIGN_IDENTITY = \"${CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY}\";") + else() + set(id_code_sign_identity "") + endif() if(NOT ${XCODE_VERSION} VERSION_LESS 3) set(v 3) set(ext xcodeproj) @@ -298,7 +307,7 @@ Id flags: ${testflags} # ... # /path/to/cc ...CompilerId${lang}/... # to extract the compiler front-end for the language. - if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "\nLd[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerId${lang}/(\\./)?CompilerId${lang}[ \t\n\\\"]") + if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "\nLd[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerId${lang}/(\\./)?(CompilerId${lang}.xctest/)?CompilerId${lang}[ \t\n\\\"]") set(_comp "${CMAKE_MATCH_2}") if(EXISTS "${_comp}") set(CMAKE_${lang}_COMPILER_ID_TOOL "${_comp}" PARENT_SCOPE) @@ -366,7 +375,13 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT} # binary dir. file(GLOB files RELATIVE ${CMAKE_${lang}_COMPILER_ID_DIR} - ${CMAKE_${lang}_COMPILER_ID_DIR}/*) + + # normal case + ${CMAKE_${lang}_COMPILER_ID_DIR}/* + + # com.apple.package-type.bundle.unit-test + ${CMAKE_${lang}_COMPILER_ID_DIR}/*.xctest/* + ) list(REMOVE_ITEM files "${src}") set(COMPILER_${lang}_PRODUCED_FILES "") foreach(file ${files}) diff --git a/Modules/CMakeExpandImportedTargets.cmake b/Modules/CMakeExpandImportedTargets.cmake index b6ab7ef..8ac3364 100644 --- a/Modules/CMakeExpandImportedTargets.cmake +++ b/Modules/CMakeExpandImportedTargets.cmake @@ -20,8 +20,9 @@ # # :: # -# cmake_expand_imported_targets(expandedLibs LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} -# CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" ) +# cmake_expand_imported_targets(expandedLibs +# LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} +# CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" ) #============================================================================= diff --git a/Modules/CMakeFindPackageMode.cmake b/Modules/CMakeFindPackageMode.cmake index 9f97ee5..fc3058d 100644 --- a/Modules/CMakeFindPackageMode.cmake +++ b/Modules/CMakeFindPackageMode.cmake @@ -7,15 +7,24 @@ # This file is executed by cmake when invoked with --find-package. It # expects that the following variables are set using -D: # -# :: -# -# NAME = name of the package -# COMPILER_ID = the CMake compiler ID for which the result is, i.e. GNU/Intel/Clang/MSVC, etc. -# LANGUAGE = language for which the result will be used, i.e. C/CXX/Fortan/ASM -# MODE = EXIST : only check for existence of the given package -# COMPILE : print the flags needed for compiling an object file which uses the given package -# LINK : print the flags needed for linking when using the given package -# QUIET = if TRUE, don't print anything +# ``NAME`` +# name of the package +# ``COMPILER_ID`` +# the CMake compiler ID for which the result is, +# i.e. GNU/Intel/Clang/MSVC, etc. +# ``LANGUAGE`` +# language for which the result will be used, +# i.e. C/CXX/Fortan/ASM +# ``MODE`` +# ``EXIST`` +# only check for existence of the given package +# ``COMPILE`` +# print the flags needed for compiling an object file which uses +# the given package +# ``LINK`` +# print the flags needed for linking when using the given package +# ``QUIET`` +# if TRUE, don't print anything #============================================================================= # Copyright 2006-2011 Alexander Neundorf, <neundorf@kde.org> diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake index c6dc141..206ea7a 100644 --- a/Modules/CMakePackageConfigHelpers.cmake +++ b/Modules/CMakePackageConfigHelpers.cmake @@ -15,12 +15,13 @@ # # Create a config file for a project:: # -# configure_package_config_file(<input> <output> INSTALL_DESTINATION <path> -# [PATH_VARS <var1> <var2> ... <varN>] -# [NO_SET_AND_CHECK_MACRO] -# [NO_CHECK_REQUIRED_COMPONENTS_MACRO] -# [INSTALL_PREFIX <path>]) -# +# configure_package_config_file(<input> <output> +# INSTALL_DESTINATION <path> +# [PATH_VARS <var1> <var2> ... <varN>] +# [NO_SET_AND_CHECK_MACRO] +# [NO_CHECK_REQUIRED_COMPONENTS_MACRO] +# [INSTALL_PREFIX <path>] +# ) # # ``configure_package_config_file()`` should be used instead of the plain # :command:`configure_file()` command when creating the ``<Name>Config.cmake`` @@ -51,13 +52,13 @@ # Using ``configure_package_config_file`` helps. If used correctly, it makes # the resulting ``FooConfig.cmake`` file relocatable. Usage: # -# 1. write a ``FooConfig.cmake.in`` file as you are used to -# 2. insert a line containing only the string ``@PACKAGE_INIT@`` -# 3. instead of ``set(FOO_DIR "@SOME_INSTALL_DIR@")``, use -# ``set(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")`` (this must be after the -# ``@PACKAGE_INIT@`` line) -# 4. instead of using the normal :command:`configure_file()`, use -# ``configure_package_config_file()`` +# 1. write a ``FooConfig.cmake.in`` file as you are used to +# 2. insert a line containing only the string ``@PACKAGE_INIT@`` +# 3. instead of ``set(FOO_DIR "@SOME_INSTALL_DIR@")``, use +# ``set(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")`` (this must be after the +# ``@PACKAGE_INIT@`` line) +# 4. instead of using the normal :command:`configure_file()`, use +# ``configure_package_config_file()`` # # # @@ -116,9 +117,9 @@ # # Create a version file for a project:: # -# write_basic_package_version_file(<filename> -# [VERSION <major.minor.patch>] -# COMPATIBILITY <AnyNewerVersion|SameMajorVersion|ExactVersion> ) +# write_basic_package_version_file(<filename> +# [VERSION <major.minor.patch>] +# COMPATIBILITY <AnyNewerVersion|SameMajorVersion|ExactVersion> ) # # # Writes a file for use as ``<package>ConfigVersion.cmake`` file to @@ -172,13 +173,16 @@ # set(SYSCONFIG_INSTALL_DIR etc/foo/ ... CACHE ) # ... # include(CMakePackageConfigHelpers) -# configure_package_config_file(FooConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake -# INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake -# PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR) -# write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake -# VERSION 1.2.3 -# COMPATIBILITY SameMajorVersion ) -# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake +# configure_package_config_file(FooConfig.cmake.in +# ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake +# INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake +# PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR) +# write_basic_package_version_file( +# ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake +# VERSION 1.2.3 +# COMPATIBILITY SameMajorVersion ) +# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake +# ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake # DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake ) # # ``FooConfig.cmake.in``: diff --git a/Modules/CMakeParseArguments.cmake b/Modules/CMakeParseArguments.cmake index 4248176..8553f38 100644 --- a/Modules/CMakeParseArguments.cmake +++ b/Modules/CMakeParseArguments.cmake @@ -45,7 +45,8 @@ # set(options OPTIONAL FAST) # set(oneValueArgs DESTINATION RENAME) # set(multiValueArgs TARGETS CONFIGURATIONS) -# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) +# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" +# "${multiValueArgs}" ${ARGN} ) # ... # # diff --git a/Modules/CMakePrintHelpers.cmake b/Modules/CMakePrintHelpers.cmake index ad3b0d5..474fa41 100644 --- a/Modules/CMakePrintHelpers.cmake +++ b/Modules/CMakePrintHelpers.cmake @@ -15,11 +15,10 @@ # # This macro prints the values of the properties of the given targets, # source files, directories, tests or cache entries. Exactly one of the -# scope keywords must be used. Example: +# scope keywords must be used. Example:: # -# :: -# -# cmake_print_properties(TARGETS foo bar PROPERTIES LOCATION INTERFACE_INCLUDE_DIRS) +# cmake_print_properties(TARGETS foo bar PROPERTIES +# LOCATION INTERFACE_INCLUDE_DIRS) # # This will print the LOCATION and INTERFACE_INCLUDE_DIRS properties for # both targets foo and bar. @@ -29,17 +28,13 @@ # CMAKE_PRINT_VARIABLES(var1 var2 .. varN) # # This macro will print the name of each variable followed by its value. -# Example: -# -# :: -# -# cmake_print_variables(CMAKE_C_COMPILER CMAKE_MAJOR_VERSION THIS_ONE_DOES_NOT_EXIST) +# Example:: # -# Gives: +# cmake_print_variables(CMAKE_C_COMPILER CMAKE_MAJOR_VERSION DOES_NOT_EXIST) # -# :: +# Gives:: # -# -- CMAKE_C_COMPILER="/usr/bin/gcc" ; CMAKE_MAJOR_VERSION="2" ; THIS_ONE_DOES_NOT_EXIST="" +# -- CMAKE_C_COMPILER="/usr/bin/gcc" ; CMAKE_MAJOR_VERSION="2" ; DOES_NOT_EXIST="" #============================================================================= # Copyright 2013 Alexander Neundorf, <neundorf@kde.org> diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake index 4b8dc1e..6f2eeb3 100644 --- a/Modules/CPackIFW.cmake +++ b/Modules/CPackIFW.cmake @@ -96,7 +96,7 @@ # # If this is ``ON`` all components will be downloaded. # By default is ``OFF`` or used value -# from :variable:`CPACK_DOWNLOAD_ALL` if set +# from ``CPACK_DOWNLOAD_ALL`` if set # # Components # """""""""" diff --git a/Modules/CPackNSIS.cmake b/Modules/CPackNSIS.cmake index 9d23ec0..4b2e0eb 100644 --- a/Modules/CPackNSIS.cmake +++ b/Modules/CPackNSIS.cmake @@ -114,8 +114,8 @@ # installation prefix. Like:: # # set(CPACK_NSIS_MENU_LINKS -# "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help" -# "http://www.cmake.org" "CMake Web Site") +# "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" +# "CMake Help" "http://www.cmake.org" "CMake Web Site") # #============================================================================= diff --git a/Modules/CheckStructHasMember.cmake b/Modules/CheckStructHasMember.cmake index 880a688..c8949cf 100644 --- a/Modules/CheckStructHasMember.cmake +++ b/Modules/CheckStructHasMember.cmake @@ -70,7 +70,7 @@ ${_INCLUDE_FILES} int main() { ${_STRUCT}* tmp; - tmp->${_MEMBER}; + (void) tmp->${_MEMBER}; return 0; } ") diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake index 44070b8..98fcd0b 100644 --- a/Modules/Compiler/AppleClang-C.cmake +++ b/Modules/Compiler/AppleClang-C.cmake @@ -1 +1,2 @@ -include(Compiler/Clang-C) +include(Compiler/Clang) +__compiler_clang(C) diff --git a/Modules/CompilerId/Xcode-3.pbxproj.in b/Modules/CompilerId/Xcode-3.pbxproj.in index eabfc6b..aebae27 100644 --- a/Modules/CompilerId/Xcode-3.pbxproj.in +++ b/Modules/CompilerId/Xcode-3.pbxproj.in @@ -29,7 +29,7 @@ ); name = CompilerId@id_lang@; productName = CompilerId@id_lang@; - productType = "com.apple.product-type.tool"; + productType = "@id_product_type@"; }; 08FB7793FE84155DC02AAC07 = { isa = PBXProject; @@ -81,6 +81,7 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; ONLY_ACTIVE_ARCH = YES; + @id_code_sign_identity@ CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)"; SYMROOT = .; @id_toolset@ diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake index 9b31567..b1a2370 100644 --- a/Modules/DeployQt4.cmake +++ b/Modules/DeployQt4.cmake @@ -37,7 +37,8 @@ # # :: # -# FIXUP_QT4_EXECUTABLE(<executable> [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf>]) +# FIXUP_QT4_EXECUTABLE(<executable> +# [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf>]) # # Copies Qt plugins, writes a Qt configuration file (if needed) and # fixes up a Qt4 executable using BundleUtilities so it is standalone @@ -63,7 +64,8 @@ # # :: # -# INSTALL_QT4_PLUGIN_PATH(plugin executable copy installed_plugin_path_var <plugins_dir> <component> <configurations>) +# INSTALL_QT4_PLUGIN_PATH(plugin executable copy installed_plugin_path_var +# <plugins_dir> <component> <configurations>) # # Install (or copy) a resolved <plugin> to the default plugins directory # (or <plugins_dir>) relative to <executable> and store the result in @@ -77,7 +79,8 @@ # # :: # -# INSTALL_QT4_PLUGIN(plugin executable copy installed_plugin_path_var <plugins_dir> <component>) +# INSTALL_QT4_PLUGIN(plugin executable copy installed_plugin_path_var +# <plugins_dir> <component>) # # Install (or copy) an unresolved <plugin> to the default plugins # directory (or <plugins_dir>) relative to <executable> and store the @@ -86,7 +89,8 @@ # # :: # -# INSTALL_QT4_EXECUTABLE(<executable> [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf> <component>]) +# INSTALL_QT4_EXECUTABLE(<executable> +# [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf> <component>]) # # Installs Qt plugins, writes a Qt configuration file (if needed) and # fixes up a Qt4 executable using BundleUtilities so it is standalone diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index d6a6b72..8832950 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -52,7 +52,7 @@ # [CMAKE_GENERATOR_PLATFORM p] # Generator-specific platform name # [CMAKE_GENERATOR_TOOLSET t] # Generator-specific toolset name # [CMAKE_ARGS args...] # Arguments to CMake command line -# [CMAKE_CACHE_ARGS args...] # Initial cache arguments, of the form -Dvar:string=on +# [CMAKE_CACHE_ARGS args...] # Initial cache args with form -Dvar:string=on # #--Build step----------------- # [BINARY_DIR dir] # Specify build dir location # [BUILD_COMMAND cmd...] # Command to drive the native build @@ -628,6 +628,19 @@ function(_ep_write_downloadfile_script script_filename remote local timeout no_p set(show_progress "SHOW_PROGRESS") endif() + if("${hash}" MATCHES "${_ep_hash_regex}") + string(CONCAT hash_check + "if(EXISTS \"${local}\")\n" + " file(\"${CMAKE_MATCH_1}\" \"${local}\" hash_value)\n" + " if(\"x\${hash_value}\" STREQUAL \"x${CMAKE_MATCH_2}\")\n" + " return()\n" + " endif()\n" + "endif()\n" + ) + else() + set(hash_check "") + endif() + # check for curl globals in the project if(DEFINED CMAKE_TLS_VERIFY) set(tls_verify "set(CMAKE_TLS_VERIFY ${CMAKE_TLS_VERIFY})") @@ -651,7 +664,7 @@ function(_ep_write_downloadfile_script script_filename remote local timeout no_p endif() file(WRITE ${script_filename} -"message(STATUS \"downloading... +"${hash_check}message(STATUS \"downloading... src='${remote}' dst='${local}' timeout='${timeout_msg}'\") diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake index 12ea384..9016db8 100644 --- a/Modules/FeatureSummary.cmake +++ b/Modules/FeatureSummary.cmake @@ -17,7 +17,7 @@ # :: # # -- The following OPTIONAL packages have been found: -# LibXml2 (required version >= 2.4) , XML processing library. , <http://xmlsoft.org> +# LibXml2 (required version >= 2.4), XML processing lib, <http://xmlsoft.org> # * Enables HTML-import in MyWordProcessor # * Enables odt-export in MyWordProcessor # PNG , A PNG image library. , <http://www.libpng.org/pub/png/> @@ -55,21 +55,32 @@ # The WHAT option is the only mandatory option. Here you specify what # information will be printed: # -# :: -# -# ALL: print everything -# ENABLED_FEATURES: the list of all features which are enabled -# DISABLED_FEATURES: the list of all features which are disabled -# PACKAGES_FOUND: the list of all packages which have been found -# PACKAGES_NOT_FOUND: the list of all packages which have not been found -# OPTIONAL_PACKAGES_FOUND: only those packages which have been found which have the type OPTIONAL -# OPTIONAL_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type OPTIONAL -# RECOMMENDED_PACKAGES_FOUND: only those packages which have been found which have the type RECOMMENDED -# RECOMMENDED_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type RECOMMENDED -# REQUIRED_PACKAGES_FOUND: only those packages which have been found which have the type REQUIRED -# REQUIRED_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type REQUIRED -# RUNTIME_PACKAGES_FOUND: only those packages which have been found which have the type RUNTIME -# RUNTIME_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type RUNTIME +# ``ALL`` +# print everything +# ``ENABLED_FEATURES`` +# the list of all features which are enabled +# ``DISABLED_FEATURES`` +# the list of all features which are disabled +# ``PACKAGES_FOUND`` +# the list of all packages which have been found +# ``PACKAGES_NOT_FOUND`` +# the list of all packages which have not been found +# ``OPTIONAL_PACKAGES_FOUND`` +# only those packages which have been found which have the type OPTIONAL +# ``OPTIONAL_PACKAGES_NOT_FOUND`` +# only those packages which have not been found which have the type OPTIONAL +# ``RECOMMENDED_PACKAGES_FOUND`` +# only those packages which have been found which have the type RECOMMENDED +# ``RECOMMENDED_PACKAGES_NOT_FOUND`` +# only those packages which have not been found which have the type RECOMMENDED +# ``REQUIRED_PACKAGES_FOUND`` +# only those packages which have been found which have the type REQUIRED +# ``REQUIRED_PACKAGES_NOT_FOUND`` +# only those packages which have not been found which have the type REQUIRED +# ``RUNTIME_PACKAGES_FOUND`` +# only those packages which have been found which have the type RUNTIME +# ``RUNTIME_PACKAGES_NOT_FOUND`` +# only those packages which have not been found which have the type RUNTIME # # With the exception of the ``ALL`` value, these values can be combined # in order to customize the output. For example: @@ -118,10 +129,11 @@ # # :: # -# SET_PACKAGE_PROPERTIES(<name> PROPERTIES [ URL <url> ] -# [ DESCRIPTION <description> ] -# [ TYPE (RUNTIME|OPTIONAL|RECOMMENDED|REQUIRED) ] -# [ PURPOSE <purpose> ] +# SET_PACKAGE_PROPERTIES(<name> PROPERTIES +# [ URL <url> ] +# [ DESCRIPTION <description> ] +# [ TYPE (RUNTIME|OPTIONAL|RECOMMENDED|REQUIRED) ] +# [ PURPOSE <purpose> ] # ) # # @@ -171,26 +183,30 @@ # :: # # find_package(LibXml2) -# set_package_properties(LibXml2 PROPERTIES DESCRIPTION "A XML processing library." -# URL "http://xmlsoft.org/") +# set_package_properties(LibXml2 PROPERTIES +# DESCRIPTION "A XML processing library." +# URL "http://xmlsoft.org/") # # # # :: # -# set_package_properties(LibXml2 PROPERTIES TYPE RECOMMENDED -# PURPOSE "Enables HTML-import in MyWordProcessor") +# set_package_properties(LibXml2 PROPERTIES +# TYPE RECOMMENDED +# PURPOSE "Enables HTML-import in MyWordProcessor") # ... -# set_package_properties(LibXml2 PROPERTIES TYPE OPTIONAL -# PURPOSE "Enables odt-export in MyWordProcessor") +# set_package_properties(LibXml2 PROPERTIES +# TYPE OPTIONAL +# PURPOSE "Enables odt-export in MyWordProcessor") # # # # :: # # find_package(DBUS) -# set_package_properties(DBUS PROPERTIES TYPE RUNTIME -# PURPOSE "Necessary to disable the screensaver during a presentation" ) +# set_package_properties(DBUS PROPERTIES +# TYPE RUNTIME +# PURPOSE "Necessary to disable the screensaver during a presentation" ) # # # diff --git a/Modules/FindBacktrace.cmake b/Modules/FindBacktrace.cmake index 07109b0..cb4f60a 100644 --- a/Modules/FindBacktrace.cmake +++ b/Modules/FindBacktrace.cmake @@ -5,18 +5,24 @@ # Find provider for backtrace(3). # # Checks if OS supports backtrace(3) via either libc or custom library. -# This module defines the following variables:: +# This module defines the following variables: # -# Backtrace_HEADER - The header file needed for backtrace(3). Cached. -# Could be forcibly set by user. -# Backtrace_INCLUDE_DIRS - The include directories needed to use backtrace(3) header. -# Backtrace_LIBRARIES - The libraries (linker flags) needed to use backtrace(3), if any. -# Backtrace_FOUND - Is set if and only if backtrace(3) support detected. +# ``Backtrace_HEADER`` +# The header file needed for backtrace(3). Cached. +# Could be forcibly set by user. +# ``Backtrace_INCLUDE_DIRS`` +# The include directories needed to use backtrace(3) header. +# ``Backtrace_LIBRARIES`` +# The libraries (linker flags) needed to use backtrace(3), if any. +# ``Backtrace_FOUND`` +# Is set if and only if backtrace(3) support detected. # -# The following cache variables are also available to set or use:: +# The following cache variables are also available to set or use: # -# Backtrace_LIBRARY - The external library providing backtrace, if any. -# Backtrace_INCLUDE_DIR - The directory holding the backtrace(3) header. +# ``Backtrace_LIBRARY`` +# The external library providing backtrace, if any. +# ``Backtrace_INCLUDE_DIR`` +# The directory holding the backtrace(3) header. # # Typical usage is to generate of header file using configure_file() with the # contents like the following:: diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 2e2b21c..29bb875 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -278,13 +278,13 @@ # Only available for CUDA version 3.2+. # CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library. # Only available for CUDA version 3.2+. -# CUDA_npp_LIBRARY -- NVIDIA Performance Primitives library. +# CUDA_npp_LIBRARY -- NVIDIA Performance Primitives lib. # Only available for CUDA version 4.0+. -# CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives library (core). +# CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core). # Only available for CUDA version 5.5+. -# CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives library (image processing). +# CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing). # Only available for CUDA version 5.5+. -# CUDA_npps_LIBRARY -- NVIDIA Performance Primitives library (signal processing). +# CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processing). # Only available for CUDA version 5.5+. # CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library. # Only available for CUDA version 3.2+. @@ -703,18 +703,6 @@ if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) else() set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY}) endif() -if(APPLE) - # We need to add the path to cudart to the linker using rpath, since the - # library name for the cuda libraries is prepended with @rpath. - if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) - get_filename_component(_cuda_path_to_cudart "${CUDA_CUDARTEMU_LIBRARY}" PATH) - else() - get_filename_component(_cuda_path_to_cudart "${CUDA_CUDART_LIBRARY}" PATH) - endif() - if(_cuda_path_to_cudart) - list(APPEND CUDA_LIBRARIES -Wl,-rpath "-Wl,${_cuda_path_to_cudart}") - endif() -endif() # 1.1 toolkit on linux doesn't appear to have a separate library on # some platforms. diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake index 0184c39..a21ca89 100644 --- a/Modules/FindCurses.cmake +++ b/Modules/FindCurses.cmake @@ -50,6 +50,8 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake) + find_library(CURSES_CURSES_LIBRARY NAMES curses ) find_library(CURSES_NCURSES_LIBRARY NAMES ncurses ) @@ -81,7 +83,6 @@ endif() # prefix as the library was found, if still not found, try curses.h with the # default search paths. if(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES) - include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake) include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake) cmake_push_check_state() set(CMAKE_REQUIRED_QUIET ${Curses_FIND_QUIETLY}) diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake index 16478cb..f972ad0 100644 --- a/Modules/FindGettext.cmake +++ b/Modules/FindGettext.cmake @@ -17,6 +17,7 @@ # # # Additionally it provides the following macros: +# # GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN ) # # :: @@ -32,8 +33,9 @@ # :: # # Process the given pot file to mo files. -# If INSTALL_DESTINATION is given then automatically install rules will be created, -# the language subdirectory will be taken into account (by default use share/locale/). +# If INSTALL_DESTINATION is given then automatically install rules will +# be created, the language subdirectory will be taken into account +# (by default use share/locale/). # If ALL is specified, the pot file is processed when building the all traget. # It creates a custom target "potfile". # @@ -43,8 +45,9 @@ # :: # # Process the given po files to mo files for the given language. -# If INSTALL_DESTINATION is given then automatically install rules will be created, -# the language subdirectory will be taken into account (by default use share/locale/). +# If INSTALL_DESTINATION is given then automatically install rules will +# be created, the language subdirectory will be taken into account +# (by default use share/locale/). # If ALL is specified, the po files are processed when building the all traget. # It creates a custom target "pofiles". diff --git a/Modules/FindHg.cmake b/Modules/FindHg.cmake index c418afd..34d763e 100644 --- a/Modules/FindHg.cmake +++ b/Modules/FindHg.cmake @@ -66,7 +66,11 @@ if(HG_EXECUTABLE) execute_process(COMMAND ${HG_EXECUTABLE} --version OUTPUT_VARIABLE hg_version ERROR_QUIET + RESULT_VARIABLE hg_result OUTPUT_STRIP_TRAILING_WHITESPACE) + if(hg_result MATCHES "is not a valid Win32 application") + set_property(CACHE HG_EXECUTABLE PROPERTY VALUE "HG_EXECUTABLE-NOTFOUND") + endif() if(hg_version MATCHES "^Mercurial Distributed SCM \\(version ([0-9][^)]*)\\)") set(HG_VERSION_STRING "${CMAKE_MATCH_1}") endif() diff --git a/Modules/FindIce.cmake b/Modules/FindIce.cmake index 55528b8..76cecc1 100644 --- a/Modules/FindIce.cmake +++ b/Modules/FindIce.cmake @@ -43,7 +43,7 @@ # # Ice_HOME - the root of the Ice installation # -# The environment variable :envvar:`ICE_HOME` may also be used; the +# The environment variable ``ICE_HOME`` may also be used; the # Ice_HOME variable takes precedence. # # The following cache variables may also be set:: diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake index 0bd7eb0..bb73853 100644 --- a/Modules/FindJava.cmake +++ b/Modules/FindJava.cmake @@ -17,7 +17,7 @@ # Java_JAVAH_EXECUTABLE = the full path to the Java header generator # Java_JAVADOC_EXECUTABLE = the full path to the Java documention generator # Java_JAR_EXECUTABLE = the full path to the Java archiver -# Java_VERSION_STRING = Version of the package found (java version), eg. 1.6.0_12 +# Java_VERSION_STRING = Version of java found, eg. 1.6.0_12 # Java_VERSION_MAJOR = The major version of the package found. # Java_VERSION_MINOR = The minor version of the package found. # Java_VERSION_PATCH = The patch version of the package found. @@ -115,7 +115,10 @@ if(Java_JAVA_EXECUTABLE) OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE) if( res ) - if(${Java_FIND_REQUIRED}) + if(var MATCHES "No Java runtime present, requesting install") + set_property(CACHE Java_JAVA_EXECUTABLE + PROPERTY VALUE "Java_JAVA_EXECUTABLE-NOTFOUND") + elseif(${Java_FIND_REQUIRED}) message( FATAL_ERROR "Error executing java -version" ) else() message( STATUS "Warning, could not run java -version") diff --git a/Modules/FindKDE3.cmake b/Modules/FindKDE3.cmake index ea898a6..dda4530 100644 --- a/Modules/FindKDE3.cmake +++ b/Modules/FindKDE3.cmake @@ -8,29 +8,29 @@ # # This module defines the following variables: # -# :: -# -# KDE3_DEFINITIONS - compiler definitions required for compiling KDE software -# KDE3_INCLUDE_DIR - the KDE include directory -# KDE3_INCLUDE_DIRS - the KDE and the Qt include directory, for use with include_directories() -# KDE3_LIB_DIR - the directory where the KDE libraries are installed, for use with link_directories() -# QT_AND_KDECORE_LIBS - this contains both the Qt and the kdecore library -# KDE3_DCOPIDL_EXECUTABLE - the dcopidl executable -# KDE3_DCOPIDL2CPP_EXECUTABLE - the dcopidl2cpp executable -# KDE3_KCFGC_EXECUTABLE - the kconfig_compiler executable -# KDE3_FOUND - set to TRUE if all of the above has been found -# -# +# ``KDE3_DEFINITIONS`` +# compiler definitions required for compiling KDE software +# ``KDE3_INCLUDE_DIR`` +# the KDE include directory +# ``KDE3_INCLUDE_DIRS`` +# the KDE and the Qt include directory, for use with include_directories() +# ``KDE3_LIB_DIR`` +# the directory where the KDE libraries are installed, for use with link_directories() +# ``QT_AND_KDECORE_LIBS`` +# this contains both the Qt and the kdecore library +# ``KDE3_DCOPIDL_EXECUTABLE`` +# the dcopidl executable +# ``KDE3_DCOPIDL2CPP_EXECUTABLE`` +# the dcopidl2cpp executable +# ``KDE3_KCFGC_EXECUTABLE`` +# the kconfig_compiler executable +# ``KDE3_FOUND`` +# set to TRUE if all of the above has been found # # The following user adjustable options are provided: # -# :: -# -# KDE3_BUILD_TESTS - enable this to build KDE testcases -# -# -# -# +# ``KDE3_BUILD_TESTS`` +# enable this to build KDE testcases # # It also adds the following macros (from KDE3Macros.cmake) SRCS_VAR is # always the variable which contains the list of source files for your @@ -101,7 +101,8 @@ # # :: # -# Currently identical to add_executable(), may provide some advanced features in the future. +# Currently identical to add_executable(), may provide some advanced +# features in the future. # # # @@ -110,7 +111,8 @@ # :: # # Create a KDE plugin (KPart, kioslave, etc.) from the given source files. -# If WITH_PREFIX is given, the resulting plugin will have the prefix "lib", otherwise it won't. +# If WITH_PREFIX is given, the resulting plugin will have the prefix "lib", +# otherwise it won't. # It creates and installs an appropriate libtool la-file. # # @@ -120,7 +122,8 @@ # :: # # Create a KDE application in the form of a module loadable via kdeinit. -# A library named kdeinit_<name> will be created and a small executable which links to it. +# A library named kdeinit_<name> will be created and a small executable +# which links to it. # # # diff --git a/Modules/FindLibXslt.cmake b/Modules/FindLibXslt.cmake index bf2f821..2416341 100644 --- a/Modules/FindLibXslt.cmake +++ b/Modules/FindLibXslt.cmake @@ -17,10 +17,10 @@ # Additionally, the following two variables are set (but not required # for using xslt): # -# :: -# -# LIBXSLT_EXSLT_LIBRARIES - Link to these if you need to link against the exslt library -# LIBXSLT_XSLTPROC_EXECUTABLE - Contains the full path to the xsltproc executable if found +# ``LIBXSLT_EXSLT_LIBRARIES`` +# Link to these if you need to link against the exslt library. +# ``LIBXSLT_XSLTPROC_EXECUTABLE`` +# Contains the full path to the xsltproc executable if found. #============================================================================= # Copyright 2006-2009 Kitware, Inc. diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake index 68adff7..5a800e4 100644 --- a/Modules/FindOpenSceneGraph.cmake +++ b/Modules/FindOpenSceneGraph.cmake @@ -40,13 +40,14 @@ # OSG and it's various components. CMAKE_PREFIX_PATH can also be used # for this (see find_library() CMake documentation). # -# :: -# -# <MODULE>_DIR (where MODULE is of the form "OSGVOLUME" and there is a FindosgVolume.cmake file) -# OSG_DIR -# OSGDIR -# OSG_ROOT -# +# ``<MODULE>_DIR`` +# (where MODULE is of the form "OSGVOLUME" and there is a FindosgVolume.cmake file) +# ``OSG_DIR`` +# .. +# ``OSGDIR`` +# .. +# ``OSG_ROOT`` +# .. # # # [CMake 2.8.10]: The CMake variable OSG_DIR can now be used as well to diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake index fa04bf0..7cf3f22 100644 --- a/Modules/FindPNG.cmake +++ b/Modules/FindPNG.cmake @@ -10,19 +10,22 @@ # # It defines the following variables # -# :: -# -# PNG_INCLUDE_DIRS, where to find png.h, etc. -# PNG_LIBRARIES, the libraries to link against to use PNG. -# PNG_DEFINITIONS - You should add_definitons(${PNG_DEFINITIONS}) before compiling code that includes png library files. -# PNG_FOUND, If false, do not try to use PNG. -# PNG_VERSION_STRING - the version of the PNG library found (since CMake 2.8.8) +# ``PNG_INCLUDE_DIRS`` +# where to find png.h, etc. +# ``PNG_LIBRARIES`` +# the libraries to link against to use PNG. +# ``PNG_DEFINITIONS`` +# You should add_definitons(${PNG_DEFINITIONS}) before compiling code +# that includes png library files. +# ``PNG_FOUND`` +# If false, do not try to use PNG. +# ``PNG_VERSION_STRING`` +# the version of the PNG library found (since CMake 2.8.8) # # Also defined, but not for general use are # -# :: -# -# PNG_LIBRARY, where to find the PNG library. +# ``PNG_LIBRARY`` +# where to find the PNG library. # # For backward compatiblity the variable PNG_INCLUDE_DIR is also set. # It has the same value as PNG_INCLUDE_DIRS. diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index 23f3f05..6bcf1e7 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -20,7 +20,8 @@ # # :: # -# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> (DEFAULT_MSG|"Custom failure message") <var1>...<varN> ) +# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> +# (DEFAULT_MSG|"Custom failure message") <var1>...<varN> ) # # If the variables <var1> to <varN> are all valid, then # <UPPERCASED_NAME>_FOUND will be set to TRUE. If DEFAULT_MSG is given @@ -32,14 +33,13 @@ # # :: # -# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [FOUND_VAR <resultVar>] -# [REQUIRED_VARS <var1>...<varN>] -# [VERSION_VAR <versionvar>] -# [HANDLE_COMPONENTS] -# [CONFIG_MODE] -# [FAIL_MESSAGE "Custom failure message"] ) -# -# +# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME +# [FOUND_VAR <resultVar>] +# [REQUIRED_VARS <var1>...<varN>] +# [VERSION_VAR <versionvar>] +# [HANDLE_COMPONENTS] +# [CONFIG_MODE] +# [FAIL_MESSAGE "Custom failure message"] ) # # In this mode, the name of the result-variable can be set either to # either <UPPERCASED_NAME>_FOUND or <OriginalCase_Name>_FOUND using the @@ -75,7 +75,8 @@ # # :: # -# find_package_handle_standard_args(LibXml2 DEFAULT_MSG LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) +# find_package_handle_standard_args(LibXml2 DEFAULT_MSG +# LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) # # # @@ -90,9 +91,10 @@ # # :: # -# find_package_handle_standard_args(LibXslt FOUND_VAR LibXslt_FOUND -# REQUIRED_VARS LibXslt_LIBRARIES LibXslt_INCLUDE_DIRS -# VERSION_VAR LibXslt_VERSION_STRING) +# find_package_handle_standard_args(LibXslt +# FOUND_VAR LibXslt_FOUND +# REQUIRED_VARS LibXslt_LIBRARIES LibXslt_INCLUDE_DIRS +# VERSION_VAR LibXslt_VERSION_STRING) # # In this case, LibXslt is considered to be found if the variable(s) # listed after REQUIRED_VAR are all valid, i.e. LibXslt_LIBRARIES and diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index d728324..bf58ede 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -490,9 +490,10 @@ endmacro() pkg_check_modules (XRENDER REQUIRED xrender) - Defines e.g.: - ``XRENDER_LIBRARIES=Xrender;X11`` and - ``XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp`` + Defines for example:: + + XRENDER_LIBRARIES=Xrender;X11`` + XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp #]========================================] macro(pkg_check_modules _prefix _module0) # check cached value diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index 72ca6ed..f01bd41 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -2,127 +2,80 @@ # FindProtobuf # ------------ # -# -# # Locate and configure the Google Protocol Buffers library. # # The following variables can be set and are optional: # -# :: -# -# PROTOBUF_SRC_ROOT_FOLDER - When compiling with MSVC, if this cache variable is set -# the protobuf-default VS project build locations -# (vsprojects/Debug & vsprojects/Release) will be searched -# for libraries and binaries. -# -# -# -# :: -# -# PROTOBUF_IMPORT_DIRS - List of additional directories to be searched for -# imported .proto files. (New in CMake 2.8.8) -# -# +# ``PROTOBUF_SRC_ROOT_FOLDER`` +# When compiling with MSVC, if this cache variable is set +# the protobuf-default VS project build locations +# (vsprojects/Debug & vsprojects/Release) will be searched +# for libraries and binaries. +# ``PROTOBUF_IMPORT_DIRS`` +# List of additional directories to be searched for +# imported .proto files. # # Defines the following variables: # -# :: -# -# PROTOBUF_FOUND - Found the Google Protocol Buffers library (libprotobuf & header files) -# PROTOBUF_INCLUDE_DIRS - Include directories for Google Protocol Buffers -# PROTOBUF_LIBRARIES - The protobuf libraries -# -# [New in CMake 2.8.5] -# -# :: -# -# PROTOBUF_PROTOC_LIBRARIES - The protoc libraries -# PROTOBUF_LITE_LIBRARIES - The protobuf-lite libraries -# -# +# ``PROTOBUF_FOUND`` +# Found the Google Protocol Buffers library +# (libprotobuf & header files) +# ``PROTOBUF_INCLUDE_DIRS`` +# Include directories for Google Protocol Buffers +# ``PROTOBUF_LIBRARIES`` +# The protobuf libraries +# ``PROTOBUF_PROTOC_LIBRARIES`` +# The protoc libraries +# ``PROTOBUF_LITE_LIBRARIES`` +# The protobuf-lite libraries # # The following cache variables are also available to set or use: # -# :: -# -# PROTOBUF_LIBRARY - The protobuf library -# PROTOBUF_PROTOC_LIBRARY - The protoc library -# PROTOBUF_INCLUDE_DIR - The include directory for protocol buffers -# PROTOBUF_PROTOC_EXECUTABLE - The protoc compiler -# -# [New in CMake 2.8.5] -# -# :: -# -# PROTOBUF_LIBRARY_DEBUG - The protobuf library (debug) -# PROTOBUF_PROTOC_LIBRARY_DEBUG - The protoc library (debug) -# PROTOBUF_LITE_LIBRARY - The protobuf lite library -# PROTOBUF_LITE_LIBRARY_DEBUG - The protobuf lite library (debug) -# -# -# -# :: -# -# ==================================================================== -# Example: -# -# -# -# :: -# -# find_package(Protobuf REQUIRED) -# include_directories(${PROTOBUF_INCLUDE_DIRS}) -# -# -# -# :: -# -# include_directories(${CMAKE_CURRENT_BINARY_DIR}) -# PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS foo.proto) -# add_executable(bar bar.cc ${PROTO_SRCS} ${PROTO_HDRS}) -# target_link_libraries(bar ${PROTOBUF_LIBRARIES}) -# -# -# -# NOTE: You may need to link against pthreads, depending -# -# :: -# -# on the platform. -# -# -# -# NOTE: The PROTOBUF_GENERATE_CPP macro & add_executable() or -# add_library() -# -# :: -# -# calls only work properly within the same directory. -# -# -# -# :: -# -# ==================================================================== -# -# -# -# PROTOBUF_GENERATE_CPP (public function) -# -# :: -# -# SRCS = Variable to define with autogenerated -# source files -# HDRS = Variable to define with autogenerated -# header files -# ARGN = proto files -# -# -# -# :: -# -# ==================================================================== - +# ``PROTOBUF_LIBRARY`` +# The protobuf library +# ``PROTOBUF_PROTOC_LIBRARY`` +# The protoc library +# ``PROTOBUF_INCLUDE_DIR`` +# The include directory for protocol buffers +# ``PROTOBUF_PROTOC_EXECUTABLE`` +# The protoc compiler +# ``PROTOBUF_LIBRARY_DEBUG`` +# The protobuf library (debug) +# ``PROTOBUF_PROTOC_LIBRARY_DEBUG`` +# The protoc library (debug) +# ``PROTOBUF_LITE_LIBRARY`` +# The protobuf lite library +# ``PROTOBUF_LITE_LIBRARY_DEBUG`` +# The protobuf lite library (debug) +# +# Example: +# +# .. code-block:: cmake +# +# find_package(Protobuf REQUIRED) +# include_directories(${PROTOBUF_INCLUDE_DIRS}) +# include_directories(${CMAKE_CURRENT_BINARY_DIR}) +# protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS foo.proto) +# add_executable(bar bar.cc ${PROTO_SRCS} ${PROTO_HDRS}) +# target_link_libraries(bar ${PROTOBUF_LIBRARIES}) +# +# .. note:: +# The PROTOBUF_GENERATE_CPP macro and add_executable() or +# add_library() calls only work properly within the same +# directory. +# +# .. command:: protobuf_generate_cpp +# +# Add custom commands to process ``.proto`` files:: +# +# protobuf_generate_cpp (<SRCS> <HDRS> [<ARGN>...]) +# +# ``SRCS`` +# Variable to define with autogenerated source files +# ``HDRS`` +# Variable to define with autogenerated header files +# ``ARGN`` +# ``.proto`` files #============================================================================= # Copyright 2009 Kitware, Inc. diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 06a8917..a79246a 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -23,7 +23,7 @@ # .. note:: # # When using :prop_tgt:`IMPORTED` targets, the qtmain.lib static library is -# automatically linked on Windows for :variable:`WIN32 <WIN32_EXECUTABLE>` +# automatically linked on Windows for :prop_tgt:`WIN32 <WIN32_EXECUTABLE>` # executables. To disable that globally, set the # ``QT4_NO_LINK_QTMAIN`` variable before finding Qt4. To disable that # for a particular executable, set the ``QT4_NO_LINK_QTMAIN`` target @@ -104,19 +104,23 @@ # macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... ) # Create the interface header and implementation files # for all listed interface xml files. -# The basename will be automatically determined from the name of the xml file. +# The basename will be automatically determined from the name +# of the xml file. # -# The source file properties described for QT4_ADD_DBUS_INTERFACE also apply here. +# The source file properties described for +# QT4_ADD_DBUS_INTERFACE also apply here. # # # :: # -# macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname [basename] [classname]) +# macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname +# [basename] [classname]) # create a dbus adaptor (header and implementation file) from the xml file # describing the interface, and add it to the list of sources. The adaptor # forwards the calls to a parent class, defined in parentheader and named # parentclassname. The name of the generated files will be -# <basename>adaptor.{cpp,h} where basename defaults to the basename of the xml file. +# <basename>adaptor.{cpp,h} where basename defaults to the basename of the +# xml file. # If <classname> is provided, then it will be used as the classname of the # adaptor itself. # @@ -128,7 +132,8 @@ # If the optional argument interfacename is omitted, the name of the # interface file is constructed from the basename of the header with # the suffix .xml appended. -# Options may be given to qdbuscpp2xml, such as those found when executing "qdbuscpp2xml --help" +# Options may be given to qdbuscpp2xml, such as those found when +# executing "qdbuscpp2xml --help" # # # :: @@ -169,11 +174,12 @@ # a class uses the Q_OBJECT macro, moc has to run on it. If you don't # want to use QT4_WRAP_CPP() (which is reliable and mature), you can insert # #include "foo.moc" -# in foo.cpp and then give foo.cpp as argument to QT4_AUTOMOC(). This will the -# scan all listed files at cmake-time for such included moc files and if it finds -# them cause a rule to be generated to run moc at build time on the +# in foo.cpp and then give foo.cpp as argument to QT4_AUTOMOC(). This will +# scan all listed files at cmake-time for such included moc files and if it +# finds them cause a rule to be generated to run moc at build time on the # accompanying header file foo.h. -# If a source file has the SKIP_AUTOMOC property set it will be ignored by this macro. +# If a source file has the SKIP_AUTOMOC property set it will be ignored by +# this macro. # If the <tgt> is specified, the INTERFACE_INCLUDE_DIRECTORIES and # INTERFACE_COMPILE_DEFINITIONS from the <tgt> are passed to moc. # @@ -181,16 +187,17 @@ # :: # # function QT4_USE_MODULES( target [link_type] modules...) -# This function is obsolete. Use target_link_libraries with IMPORTED targets instead. +# This function is obsolete. Use target_link_libraries with IMPORTED targets +# instead. # Make <target> use the <modules> from Qt. Using a Qt module means -# to link to the library, add the relevant include directories for the module, -# and add the relevant compiler defines for using the module. +# to link to the library, add the relevant include directories for the +# module, and add the relevant compiler defines for using the module. # Modules are roughly equivalent to components of Qt4, so usage would be # something like: # qt4_use_modules(myexe Core Gui Declarative) -# to use QtCore, QtGui and QtDeclarative. The optional <link_type> argument can -# be specified as either LINK_PUBLIC or LINK_PRIVATE to specify the same argument -# to the target_link_libraries call. +# to use QtCore, QtGui and QtDeclarative. The optional <link_type> argument +# can be specified as either LINK_PUBLIC or LINK_PRIVATE to specify the +# same argument to the target_link_libraries call. # # # IMPORTED Targets diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake index aafdc09..b5ac703 100644 --- a/Modules/FindRuby.cmake +++ b/Modules/FindRuby.cmake @@ -14,19 +14,21 @@ # It also determines what the name of the library is. This code sets # the following variables: # -# :: +# ``RUBY_EXECUTABLE`` +# full path to the ruby binary +# ``RUBY_INCLUDE_DIRS`` +# include dirs to be used when using the ruby library +# ``RUBY_LIBRARY`` +# full path to the ruby library +# ``RUBY_VERSION`` +# the version of ruby which was found, e.g. "1.8.7" +# ``RUBY_FOUND`` +# set to true if ruby ws found successfully # -# RUBY_EXECUTABLE = full path to the ruby binary -# RUBY_INCLUDE_DIRS = include dirs to be used when using the ruby library -# RUBY_LIBRARY = full path to the ruby library -# RUBY_VERSION = the version of ruby which was found, e.g. "1.8.7" -# RUBY_FOUND = set to true if ruby ws found successfully +# Also: # -# -# -# :: -# -# RUBY_INCLUDE_PATH = same as RUBY_INCLUDE_DIRS, only provided for compatibility reasons, don't use it +# ``RUBY_INCLUDE_PATH`` +# same as RUBY_INCLUDE_DIRS, only provided for compatibility reasons, don't use it #============================================================================= # Copyright 2004-2009 Kitware, Inc. diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake index fc2c043..49b5e40 100644 --- a/Modules/FindSDL_image.cmake +++ b/Modules/FindSDL_image.cmake @@ -11,7 +11,8 @@ # SDL_IMAGE_LIBRARIES, the name of the library to link against # SDL_IMAGE_INCLUDE_DIRS, where to find the headers # SDL_IMAGE_FOUND, if false, do not try to link against -# SDL_IMAGE_VERSION_STRING - human-readable string containing the version of SDL_image +# SDL_IMAGE_VERSION_STRING - human-readable string containing the +# version of SDL_image # # # diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake index 176fee6..9e11796 100644 --- a/Modules/FindSDL_mixer.cmake +++ b/Modules/FindSDL_mixer.cmake @@ -11,7 +11,8 @@ # SDL_MIXER_LIBRARIES, the name of the library to link against # SDL_MIXER_INCLUDE_DIRS, where to find the headers # SDL_MIXER_FOUND, if false, do not try to link against -# SDL_MIXER_VERSION_STRING - human-readable string containing the version of SDL_mixer +# SDL_MIXER_VERSION_STRING - human-readable string containing the +# version of SDL_mixer # # # diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake index 5fa40a5..494d358 100644 --- a/Modules/FindSDL_sound.cmake +++ b/Modules/FindSDL_sound.cmake @@ -21,7 +21,8 @@ # flags to SDL_SOUND_LIBRARIES. This is prepended to SDL_SOUND_LIBRARIES. # This is available mostly for cases this module failed to anticipate for # and you must add additional flags. This is marked as ADVANCED. -# SDL_SOUND_VERSION_STRING, human-readable string containing the version of SDL_sound +# SDL_SOUND_VERSION_STRING, human-readable string containing the +# version of SDL_sound # # # diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake index 2b7fd22..51e279d 100644 --- a/Modules/FindSquish.cmake +++ b/Modules/FindSquish.cmake @@ -21,7 +21,8 @@ # # :: # -# SQUISH_INSTALL_DIR The Squish installation directory (containing bin, lib, etc) +# SQUISH_INSTALL_DIR The Squish installation directory +# (containing bin, lib, etc) # SQUISH_SERVER_EXECUTABLE The squishserver executable # SQUISH_CLIENT_EXECUTABLE The squishrunner executable # @@ -40,28 +41,34 @@ # # :: # -# squish_v4_add_test(cmakeTestName AUT targetName SUITE suiteName TEST squishTestName -# [SETTINGSGROUP group] [PRE_COMMAND command] [POST_COMMAND command] ) +# squish_v4_add_test(cmakeTestName +# AUT targetName SUITE suiteName TEST squishTestName +# [SETTINGSGROUP group] [PRE_COMMAND command] [POST_COMMAND command] ) # # # # The arguments have the following meaning: # -# :: -# -# cmakeTestName: this will be used as the first argument for add_test() -# AUT targetName: the name of the cmake target which will be used as AUT, i.e. the -# executable which will be tested. -# SUITE suiteName: this is either the full path to the squish suite, or just the -# last directory of the suite, i.e. the suite name. In this case -# the CMakeLists.txt which calls squish_add_test() must be located -# in the parent directory of the suite directory. -# TEST squishTestName: the name of the squish test, i.e. the name of the subdirectory -# of the test inside the suite directory. -# SETTINGSGROUP group: if specified, the given settings group will be used for executing the test. -# If not specified, the groupname will be "CTest_<username>" -# PRE_COMMAND command: if specified, the given command will be executed before starting the squish test. -# POST_COMMAND command: same as PRE_COMMAND, but after the squish test has been executed. +# ``cmakeTestName`` +# this will be used as the first argument for add_test() +# ``AUT targetName`` +# the name of the cmake target which will be used as AUT, i.e. the +# executable which will be tested. +# ``SUITE suiteName`` +# this is either the full path to the squish suite, or just the +# last directory of the suite, i.e. the suite name. In this case +# the CMakeLists.txt which calls squish_add_test() must be located +# in the parent directory of the suite directory. +# ``TEST squishTestName`` +# the name of the squish test, i.e. the name of the subdirectory +# of the test inside the suite directory. +# ``SETTINGSGROUP group`` +# if specified, the given settings group will be used for executing the test. +# If not specified, the groupname will be "CTest_<username>" +# ``PRE_COMMAND command`` +# if specified, the given command will be executed before starting the squish test. +# ``POST_COMMAND command`` +# same as PRE_COMMAND, but after the squish test has been executed. # # # @@ -70,7 +77,12 @@ # enable_testing() # find_package(Squish 4.0) # if (SQUISH_FOUND) -# squish_v4_add_test(myTestName AUT myApp SUITE ${CMAKE_SOURCE_DIR}/tests/mySuite TEST someSquishTest SETTINGSGROUP myGroup ) +# squish_v4_add_test(myTestName +# AUT myApp +# SUITE ${CMAKE_SOURCE_DIR}/tests/mySuite +# TEST someSquishTest +# SETTINGSGROUP myGroup +# ) # endif () # # diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake index 10956aa..c61e7e9 100644 --- a/Modules/GNUInstallDirs.cmake +++ b/Modules/GNUInstallDirs.cmake @@ -6,36 +6,47 @@ # # Provides install directory variables as defined for GNU software: # -# :: -# # http://www.gnu.org/prep/standards/html_node/Directory-Variables.html # # Inclusion of this module defines the following variables: # -# :: -# -# CMAKE_INSTALL_<dir> - destination for files of a given type -# CMAKE_INSTALL_FULL_<dir> - corresponding absolute path +# ``CMAKE_INSTALL_<dir>`` +# destination for files of a given type +# ``CMAKE_INSTALL_FULL_<dir>`` +# corresponding absolute path # # where <dir> is one of: # -# :: -# -# BINDIR - user executables (bin) -# SBINDIR - system admin executables (sbin) -# LIBEXECDIR - program executables (libexec) -# SYSCONFDIR - read-only single-machine data (etc) -# SHAREDSTATEDIR - modifiable architecture-independent data (com) -# LOCALSTATEDIR - modifiable single-machine data (var) -# LIBDIR - object code libraries (lib or lib64 or lib/<multiarch-tuple> on Debian) -# INCLUDEDIR - C header files (include) -# OLDINCLUDEDIR - C header files for non-gcc (/usr/include) -# DATAROOTDIR - read-only architecture-independent data root (share) -# DATADIR - read-only architecture-independent data (DATAROOTDIR) -# INFODIR - info documentation (DATAROOTDIR/info) -# LOCALEDIR - locale-dependent data (DATAROOTDIR/locale) -# MANDIR - man documentation (DATAROOTDIR/man) -# DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME) +# ``BINDIR`` +# user executables (bin) +# ``SBINDIR`` +# system admin executables (sbin) +# ``LIBEXECDIR`` +# program executables (libexec) +# ``SYSCONFDIR`` +# read-only single-machine data (etc) +# ``SHAREDSTATEDIR`` +# modifiable architecture-independent data (com) +# ``LOCALSTATEDIR`` +# modifiable single-machine data (var) +# ``LIBDIR`` +# object code libraries (lib or lib64 or lib/<multiarch-tuple> on Debian) +# ``INCLUDEDIR`` +# C header files (include) +# ``OLDINCLUDEDIR`` +# C header files for non-gcc (/usr/include) +# ``DATAROOTDIR`` +# read-only architecture-independent data root (share) +# ``DATADIR`` +# read-only architecture-independent data (DATAROOTDIR) +# ``INFODIR`` +# info documentation (DATAROOTDIR/info) +# ``LOCALEDIR`` +# locale-dependent data (DATAROOTDIR/locale) +# ``MANDIR`` +# man documentation (DATAROOTDIR/man) +# ``DOCDIR`` +# documentation root (DATAROOTDIR/doc/PROJECT_NAME) # # Each CMAKE_INSTALL_<dir> value may be passed to the DESTINATION # options of install() commands for the corresponding file type. If the diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake index ac410de..88f9bf7 100644 --- a/Modules/Platform/Windows-wcl386.cmake +++ b/Modules/Platform/Windows-wcl386.cmake @@ -18,8 +18,8 @@ set(CMAKE_CREATE_CONSOLE_EXE "system nt" ) set(CMAKE_SHARED_LINKER_FLAGS_INIT "system nt_dll") set(CMAKE_MODULE_LINKER_FLAGS_INIT "system nt_dll") foreach(type SHARED MODULE EXE) - set(CMAKE_${type}_LINKER_FLAGS_DEBUG_INIT "debug all opt map, symfile") - set(CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all opt map, symfile") + set(CMAKE_${type}_LINKER_FLAGS_DEBUG_INIT "debug all opt map") + set(CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all opt map") endforeach() set(CMAKE_C_COMPILE_OPTIONS_DLL "-bd") # Note: This variable is a ';' separated list diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index 8c4daac..6516b0a 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -232,7 +232,7 @@ macro (QT4_ADD_RESOURCES outfiles ) # let's make a configured file and add it as a dependency so cmake is run # again when dependencies need to be recomputed. QT4_MAKE_OUTPUT_FILE("${infile}" "" "qrc.depends" out_depends) - configure_file("${infile}" "${out_depends}" COPY_ONLY) + configure_file("${infile}" "${out_depends}" COPYONLY) else() # The .qrc file does not exist (yet). Let's add a dependency and hope # that it will be generated later diff --git a/Modules/WriteBasicConfigVersionFile.cmake b/Modules/WriteBasicConfigVersionFile.cmake index 7d28e95..bf55eb9 100644 --- a/Modules/WriteBasicConfigVersionFile.cmake +++ b/Modules/WriteBasicConfigVersionFile.cmake @@ -6,7 +6,10 @@ # # :: # -# WRITE_BASIC_CONFIG_VERSION_FILE( filename [VERSION major.minor.patch] COMPATIBILITY (AnyNewerVersion|SameMajorVersion) ) +# WRITE_BASIC_CONFIG_VERSION_FILE( filename +# [VERSION major.minor.patch] +# COMPATIBILITY (AnyNewerVersion|SameMajorVersion) +# ) # # # diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 9c39a11..e1b62e9 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) -set(CMake_VERSION_MINOR 0) -set(CMake_VERSION_PATCH 20141014) -#set(CMake_VERSION_RC 1) +set(CMake_VERSION_MINOR 1) +set(CMake_VERSION_PATCH 0) +set(CMake_VERSION_RC 2) diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index b13a125..1fb8f30 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -263,21 +263,26 @@ cmComputeLinkDepends::Compute() this->OrderLinkEntires(); // Compute the final set of link entries. + // Iterate in reverse order so we can keep only the last occurrence + // of a shared library. std::set<int> emmitted; - for(std::vector<int>::const_iterator li = this->FinalLinkOrder.begin(); - li != this->FinalLinkOrder.end(); ++li) + for(std::vector<int>::const_reverse_iterator + li = this->FinalLinkOrder.rbegin(), + le = this->FinalLinkOrder.rend(); + li != le; ++li) { int i = *li; LinkEntry const& e = this->EntryList[i]; cmTarget const* t = e.Target; - // Entries that we know the linker will re-use for symbols - // needed by later entries do not need to be repeated. + // Entries that we know the linker will re-use do not need to be repeated. bool uniquify = t && t->GetType() == cmTarget::SHARED_LIBRARY; if(!uniquify || emmitted.insert(i).second) { this->FinalLinkEntries.push_back(e); } } + // Reverse the resulting order since we iterated in reverse. + std::reverse(this->FinalLinkEntries.begin(), this->FinalLinkEntries.end()); // Display the final set. if(this->DebugMode) diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index 5515f35..fe32dd5 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -29,7 +29,7 @@ void cmDefinitions::Reset(cmDefinitions* parent) //---------------------------------------------------------------------------- cmDefinitions::Def const& -cmDefinitions::GetInternal(const std::string& key) const +cmDefinitions::GetInternal(const std::string& key) { MapType::const_iterator i = this->Map.find(key); if(i != this->Map.end()) @@ -38,8 +38,9 @@ cmDefinitions::GetInternal(const std::string& key) const } if(cmDefinitions* up = this->Up) { - // Query the parent scope. - return up->GetInternal(key); + // Query the parent scope and store the result locally. + Def def = up->GetInternal(key); + return this->Map.insert(MapType::value_type(key, def)).first->second; } return this->NoDef; } @@ -62,26 +63,13 @@ cmDefinitions::SetInternal(const std::string& key, Def const& def) } //---------------------------------------------------------------------------- -const char* cmDefinitions::Get(const std::string& key) const +const char* cmDefinitions::Get(const std::string& key) { Def const& def = this->GetInternal(key); return def.Exists? def.c_str() : 0; } //---------------------------------------------------------------------------- -void cmDefinitions::Pull(const std::string& key) -{ - if (this->Up) - { - Def const& def = this->Up->GetInternal(key); - if (def.Exists) - { - this->SetInternal(key, def); - } - } -} - -//---------------------------------------------------------------------------- const char* cmDefinitions::Set(const std::string& key, const char* value) { Def const& def = this->SetInternal(key, Def(value)); diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h index 5209a8b..a2f053f 100644 --- a/Source/cmDefinitions.h +++ b/Source/cmDefinitions.h @@ -36,11 +36,9 @@ public: /** Returns the parent scope, if any. */ cmDefinitions* GetParent() const { return this->Up; } - /** Get the value associated with a key; null if none. */ - const char* Get(const std::string& key) const; - - /** Pull a variable from the parent. */ - void Pull(const std::string& key); + /** Get the value associated with a key; null if none. + Store the result locally if it came from a parent. */ + const char* Get(const std::string& key); /** Set (or unset if null) a value associated with a key. */ const char* Set(const std::string& key, const char* value); @@ -82,7 +80,7 @@ private: MapType Map; // Internal query and update methods. - Def const& GetInternal(const std::string& key) const; + Def const& GetInternal(const std::string& key); Def const& SetInternal(const std::string& key, Def const& def); // Implementation of Closure() method. diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index c1478df..67a1a6d 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1286,12 +1286,16 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode std::string obj_dir = gt->ObjectDirectory; std::string result; const char* sep = ""; - for(std::map<cmSourceFile const*, std::string>::const_iterator it - = mapping.begin(); it != mapping.end(); ++it) + for(std::vector<cmSourceFile const*>::const_iterator it + = objectSources.begin(); it != objectSources.end(); ++it) { - assert(!it->second.empty()); + // Find the object file name corresponding to this source file. + std::map<cmSourceFile const*, std::string>::const_iterator + map_it = mapping.find(*it); + // It must exist because we populated the mapping just above. + assert(!map_it->second.empty()); result += sep; - std::string objFile = obj_dir + it->second; + std::string objFile = obj_dir + map_it->second; cmSourceFile* sf = context->Makefile->GetOrCreateSource(objFile, true); sf->SetObjectLibrary(tgtName); sf->SetProperty("EXTERNAL_OBJECT", "1"); diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h index 470dea4..120d2f8 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.h +++ b/Source/cmGlobalBorlandMakefileGenerator.h @@ -39,7 +39,7 @@ public: virtual cmLocalGenerator *CreateLocalGenerator(); /** - * Try to determine system infomation such as shared library + * Try to determine system information such as shared library * extension, pthreads, byte order etc. */ virtual void EnableLanguage(std::vector<std::string>const& languages, diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 6a4adc0..2f4d9bb 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -318,7 +318,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) // will run xcodebuild and if it sees the error text file busy // it will stop forwarding output, and let the build finish. // Then it will retry the build. It will continue this - // untill no text file busy errors occur. + // until no text file busy errors occur. std::string cmakexbuild = this->CMakeInstance->GetCacheManager()->GetCacheValue("CMAKE_COMMAND"); cmakexbuild = cmakexbuild.substr(0, cmakexbuild.length()-5); @@ -1008,9 +1008,9 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const std::string& l, if (sscanf(linkerPref, "%d", &preference)!=1) { // backward compatibility: before 2.6 LINKER_PREFERENCE - // was either "None" or "Prefered", and only the first character was + // was either "None" or "Preferred", and only the first character was // tested. So if there is a custom language out there and it is - // "Prefered", set its preference high + // "Preferred", set its preference high if (linkerPref[0]=='P') { preference = 100; @@ -2362,7 +2362,8 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) depends.push_back(this->GetAllTargetName()); } } - if(mf->GetDefinition("CMake_BINARY_DIR")) + if(mf->GetDefinition("CMake_BINARY_DIR") && + !mf->IsOn("CMAKE_CROSSCOMPILING")) { // We are building CMake itself. We cannot use the original // executable to install over itself. The generator will diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index f166789..ddd7e91 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -39,7 +39,7 @@ class cmExportBuildFileGenerator; class cmQtAutoGenerators; /** \class cmGlobalGenerator - * \brief Responable for overseeing the generation process for the entire tree + * \brief Responsible for overseeing the generation process for the entire tree * * Subclasses of this class generate makefiles for various * platforms. @@ -94,7 +94,7 @@ public: void ClearEnabledLanguages(); void GetEnabledLanguages(std::vector<std::string>& lang) const; /** - * Try to determine system infomation such as shared library + * Try to determine system information such as shared library * extension, pthreads, byte order etc. */ virtual void EnableLanguage(std::vector<std::string>const& languages, @@ -108,7 +108,7 @@ public: bool optional) const; /** - * Try to determine system infomation, get it from another generator + * Try to determine system information, get it from another generator */ virtual void EnableLanguagesFromGenerator(cmGlobalGenerator *gen, cmMakefile* mf); @@ -198,7 +198,7 @@ public: std::string GetLanguageFromExtension(const char* ext) const; ///! is an extension to be ignored bool IgnoreFile(const char* ext) const; - ///! What is the preference for linkers and this language (None or Prefered) + ///! What is the preference for linkers and this language (None or Preferred) int GetLinkerPreference(const std::string& lang) const; ///! What is the object file extension for a given source file? std::string GetLanguageOutputExtension(cmSourceFile const&) const; diff --git a/Source/cmGlobalJOMMakefileGenerator.h b/Source/cmGlobalJOMMakefileGenerator.h index 344e013..fbb35f3 100644 --- a/Source/cmGlobalJOMMakefileGenerator.h +++ b/Source/cmGlobalJOMMakefileGenerator.h @@ -40,7 +40,7 @@ public: virtual cmLocalGenerator *CreateLocalGenerator(); /** - * Try to determine system infomation such as shared library + * Try to determine system information such as shared library * extension, pthreads, byte order etc. */ virtual void EnableLanguage(std::vector<std::string>const& languages, diff --git a/Source/cmGlobalMSYSMakefileGenerator.h b/Source/cmGlobalMSYSMakefileGenerator.h index c4825bd..baecde7 100644 --- a/Source/cmGlobalMSYSMakefileGenerator.h +++ b/Source/cmGlobalMSYSMakefileGenerator.h @@ -39,7 +39,7 @@ public: virtual cmLocalGenerator *CreateLocalGenerator(); /** - * Try to determine system infomation such as shared library + * Try to determine system information such as shared library * extension, pthreads, byte order etc. */ virtual void EnableLanguage(std::vector<std::string>const& languages, diff --git a/Source/cmGlobalMinGWMakefileGenerator.h b/Source/cmGlobalMinGWMakefileGenerator.h index 4289422..fa8d9f2 100644 --- a/Source/cmGlobalMinGWMakefileGenerator.h +++ b/Source/cmGlobalMinGWMakefileGenerator.h @@ -38,7 +38,7 @@ public: virtual cmLocalGenerator *CreateLocalGenerator(); /** - * Try to determine system infomation such as shared library + * Try to determine system information such as shared library * extension, pthreads, byte order etc. */ virtual void EnableLanguage(std::vector<std::string>const& languages, diff --git a/Source/cmGlobalNMakeMakefileGenerator.h b/Source/cmGlobalNMakeMakefileGenerator.h index 2ff44e3..e7b03dd 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.h +++ b/Source/cmGlobalNMakeMakefileGenerator.h @@ -38,7 +38,7 @@ public: virtual cmLocalGenerator *CreateLocalGenerator(); /** - * Try to determine system infomation such as shared library + * Try to determine system information such as shared library * extension, pthreads, byte order etc. */ virtual void EnableLanguage(std::vector<std::string>const& languages, diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index a192eee..f666ee3 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -337,7 +337,7 @@ private: std::string ninjaCmd() const; - /// The file containing the build statement. (the relation ship of the + /// The file containing the build statement. (the relationship of the /// compilation DAG). cmGeneratedFileStream* BuildFileStream; /// The file containing the rule statements. (The action attached to each diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index f44dd12..c61c36e 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -71,7 +71,7 @@ public: virtual cmLocalGenerator *CreateLocalGenerator(); /** - * Try to determine system infomation such as shared library + * Try to determine system information such as shared library * extension, pthreads, byte order etc. */ virtual void EnableLanguage(std::vector<std::string>const& languages, diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index d70d2af..499ac56 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -262,6 +262,24 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsStore(cmMakefile* mf) } //---------------------------------------------------------------------------- +bool +cmGlobalVisualStudio10Generator::SelectWindowsPhoneToolset( + std::string& toolset) const +{ + toolset = ""; + return false; +} + +//---------------------------------------------------------------------------- +bool +cmGlobalVisualStudio10Generator::SelectWindowsStoreToolset( + std::string& toolset) const +{ + toolset = ""; + return false; +} + +//---------------------------------------------------------------------------- std::string cmGlobalVisualStudio10Generator::SelectWindowsCEToolset() const { if (this->SystemVersion == "8.0") diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 3af7b51..3b0a5cf 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -49,7 +49,7 @@ public: virtual cmLocalGenerator *CreateLocalGenerator(); /** - * Try to determine system infomation such as shared library + * Try to determine system information such as shared library * extension, pthreads, byte order etc. */ virtual void EnableLanguage(std::vector<std::string>const& languages, @@ -118,9 +118,10 @@ protected: virtual bool InitializeWindowsCE(cmMakefile* mf); virtual bool InitializeWindowsPhone(cmMakefile* mf); virtual bool InitializeWindowsStore(cmMakefile* mf); + virtual std::string SelectWindowsCEToolset() const; - virtual std::string SelectWindowsPhoneToolset() const { return ""; } - virtual std::string SelectWindowsStoreToolset() const { return ""; } + virtual bool SelectWindowsPhoneToolset(std::string& toolset) const; + virtual bool SelectWindowsStoreToolset(std::string& toolset) const; virtual const char* GetIDEVersion() { return "10.0"; } diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index 39bbdc0..2b69222 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -131,12 +131,20 @@ cmGlobalVisualStudio11Generator::MatchesGeneratorName( //---------------------------------------------------------------------------- bool cmGlobalVisualStudio11Generator::InitializeWindowsPhone(cmMakefile* mf) { - this->DefaultPlatformToolset = this->SelectWindowsPhoneToolset(); - if(this->DefaultPlatformToolset.empty()) + if(!this->SelectWindowsPhoneToolset(this->DefaultPlatformToolset)) { cmOStringStream e; - e << this->GetName() << " supports Windows Phone '8.0', but not '" - << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + if(this->DefaultPlatformToolset.empty()) + { + e << this->GetName() << " supports Windows Phone '8.0', but not '" + << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + } + else + { + e << "A Windows Phone component with CMake requires both the Windows " + << "Desktop SDK as well as the Windows Phone '" << this->SystemVersion + << "' SDK. Please make sure that you have both installed"; + } mf->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; } @@ -146,12 +154,20 @@ bool cmGlobalVisualStudio11Generator::InitializeWindowsPhone(cmMakefile* mf) //---------------------------------------------------------------------------- bool cmGlobalVisualStudio11Generator::InitializeWindowsStore(cmMakefile* mf) { - this->DefaultPlatformToolset = this->SelectWindowsStoreToolset(); - if(this->DefaultPlatformToolset.empty()) + if(!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset)) { cmOStringStream e; - e << this->GetName() << " supports Windows Store '8.0', but not '" - << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + if(this->DefaultPlatformToolset.empty()) + { + e << this->GetName() << " supports Windows Store '8.0', but not '" + << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + } + else + { + e << "A Windows Store component with CMake requires both the Windows " + << "Desktop SDK as well as the Windows Store '" << this->SystemVersion + << "' SDK. Please make sure that you have both installed"; + } mf->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; } @@ -159,23 +175,47 @@ bool cmGlobalVisualStudio11Generator::InitializeWindowsStore(cmMakefile* mf) } //---------------------------------------------------------------------------- -std::string cmGlobalVisualStudio11Generator::SelectWindowsPhoneToolset() const +bool +cmGlobalVisualStudio11Generator::SelectWindowsPhoneToolset( + std::string& toolset) const { if(this->SystemVersion == "8.0") { - return "v110_wp80"; + if (this->IsWindowsPhoneToolsetInstalled() && + this->IsWindowsDesktopToolsetInstalled()) + { + toolset = "v110_wp80"; + return true; + } + else + { + return false; + } } - return this->cmGlobalVisualStudio10Generator::SelectWindowsPhoneToolset(); + return + this->cmGlobalVisualStudio10Generator::SelectWindowsPhoneToolset(toolset); } //---------------------------------------------------------------------------- -std::string cmGlobalVisualStudio11Generator::SelectWindowsStoreToolset() const +bool +cmGlobalVisualStudio11Generator::SelectWindowsStoreToolset( + std::string& toolset) const { if(this->SystemVersion == "8.0") { - return "v110"; + if(this->IsWindowsStoreToolsetInstalled() && + this->IsWindowsDesktopToolsetInstalled()) + { + toolset = "v110"; + return true; + } + else + { + return false; + } } - return this->cmGlobalVisualStudio10Generator::SelectWindowsStoreToolset(); + return + this->cmGlobalVisualStudio10Generator::SelectWindowsStoreToolset(toolset); } //---------------------------------------------------------------------------- @@ -256,3 +296,54 @@ cmGlobalVisualStudio11Generator::NeedsDeploy(cmTarget::TargetType type) const } return cmGlobalVisualStudio10Generator::NeedsDeploy(type); } + +//---------------------------------------------------------------------------- +bool +cmGlobalVisualStudio11Generator::IsWindowsDesktopToolsetInstalled() const +{ + const char desktop80Key[] = + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + "VisualStudio\\11.0\\VC\\Libraries\\Extended"; + const char VS2012DesktopExpressKey[] = + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + "WDExpress\\11.0;InstallDir"; + + std::vector<std::string> subkeys; + std::string path; + return cmSystemTools::ReadRegistryValue(VS2012DesktopExpressKey, + path, + cmSystemTools::KeyWOW64_32) || + cmSystemTools::GetRegistrySubKeys(desktop80Key, + subkeys, + cmSystemTools::KeyWOW64_32); +} + +//---------------------------------------------------------------------------- +bool +cmGlobalVisualStudio11Generator::IsWindowsPhoneToolsetInstalled() const +{ + const char wp80Key[] = + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + "Microsoft SDKs\\WindowsPhone\\v8.0\\" + "Install Path;Install Path"; + + std::string path; + cmSystemTools::ReadRegistryValue(wp80Key, + path, + cmSystemTools::KeyWOW64_32); + return !path.empty(); +} + +//---------------------------------------------------------------------------- +bool +cmGlobalVisualStudio11Generator::IsWindowsStoreToolsetInstalled() const +{ + const char win80Key[] = + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + "VisualStudio\\11.0\\VC\\Libraries\\Core\\Arm"; + + std::vector<std::string> subkeys; + return cmSystemTools::GetRegistrySubKeys(win80Key, + subkeys, + cmSystemTools::KeyWOW64_32); +} diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h index bbd935c..c79dc97 100644 --- a/Source/cmGlobalVisualStudio11Generator.h +++ b/Source/cmGlobalVisualStudio11Generator.h @@ -36,8 +36,15 @@ public: protected: virtual bool InitializeWindowsPhone(cmMakefile* mf); virtual bool InitializeWindowsStore(cmMakefile* mf); - virtual std::string SelectWindowsPhoneToolset() const; - virtual std::string SelectWindowsStoreToolset() const; + virtual bool SelectWindowsPhoneToolset(std::string& toolset) const; + virtual bool SelectWindowsStoreToolset(std::string& toolset) const; + + // These aren't virtual because we need to check if the selected version + // of the toolset is installed + bool IsWindowsDesktopToolsetInstalled() const; + bool IsWindowsPhoneToolsetInstalled() const; + bool IsWindowsStoreToolsetInstalled() const; + virtual const char* GetIDEVersion() { return "11.0"; } bool UseFolderProperty(); static std::set<std::string> GetInstalledWindowsCESDKs(); diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index 29ecfe0..047f2ad 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -111,12 +111,20 @@ cmGlobalVisualStudio12Generator::MatchesGeneratorName( //---------------------------------------------------------------------------- bool cmGlobalVisualStudio12Generator::InitializeWindowsPhone(cmMakefile* mf) { - this->DefaultPlatformToolset = this->SelectWindowsPhoneToolset(); - if(this->DefaultPlatformToolset.empty()) + if(!this->SelectWindowsPhoneToolset(this->DefaultPlatformToolset)) { cmOStringStream e; - e << this->GetName() << " supports Windows Phone '8.0' and '8.1', " - "but not '" << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + if(this->DefaultPlatformToolset.empty()) + { + e << this->GetName() << " supports Windows Phone '8.0' and '8.1', but " + "not '" << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + } + else + { + e << "A Windows Phone component with CMake requires both the Windows " + << "Desktop SDK as well as the Windows Phone '" << this->SystemVersion + << "' SDK. Please make sure that you have both installed"; + } mf->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; } @@ -126,12 +134,20 @@ bool cmGlobalVisualStudio12Generator::InitializeWindowsPhone(cmMakefile* mf) //---------------------------------------------------------------------------- bool cmGlobalVisualStudio12Generator::InitializeWindowsStore(cmMakefile* mf) { - this->DefaultPlatformToolset = this->SelectWindowsStoreToolset(); - if(this->DefaultPlatformToolset.empty()) + if(!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset)) { cmOStringStream e; - e << this->GetName() << " supports Windows Store '8.0' and '8.1', " - "but not '" << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + if(this->DefaultPlatformToolset.empty()) + { + e << this->GetName() << " supports Windows Store '8.0' and '8.1', but " + "not '" << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + } + else + { + e << "A Windows Store component with CMake requires both the Windows " + << "Desktop SDK as well as the Windows Store '" << this->SystemVersion + << "' SDK. Please make sure that you have both installed"; + } mf->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; } @@ -139,23 +155,47 @@ bool cmGlobalVisualStudio12Generator::InitializeWindowsStore(cmMakefile* mf) } //---------------------------------------------------------------------------- -std::string cmGlobalVisualStudio12Generator::SelectWindowsPhoneToolset() const +bool +cmGlobalVisualStudio12Generator::SelectWindowsPhoneToolset( + std::string& toolset) const { if(this->SystemVersion == "8.1") { - return "v120_wp81"; + if (this->IsWindowsPhoneToolsetInstalled() && + this->IsWindowsDesktopToolsetInstalled()) + { + toolset = "v120_wp81"; + return true; + } + else + { + return false; + } } - return this->cmGlobalVisualStudio11Generator::SelectWindowsPhoneToolset(); + return + this->cmGlobalVisualStudio11Generator::SelectWindowsPhoneToolset(toolset); } //---------------------------------------------------------------------------- -std::string cmGlobalVisualStudio12Generator::SelectWindowsStoreToolset() const +bool +cmGlobalVisualStudio12Generator::SelectWindowsStoreToolset( + std::string& toolset) const { if(this->SystemVersion == "8.1") { - return "v120"; + if(this->IsWindowsStoreToolsetInstalled() && + this->IsWindowsDesktopToolsetInstalled()) + { + toolset = "v120"; + return true; + } + else + { + return false; + } } - return this->cmGlobalVisualStudio11Generator::SelectWindowsStoreToolset(); + return + this->cmGlobalVisualStudio11Generator::SelectWindowsStoreToolset(toolset); } //---------------------------------------------------------------------------- @@ -180,3 +220,46 @@ cmLocalGenerator *cmGlobalVisualStudio12Generator::CreateLocalGenerator() lg->SetGlobalGenerator(this); return lg; } + +//---------------------------------------------------------------------------- +bool +cmGlobalVisualStudio12Generator::IsWindowsDesktopToolsetInstalled() const +{ + const char desktop81Key[] = + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + "VisualStudio\\12.0\\VC\\LibraryDesktop"; + + std::vector<std::string> subkeys; + return cmSystemTools::GetRegistrySubKeys(desktop81Key, + subkeys, + cmSystemTools::KeyWOW64_32); +} + +//---------------------------------------------------------------------------- +bool +cmGlobalVisualStudio12Generator::IsWindowsPhoneToolsetInstalled() const +{ + const char wp81Key[] = + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + "Microsoft SDKs\\WindowsPhone\\v8.1\\Install Path;Install Path"; + + std::string path; + cmSystemTools::ReadRegistryValue(wp81Key, + path, + cmSystemTools::KeyWOW64_32); + return !path.empty(); +} + +//---------------------------------------------------------------------------- +bool +cmGlobalVisualStudio12Generator::IsWindowsStoreToolsetInstalled() const +{ + const char win81Key[] = + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + "VisualStudio\\12.0\\VC\\Libraries\\Core\\Arm"; + + std::vector<std::string> subkeys; + return cmSystemTools::GetRegistrySubKeys(win81Key, + subkeys, + cmSystemTools::KeyWOW64_32); +} diff --git a/Source/cmGlobalVisualStudio12Generator.h b/Source/cmGlobalVisualStudio12Generator.h index ec85f10..a81516f 100644 --- a/Source/cmGlobalVisualStudio12Generator.h +++ b/Source/cmGlobalVisualStudio12Generator.h @@ -41,8 +41,14 @@ public: protected: virtual bool InitializeWindowsPhone(cmMakefile* mf); virtual bool InitializeWindowsStore(cmMakefile* mf); - virtual std::string SelectWindowsPhoneToolset() const; - virtual std::string SelectWindowsStoreToolset() const; + virtual bool SelectWindowsPhoneToolset(std::string& toolset) const; + virtual bool SelectWindowsStoreToolset(std::string& toolset) const; + + // These aren't virtual because we need to check if the selected version + // of the toolset is installed + bool IsWindowsDesktopToolsetInstalled() const; + bool IsWindowsPhoneToolsetInstalled() const; + bool IsWindowsStoreToolsetInstalled() const; virtual const char* GetIDEVersion() { return "12.0"; } private: class Factory; diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index d001f93..fe702c0 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -13,21 +13,36 @@ #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" -static const char vs14generatorName[] = "Visual Studio 14"; +static const char vs14generatorName[] = "Visual Studio 14 2015"; + +// Map generator name without year to name with year. +static const char* cmVS14GenName(const std::string& name, std::string& genName) +{ + if(strncmp(name.c_str(), vs14generatorName, + sizeof(vs14generatorName)-6) != 0) + { + return 0; + } + const char* p = name.c_str() + sizeof(vs14generatorName) - 6; + if(cmHasLiteralPrefix(p, " 2015")) + { + p += 5; + } + genName = std::string(vs14generatorName) + p; + return p; +} class cmGlobalVisualStudio14Generator::Factory : public cmGlobalGeneratorFactory { public: virtual cmGlobalGenerator* CreateGlobalGenerator( - const std::string& genName) const + const std::string& name) const { - if(strncmp(genName.c_str(), vs14generatorName, - sizeof(vs14generatorName) - 1) != 0) - { - return 0; - } - const char* p = genName.c_str() + sizeof(vs14generatorName) - 1; + std::string genName; + const char* p = cmVS14GenName(name, genName); + if(!p) + { return 0; } if(!*p) { return new cmGlobalVisualStudio14Generator( @@ -51,7 +66,7 @@ public: virtual void GetDocumentation(cmDocumentationEntry& entry) const { entry.Name = vs14generatorName; - entry.Brief = "Generates Visual Studio 14 project files."; + entry.Brief = "Generates Visual Studio 14 (VS 2015) project files."; } virtual void GetGenerators(std::vector<std::string>& names) const @@ -85,7 +100,12 @@ bool cmGlobalVisualStudio14Generator::MatchesGeneratorName( const std::string& name) const { - return name == this->GetName(); + std::string genName; + if(cmVS14GenName(name, genName)) + { + return genName == this->GetName(); + } + return false; } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h index 57c2660..58efb25 100644 --- a/Source/cmGlobalVisualStudio6Generator.h +++ b/Source/cmGlobalVisualStudio6Generator.h @@ -42,7 +42,7 @@ public: virtual cmLocalGenerator *CreateLocalGenerator(); /** - * Try to determine system infomation such as shared library + * Try to determine system information such as shared library * extension, pthreads, byte order etc. */ virtual void EnableLanguage(std::vector<std::string>const& languages, diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 04a74db..201a6a6 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -52,7 +52,7 @@ public: static void GetDocumentation(cmDocumentationEntry& entry); /** - * Try to determine system infomation such as shared library + * Try to determine system information such as shared library * extension, pthreads, byte order etc. */ virtual void EnableLanguage(std::vector<std::string>const& languages, diff --git a/Source/cmGlobalVisualStudio9Generator.h b/Source/cmGlobalVisualStudio9Generator.h index c24d5fe..0a191cd 100644 --- a/Source/cmGlobalVisualStudio9Generator.h +++ b/Source/cmGlobalVisualStudio9Generator.h @@ -32,7 +32,7 @@ public: virtual cmLocalGenerator *CreateLocalGenerator(); /** - * Try to determine system infomation such as shared library + * Try to determine system information such as shared library * extension, pthreads, byte order etc. */ virtual void WriteSLNHeader(std::ostream& fout); diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h index 2057a42..0e577b5 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.h +++ b/Source/cmGlobalWatcomWMakeGenerator.h @@ -38,7 +38,7 @@ public: virtual cmLocalGenerator *CreateLocalGenerator(); /** - * Try to determine system infomation such as shared library + * Try to determine system information such as shared library * extension, pthreads, byte order etc. */ virtual void EnableLanguage(std::vector<std::string>const& languages, diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index 4fe04fc..9d7b784 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -44,7 +44,7 @@ public: virtual cmLocalGenerator *CreateLocalGenerator(); /** - * Try to determine system infomation such as shared library + * Try to determine system information such as shared library * extension, pthreads, byte order etc. */ virtual void EnableLanguage(std::vector<std::string>const& languages, diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 8806205..0bd1624 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4476,7 +4476,7 @@ void cmMakefile::RaiseScope(const std::string& var, const char *varDef) if(cmDefinitions* up = cur.GetParent()) { // First localize the definition in the current scope. - cur.Pull(var); + cur.Get(var); // Now update the definition in the parent scope. up->Set(var, varDef); diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 26fc317..1ac13cf 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -326,9 +326,9 @@ void cmVisualStudio10TargetGenerator::Generate() this->WriteString("<PropertyGroup Label=\"NsightTegraProject\">\n", 1); if(this->NsightTegraVersion[0] >= 2) { - // Nsight Tegra 2.0 uses project revision 8. + // Nsight Tegra 2.0 uses project revision 9. this->WriteString("<NsightTegraProjectRevisionNumber>" - "8" + "9" "</NsightTegraProjectRevisionNumber>\n", 2); // Tell newer versions to upgrade silently when loading. this->WriteString("<NsightTegraUpgradeOnceWithoutPrompt>" @@ -2036,7 +2036,8 @@ WriteMasmOptions(std::string const& configName, void cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config) { - if(this->Target->GetType() != cmTarget::STATIC_LIBRARY) + if(this->Target->GetType() != cmTarget::STATIC_LIBRARY && + this->Target->GetType() != cmTarget::OBJECT_LIBRARY) { return; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 09d270d..36a0645 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1403,7 +1403,7 @@ int cmake::ActualConfigure() {"10.0", "Visual Studio 10 2010"}, {"11.0", "Visual Studio 11 2012"}, {"12.0", "Visual Studio 12 2013"}, - {"14.0", "Visual Studio 14"}, + {"14.0", "Visual Studio 14 2015"}, {0, 0}}; for(int i=0; version[i].MSVersion != 0; i++) { diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index 8ca4360..2067690 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -265,7 +265,7 @@ STRING(COMPARE EQUAL "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}" KWSYS_IN_SOURCE_BUILD) IF(NOT KWSYS_IN_SOURCE_BUILD) CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/kwsysPrivate.h - ${PROJECT_BINARY_DIR}/kwsysPrivate.h COPY_ONLY IMMEDIATE) + ${PROJECT_BINARY_DIR}/kwsysPrivate.h COPYONLY IMMEDIATE) ENDIF(NOT KWSYS_IN_SOURCE_BUILD) # Select plugin module file name convention. diff --git a/Source/kwsys/SharedForward.h.in b/Source/kwsys/SharedForward.h.in index 7ff29b4..c6f345f 100644 --- a/Source/kwsys/SharedForward.h.in +++ b/Source/kwsys/SharedForward.h.in @@ -813,7 +813,7 @@ static void kwsys_shared_forward_print_failure(char const* const* argv) } /* Static storage space to store the updated environment variable. */ -static char kwsys_shared_forward_ldpath[KWSYS_SHARED_FORWARD_MAXPATH*16] = KWSYS_SHARED_FORWARD_LDPATH "="; +static char kwsys_shared_forward_ldpath[65535] = KWSYS_SHARED_FORWARD_LDPATH "="; /*--------------------------------------------------------------------------*/ /* Main driver function to be called from main. */ diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index 84b5f39..c4aeb47 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -3913,7 +3913,7 @@ bool SystemInformationImplementation::QueryCygwinMemory() bool SystemInformationImplementation::QueryAIXMemory() { -#if defined(_AIX) +#if defined(_AIX) && defined(_SC_AIX_REALMEM) long c = sysconf(_SC_AIX_REALMEM); if (c <= 0) { diff --git a/Tests/Dependency/CMakeLists.txt b/Tests/Dependency/CMakeLists.txt index ef42048..ebc2d10 100644 --- a/Tests/Dependency/CMakeLists.txt +++ b/Tests/Dependency/CMakeLists.txt @@ -51,3 +51,4 @@ add_subdirectory(Case1) add_subdirectory(Case2) add_subdirectory(Case3) add_subdirectory(Case4) +add_subdirectory(Case5) diff --git a/Tests/Dependency/Case5/CMakeLists.txt b/Tests/Dependency/Case5/CMakeLists.txt new file mode 100644 index 0000000..e954b02 --- /dev/null +++ b/Tests/Dependency/Case5/CMakeLists.txt @@ -0,0 +1,8 @@ +project(CASE5 C) + +add_library(case5Foo SHARED foo.c) +add_library(case5Bar STATIC bar.c) +target_link_libraries(case5Bar case5Foo) + +add_executable(case5 main.c) +target_link_libraries(case5 case5Foo case5Bar) diff --git a/Tests/Dependency/Case5/bar.c b/Tests/Dependency/Case5/bar.c new file mode 100644 index 0000000..4cb1b1b --- /dev/null +++ b/Tests/Dependency/Case5/bar.c @@ -0,0 +1,12 @@ +#ifdef _WIN32 +__declspec(dllimport) +#endif +void foo(void); + +#include <stdio.h> + +void bar(void) +{ + foo(); + printf("bar()\n"); +} diff --git a/Tests/Dependency/Case5/foo.c b/Tests/Dependency/Case5/foo.c new file mode 100644 index 0000000..794833d --- /dev/null +++ b/Tests/Dependency/Case5/foo.c @@ -0,0 +1,9 @@ +#include <stdio.h> + +#ifdef _WIN32 +__declspec(dllexport) +#endif +void foo(void) +{ + printf("foo()\n"); +} diff --git a/Tests/Dependency/Case5/main.c b/Tests/Dependency/Case5/main.c new file mode 100644 index 0000000..ae3dc95 --- /dev/null +++ b/Tests/Dependency/Case5/main.c @@ -0,0 +1,7 @@ +void bar(void); + +int main(int argc, char *argv[]) +{ + bar(); + return 0; +} diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index 2f74121..d2fa86a 100644 --- a/Tests/ExternalProject/CMakeLists.txt +++ b/Tests/ExternalProject/CMakeLists.txt @@ -372,6 +372,13 @@ if(HG_EXECUTABLE) set(do_hg_tests 1) endif() +if(do_hg_tests AND NOT UNIX) + if("${HG_EXECUTABLE}" MATCHES "cygwin") + message(STATUS "No ExternalProject hg tests with cygwin hg outside cygwin!") + set(do_hg_tests 0) + endif() +endif() + if(do_hg_tests) set(local_hg_repo "../../LocalRepositories/HG") diff --git a/Tests/RunCMake/set/ParentPulling-stderr.txt b/Tests/RunCMake/set/ParentPulling-stderr.txt new file mode 100644 index 0000000..768549b --- /dev/null +++ b/Tests/RunCMake/set/ParentPulling-stderr.txt @@ -0,0 +1,3 @@ +^before PARENT_SCOPE blah=value2 +after PARENT_SCOPE blah=value2 +in parent scope, blah=value2$ diff --git a/Tests/RunCMake/set/ParentPulling.cmake b/Tests/RunCMake/set/ParentPulling.cmake new file mode 100644 index 0000000..2614533 --- /dev/null +++ b/Tests/RunCMake/set/ParentPulling.cmake @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.0) +project(Minimal NONE) + +function(test_set) + set(blah "value2") + message("before PARENT_SCOPE blah=${blah}") + set(blah ${blah} PARENT_SCOPE) + message("after PARENT_SCOPE blah=${blah}") +endfunction() + +set(blah value1) +test_set() +message("in parent scope, blah=${blah}") diff --git a/Tests/RunCMake/set/ParentPullingRecursive-stderr.txt b/Tests/RunCMake/set/ParentPullingRecursive-stderr.txt new file mode 100644 index 0000000..f3260ae --- /dev/null +++ b/Tests/RunCMake/set/ParentPullingRecursive-stderr.txt @@ -0,0 +1,144 @@ +---------- +variable values at top before calls: +top_implicit_inner_set: -->top<-- +top_implicit_inner_unset: <undefined> +top_explicit_inner_set: -->top<-- +top_explicit_inner_unset: <undefined> +top_explicit_inner_tounset: -->top<-- +top_implicit_outer_set: -->top<-- +top_explicit_outer_unset: <undefined> +top_explicit_outer_set: -->top<-- +top_explicit_outer_unset: <undefined> +top_explicit_outer_tounset: -->top<-- +outer_implicit_inner_set: <undefined> +outer_implicit_inner_unset: <undefined> +outer_explicit_inner_set: <undefined> +outer_explicit_inner_unset: <undefined> +outer_explicit_inner_tounset: <undefined> +---------- +---------- +variable values at outer start: +top_implicit_inner_set: -->top<-- +top_implicit_inner_unset: <undefined> +top_explicit_inner_set: -->top<-- +top_explicit_inner_unset: <undefined> +top_explicit_inner_tounset: -->top<-- +top_implicit_outer_set: -->top<-- +top_explicit_outer_unset: <undefined> +top_explicit_outer_set: -->top<-- +top_explicit_outer_unset: <undefined> +top_explicit_outer_tounset: -->top<-- +outer_implicit_inner_set: <undefined> +outer_implicit_inner_unset: <undefined> +outer_explicit_inner_set: <undefined> +outer_explicit_inner_unset: <undefined> +outer_explicit_inner_tounset: <undefined> +---------- +---------- +variable values at outer before inner: +top_implicit_inner_set: -->top<-- +top_implicit_inner_unset: <undefined> +top_explicit_inner_set: -->top<-- +top_explicit_inner_unset: <undefined> +top_explicit_inner_tounset: -->top<-- +top_implicit_outer_set: -->top<-- +top_explicit_outer_unset: <undefined> +top_explicit_outer_set: -->top<-- +top_explicit_outer_unset: <undefined> +top_explicit_outer_tounset: -->top<-- +outer_implicit_inner_set: -->outer<-- +outer_implicit_inner_unset: <undefined> +outer_explicit_inner_set: -->outer<-- +outer_explicit_inner_unset: <undefined> +outer_explicit_inner_tounset: -->outer<-- +---------- +---------- +variable values at inner start: +top_implicit_inner_set: -->top<-- +top_implicit_inner_unset: <undefined> +top_explicit_inner_set: -->top<-- +top_explicit_inner_unset: <undefined> +top_explicit_inner_tounset: -->top<-- +top_implicit_outer_set: -->top<-- +top_explicit_outer_unset: <undefined> +top_explicit_outer_set: -->top<-- +top_explicit_outer_unset: <undefined> +top_explicit_outer_tounset: -->top<-- +outer_implicit_inner_set: -->outer<-- +outer_implicit_inner_unset: <undefined> +outer_explicit_inner_set: -->outer<-- +outer_explicit_inner_unset: <undefined> +outer_explicit_inner_tounset: -->outer<-- +---------- +---------- +variable values at inner end: +top_implicit_inner_set: -->top<-- +top_implicit_inner_unset: <undefined> +top_explicit_inner_set: -->top<-- +top_explicit_inner_unset: <undefined> +top_explicit_inner_tounset: -->top<-- +top_implicit_outer_set: -->top<-- +top_explicit_outer_unset: <undefined> +top_explicit_outer_set: -->top<-- +top_explicit_outer_unset: <undefined> +top_explicit_outer_tounset: -->top<-- +outer_implicit_inner_set: -->outer<-- +outer_implicit_inner_unset: <undefined> +outer_explicit_inner_set: -->outer<-- +outer_explicit_inner_unset: <undefined> +outer_explicit_inner_tounset: -->outer<-- +---------- +---------- +variable values at outer after inner: +top_implicit_inner_set: -->top<-- +top_implicit_inner_unset: <undefined> +top_explicit_inner_set: -->inner<-- +top_explicit_inner_unset: -->inner<-- +top_explicit_inner_tounset: <undefined> +top_implicit_outer_set: -->top<-- +top_explicit_outer_unset: <undefined> +top_explicit_outer_set: -->top<-- +top_explicit_outer_unset: <undefined> +top_explicit_outer_tounset: -->top<-- +outer_implicit_inner_set: -->outer<-- +outer_implicit_inner_unset: <undefined> +outer_explicit_inner_set: -->inner<-- +outer_explicit_inner_unset: -->inner<-- +outer_explicit_inner_tounset: <undefined> +---------- +---------- +variable values at outer end: +top_implicit_inner_set: -->top<-- +top_implicit_inner_unset: <undefined> +top_explicit_inner_set: -->inner<-- +top_explicit_inner_unset: -->inner<-- +top_explicit_inner_tounset: <undefined> +top_implicit_outer_set: -->top<-- +top_explicit_outer_unset: <undefined> +top_explicit_outer_set: -->top<-- +top_explicit_outer_unset: <undefined> +top_explicit_outer_tounset: -->top<-- +outer_implicit_inner_set: -->outer<-- +outer_implicit_inner_unset: <undefined> +outer_explicit_inner_set: -->inner<-- +outer_explicit_inner_unset: -->inner<-- +outer_explicit_inner_tounset: <undefined> +---------- +---------- +variable values at top after calls: +top_implicit_inner_set: -->top<-- +top_implicit_inner_unset: <undefined> +top_explicit_inner_set: -->outer<-- +top_explicit_inner_unset: -->outer<-- +top_explicit_inner_tounset: <undefined> +top_implicit_outer_set: -->top<-- +top_explicit_outer_unset: -->outer<-- +top_explicit_outer_set: -->outer<-- +top_explicit_outer_unset: -->outer<-- +top_explicit_outer_tounset: <undefined> +outer_implicit_inner_set: <undefined> +outer_implicit_inner_unset: <undefined> +outer_explicit_inner_set: <undefined> +outer_explicit_inner_unset: <undefined> +outer_explicit_inner_tounset: <undefined> +---------- diff --git a/Tests/RunCMake/set/ParentPullingRecursive.cmake b/Tests/RunCMake/set/ParentPullingRecursive.cmake new file mode 100644 index 0000000..a3e29f5 --- /dev/null +++ b/Tests/RunCMake/set/ParentPullingRecursive.cmake @@ -0,0 +1,104 @@ +cmake_minimum_required(VERSION 3.0) +project(Minimal NONE) + +function(report where) + message("----------") + message("variable values at ${where}:") + foreach(var IN ITEMS + top_implicit_inner_set top_implicit_inner_unset + top_explicit_inner_set top_explicit_inner_unset top_explicit_inner_tounset + top_implicit_outer_set top_explicit_outer_unset + top_explicit_outer_set top_explicit_outer_unset top_explicit_outer_tounset + + outer_implicit_inner_set outer_implicit_inner_unset + outer_explicit_inner_set outer_explicit_inner_unset outer_explicit_inner_tounset) + if(DEFINED ${var}) + message("${var}: -->${${var}}<--") + else() + message("${var}: <undefined>") + endif() + endforeach() + message("----------") +endfunction() + +macro(set_values upscope downscope value) + # Pull the value in implicitly. + set(dummy ${${upscope}_implicit_${downscope}_set}) + set(dummy ${${upscope}_implicit_${downscope}_unset}) + # Pull it down explicitly. + set(${upscope}_explicit_${downscope}_set "${value}" PARENT_SCOPE) + set(${upscope}_explicit_${downscope}_unset "${value}" PARENT_SCOPE) + set(${upscope}_explicit_${downscope}_tounset PARENT_SCOPE) +endmacro() + +function(inner) + report("inner start") + + set_values(top inner inner) + set_values(outer inner inner) + + report("inner end") +endfunction() + +function(outer) + report("outer start") + + set_values(top outer outer) + + # Set values for inner to manipulate. + set(outer_implicit_inner_set outer) + set(outer_implicit_inner_unset) + set(outer_explicit_inner_set outer) + set(outer_explicit_inner_unset) + set(outer_explicit_inner_tounset outer) + + report("outer before inner") + + inner() + + report("outer after inner") + + # Do what inner does so that we can test the values that inner should have + # pulled through to here. + set_values(top inner outer) + + report("outer end") +endfunction() + +# variable name is: +# +# <upscope>_<pulltype>_<downscope>_<settype> +# +# where the value is the name of the scope it was set in. The scopes available +# are "top", "outer", and "inner". The pull type may either be "implicit" or +# "explicit" based on whether the pull is due to a variable dereference or a +# PARENT_SCOPE setting. The settype is "set" where both scopes set a value, +# "unset" where upscope unsets it and downscope sets it, and "tounset" where +# upscope sets it and downscope unsets it. +# +# We test the following combinations: +# +# - outer overriding top's values; +# - inner overriding top's values; +# - inner overriding outer's values; and +# - outer overriding inner's values in top after inner has run. + +# Set values for inner to manipulate. +set(top_implicit_inner_set top) +set(top_implicit_inner_unset) +set(top_explicit_inner_set top) +set(top_explicit_inner_unset) +set(top_explicit_inner_tounset top) + +# Set values for outer to manipulate. +set(top_implicit_outer_set top) +set(top_implicit_outer_unset) +set(top_explicit_outer_set top) +set(top_explicit_outer_unset) +set(top_explicit_outer_tounset top) + +report("top before calls") + +outer() + +report("top after calls") diff --git a/Tests/RunCMake/set/RunCMakeTest.cmake b/Tests/RunCMake/set/RunCMakeTest.cmake index 1b51ea2..b8e8cf1 100644 --- a/Tests/RunCMake/set/RunCMakeTest.cmake +++ b/Tests/RunCMake/set/RunCMakeTest.cmake @@ -1,3 +1,5 @@ include(RunCMake) run_cmake(ParentScope) +run_cmake(ParentPulling) +run_cmake(ParentPullingRecursive) diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py index 2629bb3..e20679a 100644 --- a/Utilities/Sphinx/cmake.py +++ b/Utilities/Sphinx/cmake.py @@ -130,8 +130,8 @@ class _cmake_index_entry: def __init__(self, desc): self.desc = desc - def __call__(self, title, targetid): - return ('pair', u'%s ; %s' % (self.desc, title), targetid, 'main') + def __call__(self, title, targetid, main = 'main'): + return ('pair', u'%s ; %s' % (self.desc, title), targetid, main) _cmake_index_objs = { 'command': _cmake_index_entry('command'), @@ -203,6 +203,7 @@ class CMakeTransform(Transform): # Insert the object link target. targetid = '%s:%s' % (objtype, title) targetnode = nodes.target('', '', ids=[targetid]) + self.document.note_explicit_target(targetnode) self.document.insert(0, targetnode) # Insert the object index entry. indexnode = addnodes.index() @@ -257,6 +258,49 @@ class CMakeXRefRole(XRefRole): break return XRefRole.__call__(self, typ, rawtext, text, *args, **keys) + # We cannot insert index nodes using the result_nodes method + # because CMakeXRefRole is processed before substitution_reference + # nodes are evaluated so target nodes (with 'ids' fields) would be + # duplicated in each evaluted substitution replacement. The + # docutils substitution transform does not allow this. Instead we + # use our own CMakeXRefTransform below to add index entries after + # substitutions are completed. + # + # def result_nodes(self, document, env, node, is_ref): + # pass + +class CMakeXRefTransform(Transform): + + # Run this transform early since we insert nodes we want + # treated as if they were written in the documents, but + # after the sphinx (210) and docutils (220) substitutions. + default_priority = 221 + + def apply(self): + env = self.document.settings.env + + # Find CMake cross-reference nodes and add index and target + # nodes for them. + for ref in self.document.traverse(addnodes.pending_xref): + if not ref['refdomain'] == 'cmake': + continue + + objtype = ref['reftype'] + make_index_entry = _cmake_index_objs.get(objtype) + if not make_index_entry: + continue + + objname = ref['reftarget'] + targetnum = env.new_serialno('index-%s:%s' % (objtype, objname)) + + targetid = 'index-%s-%s:%s' % (targetnum, objtype, objname) + targetnode = nodes.target('', '', ids=[targetid]) + self.document.note_explicit_target(targetnode) + + indexnode = addnodes.index() + indexnode['entries'] = [make_index_entry(objname, targetid, '')] + ref.replace_self([indexnode, targetnode, ref]) + class CMakeDomain(Domain): """CMake domain.""" name = 'cmake' @@ -336,4 +380,5 @@ class CMakeDomain(Domain): def setup(app): app.add_directive('cmake-module', CMakeModule) app.add_transform(CMakeTransform) + app.add_transform(CMakeXRefTransform) app.add_domain(CMakeDomain) diff --git a/Utilities/Sphinx/conf.py.in b/Utilities/Sphinx/conf.py.in index d81bbcf..eb24a6e 100644 --- a/Utilities/Sphinx/conf.py.in +++ b/Utilities/Sphinx/conf.py.in @@ -31,6 +31,8 @@ exclude_patterns = [] extensions = ['cmake'] templates_path = ['@conf_path@/templates'] +nitpicky = True + cmake_manuals = sorted(glob.glob(r'@conf_docs@/manual/*.rst')) cmake_manual_description = re.compile('^\.\. cmake-manual-description:(.*)$') man_pages = [] @@ -60,7 +62,7 @@ html_style = 'cmake.css' html_theme = 'default' html_title = 'CMake %s Documentation' % release html_short_title = '%s Documentation' % release -html_favicon = 'cmake-favicon.ico' +html_favicon = '@conf_path@/static/cmake-favicon.ico' # Not supported yet by sphinx: # https://bitbucket.org/birkenfeld/sphinx/issue/1448/make-qthelp-more-configurable # qthelp_namespace = "org.cmake" diff --git a/Utilities/Sphinx/create_identifiers.py b/Utilities/Sphinx/create_identifiers.py index 7715e53..3fe3fcb 100755 --- a/Utilities/Sphinx/create_identifiers.py +++ b/Utilities/Sphinx/create_identifiers.py @@ -34,7 +34,7 @@ for line in lines: for domain_object_string, domain_object_type in mapping: if "<keyword name=\"" + domain_object_string + "\"" in line: - if not "id=\"" in line: + if not "id=\"" in line and not "#index-" in line: prefix = "<keyword name=\"" + domain_object_string + "\" " part1, part2 = line.split(prefix) head, tail = part2.split("#" + domain_object_type + ":") diff --git a/Utilities/cmlibarchive/libarchive/archive_write_add_filter_lzop.c b/Utilities/cmlibarchive/libarchive/archive_write_add_filter_lzop.c index 088ecea..c666551 100644 --- a/Utilities/cmlibarchive/libarchive/archive_write_add_filter_lzop.c +++ b/Utilities/cmlibarchive/libarchive/archive_write_add_filter_lzop.c @@ -85,7 +85,7 @@ static int archive_write_lzop_free(struct archive_write_filter *); #if defined(HAVE_LZO_LZOCONF_H) && defined(HAVE_LZO_LZO1X_H) /* Maximum block size. */ #define BLOCK_SIZE (256 * 1024) -/* Block infomation is composed of uncompressed size(4 bytes), +/* Block information is composed of uncompressed size(4 bytes), * compressed size(4 bytes) and the checksum of uncompressed data(4 bytes) * in this lzop writer. */ #define BLOCK_INfO_SIZE 12 diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_mtree.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_mtree.c index 4d343ea..b0c8018 100644 --- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_mtree.c +++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_mtree.c @@ -1115,7 +1115,7 @@ write_mtree_entry_tree(struct archive_write *a) do { if (mtree->output_global_set) { /* - * Collect attribute infomation to know which value + * Collect attribute information to know which value * is frequently used among the children. */ attr_counter_set_reset(mtree); @@ -122,17 +122,32 @@ else cmake_system_openvms=false fi +# Determine whether this is HP-UX +if echo "${cmake_system}" | grep HP-UX >/dev/null 2>&1; then + cmake_system_hpux=true +else + cmake_system_hpux=false +fi + # Determine whether this is Linux if echo "${cmake_system}" | grep Linux >/dev/null 2>&1; then cmake_system_linux=true - # find out if it is a HP PA-RISC machine +else + cmake_system_linux=false + fi + +# Determine whether this is a PA-RISC machine +# This only works for Linux or HP-UX, not other PA-RISC OSs (BSD maybe?). Also +# may falsely detect parisc on HP-UX m68k +cmake_machine_parisc=false +if ${cmake_system_linux}; then if uname -m | grep parisc >/dev/null 2>&1; then cmake_machine_parisc=true - else - cmake_machine_parisc=false fi -else - cmake_system_linux=false +elif ${cmake_system_hpux}; then + if !(uname -m | grep ia64 >/dev/null 2>&1); then + cmake_machine_parisc=true + fi fi # Choose the generator to use for bootstrapping. @@ -744,11 +759,13 @@ if ${cmake_system_haiku}; then cmake_ld_flags="${LDFLAGS} -lroot -lbe" fi -if ${cmake_system_linux}; then - # avoid binutils problem with large binaries, e.g. when building CMake in debug mode - # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50230 - if ${cmake_machine_parisc}; then - cmake_ld_flags="${LDFLAGS} -Wl,--unique=.text._*" +# Workaround for short jump tables on PA-RISC +if ${cmake_machine_parisc}; then + if ${cmake_c_compiler_is_gnu}; then + cmake_c_flags="${CFLAGS} -mlong-calls" + fi + if ${cmake_cxx_compiler_is_gnu}; then + cmake_cxx_flags="${CXXFLAGS} -mlong-calls" fi fi |