summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy6
-rw-r--r--Help/dev/documentation.rst84
-rw-r--r--Help/manual/cmake-developer.7.rst93
-rw-r--r--Help/release/dev/FindGIF-modernize.rst4
-rw-r--r--Modules/FindBLAS.cmake107
-rw-r--r--Modules/FindBoost.cmake11
-rw-r--r--Modules/FindGIF.cmake60
-rw-r--r--Modules/FindLAPACK.cmake156
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx4
-rw-r--r--Source/Checks/cm_cxx_features.cmake2
-rw-r--r--Source/LexerParser/cmFortranLexer.cxx226
-rw-r--r--Source/LexerParser/cmFortranLexer.in.l2
-rw-r--r--Source/QtDialog/AddCacheEntry.cxx4
-rw-r--r--Source/QtDialog/CMakeLists.txt11
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx24
-rw-r--r--Source/QtDialog/CMakeSetupDialog.h8
-rw-r--r--Source/cmELF.cxx2
-rw-r--r--Source/cmExportFileGenerator.cxx2
-rw-r--r--Source/cmFileCommand.cxx9
-rw-r--r--Source/cmForEachCommand.cxx2
-rw-r--r--Source/cmGeneratorTarget.cxx3
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx6
-rw-r--r--Source/cmGlobalVisualStudio14Generator.cxx38
-rw-r--r--Source/cmIfCommand.cxx2
-rw-r--r--Source/cmMakefile.cxx2
-rw-r--r--Source/cmWhileCommand.cxx2
-rw-r--r--Source/cmake.cxx2
-rw-r--r--Tests/CMakeLists.txt4
-rw-r--r--Tests/FindBoost/Test/CMakeLists.txt3
-rw-r--r--Tests/FindBoost/Test/main.cxx17
-rw-r--r--Tests/FindGIF/CMakeLists.txt10
-rw-r--r--Tests/FindGIF/Test/CMakeLists.txt16
-rw-r--r--Tests/FindGIF/Test/main.c35
-rw-r--r--Tests/FortranModules/Submodules/child.f906
-rw-r--r--Tests/RunCMake/FindBoost/NoCXX-stderr.txt1
-rw-r--r--Tests/RunCMake/FindBoost/NoCXX.cmake1
-rw-r--r--Tests/RunCMake/FindBoost/RunCMakeTest.cmake1
38 files changed, 596 insertions, 372 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 8d79b0c..0ba4b0b 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -1,5 +1,8 @@
---
Checks: "-*,\
+bugprone-*,\
+-bugprone-macro-parentheses,\
+-bugprone-misplaced-widening-cast,\
google-readability-casting,\
misc-*,\
-misc-incorrect-roundings,\
@@ -21,15 +24,18 @@ modernize-*,\
-modernize-use-using,\
performance-*,\
-performance-inefficient-string-concatenation,\
+-performance-inefficient-vector-operation,\
readability-*,\
-readability-function-size,\
-readability-identifier-naming,\
-readability-implicit-bool-cast,\
+-readability-implicit-bool-conversion,\
-readability-inconsistent-declaration-parameter-name,\
-readability-named-parameter,\
-readability-redundant-declaration,\
-readability-redundant-member-init,\
-readability-simplify-boolean-expr,\
+-readability-static-accessed-through-instance,\
"
HeaderFilterRegex: 'Source/cm[^/]*\.(h|hxx|cxx)$'
...
diff --git a/Help/dev/documentation.rst b/Help/dev/documentation.rst
index 1b2c942..c302790 100644
--- a/Help/dev/documentation.rst
+++ b/Help/dev/documentation.rst
@@ -458,32 +458,22 @@ reStructuredText markup from comment blocks that start in ``.rst:``.
At the top of ``Modules/<module-name>.cmake``, begin with the following
license notice:
-.. code-block:: cmake
+::
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
After this notice, add a *BLANK* line. Then, add documentation using
-a `Line Comment`_ block of the form:
-
-.. code-block:: cmake
-
- #.rst:
- # <module-name>
- # -------------
- #
- # <reStructuredText documentation of module>
-
-or a `Bracket Comment`_ of the form:
+a `Bracket Comment`_ of the form:
::
- #[[.rst:
- <module-name>
- -------------
+ #[=======================================================================[.rst:
+ <module-name>
+ -------------
- <reStructuredText documentation of module>
- #]]
+ <reStructuredText documentation of module>
+ #]=======================================================================]
Any number of ``=`` may be used in the opening and closing brackets
as long as they match. Content on the line containing the closing
@@ -496,35 +486,38 @@ For example, a ``Findxxx.cmake`` module may contain:
::
- # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- # file Copyright.txt or https://cmake.org/licensing for details.
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ # file Copyright.txt or https://cmake.org/licensing for details.
+
+ #[=======================================================================[.rst:
+ FindXxx
+ -------
+
+ This is a cool module.
+ This module does really cool stuff.
+ It can do even more than you think.
+
+ It even needs two paragraphs to tell you about it.
+ And it defines the following variables:
+
+ ``VAR_COOL``
+ this is great isn't it?
+ ``VAR_REALLY_COOL``
+ cool right?
+ #]=======================================================================]
+
+ <code>
+
+ #[=======================================================================[.rst:
+ .. command:: xxx_do_something
+
+ This command does something for Xxx::
- #.rst:
- # FindXxx
- # -------
- #
- # This is a cool module.
- # This module does really cool stuff.
- # It can do even more than you think.
- #
- # It even needs two paragraphs to tell you about it.
- # And it defines the following variables:
- #
- # * VAR_COOL: this is great isn't it?
- # * VAR_REALLY_COOL: cool right?
-
- <code>
-
- #[========================================[.rst:
- .. command:: xxx_do_something
-
- This command does something for Xxx::
-
- xxx_do_something(some arguments)
- #]========================================]
- macro(xxx_do_something)
- <code>
- endmacro()
+ xxx_do_something(some arguments)
+ #]=======================================================================]
+ macro(xxx_do_something)
+ <code>
+ endmacro()
Test the documentation formatting by running
``cmake --help-module <module-name>``, and also by enabling the
@@ -534,5 +527,4 @@ have a .cmake file in this directory NOT show up in the modules
documentation, simply leave out the ``Help/module/<module-name>.rst``
file and the ``Help/manual/cmake-modules.7.rst`` toctree entry.
-.. _`Line Comment`: https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#line-comment
.. _`Bracket Comment`: https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#bracket-comment
diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst
index b949464..85ed935 100644
--- a/Help/manual/cmake-developer.7.rst
+++ b/Help/manual/cmake-developer.7.rst
@@ -196,49 +196,78 @@ them.
A Sample Find Module
--------------------
-We will describe how to create a simple find module for a library
-``Foo``.
+We will describe how to create a simple find module for a library ``Foo``.
-The first thing that is needed is a license notice.
+The top of the module should begin with a license notice, followed by
+a blank line, and then followed by a :ref:`Bracket Comment`. The comment
+should begin with ``.rst:`` to indicate that the rest of its content is
+reStructuredText-format documentation. For example:
-.. code-block:: cmake
+::
- # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- # file Copyright.txt or https://cmake.org/licensing for details.
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ # file Copyright.txt or https://cmake.org/licensing for details.
-Next we need module documentation. CMake's documentation system requires you
-to follow the license notice with a blank line and then with a documentation
-marker and the name of the module. You should follow this with a simple
-statement of what the module does.
+ #[=======================================================================[.rst:
+ FindFoo
+ -------
-.. code-block:: cmake
+ Finds the Foo library.
- #.rst:
- # FindFoo
- # -------
- #
- # Finds the Foo library
- #
+ Imported Targets
+ ^^^^^^^^^^^^^^^^
-More description may be required for some packages. If there are
-caveats or other details users of the module should be aware of, you can
-add further paragraphs below this. Then you need to document what
-variables and imported targets are set by the module, such as
+ This module provides the following imported targets, if found:
-.. code-block:: cmake
+ ``Foo::Foo``
+ The Foo library
+
+ Result Variables
+ ^^^^^^^^^^^^^^^^
+
+ This will define the following variables:
+
+ ``Foo_FOUND``
+ True if the system has the Foo library.
+ ``Foo_VERSION``
+ The version of the Foo library which was found.
+ ``Foo_INCLUDE_DIRS``
+ Include directories needed to use Foo.
+ ``Foo_LIBRARIES``
+ Libraries needed to link to Foo.
+
+ Cache Variables
+ ^^^^^^^^^^^^^^^
+
+ The following cache variables may also be set:
+
+ ``Foo_INCLUDE_DIR``
+ The directory containing ``foo.h``.
+ ``Foo_LIBRARY``
+ The path to the Foo library.
+
+ #]=======================================================================]
+
+The module documentation consists of:
+
+* An underlined heading specifying the module name.
+
+* A simple description of what the module finds.
+ More description may be required for some packages. If there are
+ caveats or other details users of the module should be aware of,
+ specify them here.
+
+* A section listing imported targets provided by the module, if any.
+
+* A section listing result variables provided by the module.
- # This will define the following variables::
- #
- # Foo_FOUND - True if the system has the Foo library
- # Foo_VERSION - The version of the Foo library which was found
- #
- # and the following imported targets::
- #
- # Foo::Foo - The Foo library
+* Optionally a section listing cache variables used by the module, if any.
-If the package provides any macros, they should be listed here, but can
-be documented where they are defined.
+If the package provides any macros or functions, they should be listed in
+an additional section, but can be documented by additional ``.rst:``
+comment blocks immediately above where those macros or functions are defined.
+The find module implementation may begin below the documentation block.
Now the actual libraries and so on have to be found. The code here will
obviously vary from module to module (dealing with that, after all, is the
point of find modules), but there tends to be a common pattern for libraries.
diff --git a/Help/release/dev/FindGIF-modernize.rst b/Help/release/dev/FindGIF-modernize.rst
new file mode 100644
index 0000000..3bb4821
--- /dev/null
+++ b/Help/release/dev/FindGIF-modernize.rst
@@ -0,0 +1,4 @@
+FindGIF-modernize
+-----------------
+
+* The :module:`FindGIF` module now provides imported targets.
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 14cc68a..b6348fd 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -127,6 +127,8 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
endif ()
endif ()
+ list(APPEND _libdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
+
foreach(_library ${_list})
set(_combined_name ${_combined_name}_${_library})
@@ -171,6 +173,8 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
if(_libraries_work)
if("${_list}" STREQUAL "")
set(${LIBRARIES} "${LIBRARIES}-PLACEHOLDER-FOR-EMPTY-LIBRARIES")
+ else()
+ set(${LIBRARIES} ${${LIBRARIES}} ${_thread}) # for static link
endif()
else()
set(${LIBRARIES} FALSE)
@@ -206,14 +210,34 @@ endif ()
#BLAS in intel mkl 10+ library? (em64t 64bit)
if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
if (NOT BLAS_LIBRARIES)
+
+ # System-specific settings
+ if (WIN32)
+ if (BLA_STATIC)
+ set(BLAS_mkl_DLL_SUFFIX "")
+ else()
+ set(BLAS_mkl_DLL_SUFFIX "_dll")
+ endif()
+ else()
+ if(CMAKE_Fortran_COMPILER_LOADED AND CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
+ set(BLAS_mkl_INTFACE "gf")
+ set(BLAS_mkl_THREADING "gnu")
+ set(BLAS_mkl_OMP "gomp")
+ else()
+ set(BLAS_mkl_INTFACE "intel")
+ set(BLAS_mkl_THREADING "intel")
+ set(BLAS_mkl_OMP "iomp5")
+ endif()
+ set(BLAS_mkl_LM "-lm")
+ set(BLAS_mkl_LDL "-ldl")
+ endif()
+
if (BLA_VENDOR MATCHES "_64ilp")
set(BLAS_mkl_ILP_MODE "ilp64")
else ()
set(BLAS_mkl_ILP_MODE "lp64")
endif ()
- if (NOT WIN32)
- set(LM "-lm")
- endif ()
+
if (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED)
if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
find_package(Threads)
@@ -227,12 +251,6 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
set(BLAS_mkl_SEARCH_SYMBOL sgemm_f95)
set(_LIBRARIES BLAS95_LIBRARIES)
if (WIN32)
- if (BLA_STATIC)
- set(BLAS_mkl_DLL_SUFFIX "")
- else()
- set(BLAS_mkl_DLL_SUFFIX "_dll")
- endif()
-
# Find the main file (32-bit or 64-bit)
set(BLAS_SEARCH_LIBS_WIN_MAIN "")
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
@@ -268,38 +286,32 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
endforeach()
else ()
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
+ # old version
+ list(APPEND BLAS_SEARCH_LIBS
+ "mkl_blas95 mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core guide")
+
+ # mkl >= 10.3
list(APPEND BLAS_SEARCH_LIBS
- "mkl_blas95 mkl_intel mkl_intel_thread mkl_core guide")
+ "mkl_blas95 mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_OMP}")
endif ()
if (BLA_VENDOR MATCHES "^Intel10_64i?lp$" OR BLA_VENDOR STREQUAL "All")
# old version
list(APPEND BLAS_SEARCH_LIBS
- "mkl_blas95 mkl_intel_${BLAS_mkl_ILP_MODE} mkl_intel_thread mkl_core guide")
+ "mkl_blas95 mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core guide")
# mkl >= 10.3
- if (CMAKE_C_COMPILER MATCHES ".+gcc")
- list(APPEND BLAS_SEARCH_LIBS
- "mkl_blas95_${BLAS_mkl_ILP_MODE} mkl_intel_${BLAS_mkl_ILP_MODE} mkl_gnu_thread mkl_core gomp")
- else ()
- list(APPEND BLAS_SEARCH_LIBS
- "mkl_blas95_${BLAS_mkl_ILP_MODE} mkl_intel_${BLAS_mkl_ILP_MODE} mkl_intel_thread mkl_core iomp5")
- endif ()
+ list(APPEND BLAS_SEARCH_LIBS
+ "mkl_blas95_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_OMP}")
endif ()
if (BLA_VENDOR MATCHES "^Intel10_64i?lp_seq$" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
- "mkl_blas95_${BLAS_mkl_ILP_MODE} mkl_intel_${BLAS_mkl_ILP_MODE} mkl_sequential mkl_core")
+ "mkl_blas95_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_sequential mkl_core")
endif ()
endif ()
else ()
set(BLAS_mkl_SEARCH_SYMBOL sgemm)
set(_LIBRARIES BLAS_LIBRARIES)
if (WIN32)
- if (BLA_STATIC)
- set(BLAS_mkl_DLL_SUFFIX "")
- else()
- set(BLAS_mkl_DLL_SUFFIX "_dll")
- endif()
-
# Find the main file (32-bit or 64-bit)
set(BLAS_SEARCH_LIBS_WIN_MAIN "")
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
@@ -335,27 +347,26 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
endforeach()
else ()
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
+ # old version
+ list(APPEND BLAS_SEARCH_LIBS
+ "mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core guide")
+
+ # mkl >= 10.3
list(APPEND BLAS_SEARCH_LIBS
- "mkl_intel mkl_intel_thread mkl_core guide")
+ "mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_OMP}")
endif ()
if (BLA_VENDOR MATCHES "^Intel10_64i?lp$" OR BLA_VENDOR STREQUAL "All")
-
# old version
list(APPEND BLAS_SEARCH_LIBS
- "mkl_intel_${BLAS_mkl_ILP_MODE} mkl_intel_thread mkl_core guide")
+ "mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core guide")
# mkl >= 10.3
- if (CMAKE_C_COMPILER MATCHES ".+gcc")
- list(APPEND BLAS_SEARCH_LIBS
- "mkl_intel_${BLAS_mkl_ILP_MODE} mkl_gnu_thread mkl_core gomp")
- else ()
- list(APPEND BLAS_SEARCH_LIBS
- "mkl_intel_${BLAS_mkl_ILP_MODE} mkl_intel_thread mkl_core iomp5")
- endif ()
+ list(APPEND BLAS_SEARCH_LIBS
+ "mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_OMP}")
endif ()
if (BLA_VENDOR MATCHES "^Intel10_64i?lp_seq$" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
- "mkl_intel_${BLAS_mkl_ILP_MODE} mkl_sequential mkl_core")
+ "mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_sequential mkl_core")
endif ()
#older vesions of intel mkl libs
@@ -379,16 +390,30 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
${BLAS_mkl_SEARCH_SYMBOL}
""
"${SEARCH_LIBS}"
- "${CMAKE_THREAD_LIBS_INIT};${LM}"
+ "${CMAKE_THREAD_LIBS_INIT};${BLAS_mkl_LM};${BLAS_mkl_LDL}"
)
endif ()
endforeach ()
endif ()
unset(BLAS_mkl_ILP_MODE)
+ unset(BLAS_mkl_INTFACE)
+ unset(BLAS_mkl_THREADING)
+ unset(BLAS_mkl_OMP)
+ unset(BLAS_mkl_DLL_SUFFIX)
+ unset(BLAS_mkl_LM)
+ unset(BLAS_mkl_LDL)
endif ()
endif ()
+if(BLA_F95)
+ find_package_handle_standard_args(BLAS REQUIRED_VARS BLAS95_LIBRARIES)
+ set(BLAS95_FOUND ${BLAS_FOUND})
+ if(BLAS_FOUND)
+ set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}")
+ endif()
+endif()
+
if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
# gotoblas (http://www.tacc.utexas.edu/tacc-projects/gotoblas2)
@@ -724,13 +749,7 @@ if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
endif()
endif ()
-if(BLA_F95)
- find_package_handle_standard_args(BLAS REQUIRED_VARS BLAS95_LIBRARIES)
- set(BLAS95_FOUND ${BLAS_FOUND})
- if(BLAS_FOUND)
- set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}")
- endif()
-else()
+if(NOT BLA_F95)
find_package_handle_standard_args(BLAS REQUIRED_VARS BLAS_LIBRARIES)
endif()
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index ccd245b..ce307fa 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -35,6 +35,7 @@ case results are reported in variables::
Boost_MAJOR_VERSION - Boost major version number (X in X.y.z)
Boost_MINOR_VERSION - Boost minor version number (Y in x.Y.z)
Boost_SUBMINOR_VERSION - Boost subminor version number (Z in x.y.Z)
+ Boost_VERSION_STRING - Boost version number in x.y.z format
Boost_LIB_DIAGNOSTIC_DEFINITIONS (Windows)
- Pass to add_definitions() to have diagnostic
information about Boost's automatic linking
@@ -410,15 +411,12 @@ endmacro()
#-------------------------------------------------------------------------------
-#
-# Runs compiler with "-dumpversion" and parses major/minor
-# version with a regex.
-#
+# Convert CMAKE_CXX_COMPILER_VERSION to boost compiler suffix version.
function(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION _OUTPUT_VERSION_MAJOR _OUTPUT_VERSION_MINOR)
string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\1"
- _boost_COMPILER_VERSION_MAJOR ${CMAKE_CXX_COMPILER_VERSION})
+ _boost_COMPILER_VERSION_MAJOR "${CMAKE_CXX_COMPILER_VERSION}")
string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\2"
- _boost_COMPILER_VERSION_MINOR ${CMAKE_CXX_COMPILER_VERSION})
+ _boost_COMPILER_VERSION_MINOR "${CMAKE_CXX_COMPILER_VERSION}")
set(_boost_COMPILER_VERSION "${_boost_COMPILER_VERSION_MAJOR}${_boost_COMPILER_VERSION_MINOR}")
@@ -1371,6 +1369,7 @@ if(Boost_INCLUDE_DIR)
math(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000")
math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
+ set(Boost_VERSION_STRING "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
string(APPEND Boost_ERROR_REASON
"Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}")
diff --git a/Modules/FindGIF.cmake b/Modules/FindGIF.cmake
index 9a995af..9687b57 100644
--- a/Modules/FindGIF.cmake
+++ b/Modules/FindGIF.cmake
@@ -7,22 +7,43 @@ FindGIF
This finds the GIF library (giflib)
-The module defines the following variables:
+Imported targets
+^^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` target:
+
+``GIF::GIF``
+ The giflib library, if found.
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
``GIF_FOUND``
- True if giflib was found
+ If false, do not try to use GIF.
+``GIF_INCLUDE_DIRS``
+ where to find gif_lib.h, etc.
``GIF_LIBRARIES``
- Libraries to link to in order to use giflib
-``GIF_INCLUDE_DIR``
- where to find the headers
+ the libraries needed to use GIF.
``GIF_VERSION``
- 3, 4 or a full version string (eg 5.1.4) for versions >= 4.1.6
+ 3, 4 or a full version string (eg 5.1.4) for versions >= 4.1.6.
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
-The minimum required version of giflib can be specified using the
-standard syntax, e.g. find_package(GIF 4)
+``GIF_INCLUDE_DIR``
+ where to find the GIF headers.
+``GIF_LIBRARY``
+ where to find the GIF library.
+
+Hints
+^^^^^
-$GIF_DIR is an environment variable that would correspond to the
-./configure --prefix=$GIF_DIR
+``GIF_DIR`` is an environment variable that would correspond to the
+``./configure --prefix=$GIF_DIR``.
#]=======================================================================]
# Created by Eric Wing.
@@ -44,9 +65,6 @@ find_library(GIF_LIBRARY
PATH_SUFFIXES lib
)
-# see readme.txt
-set(GIF_LIBRARIES ${GIF_LIBRARY})
-
# Very basic version detection.
# The GIF_LIB_VERSION string in gif_lib.h seems to be unreliable, since it seems
# to be always " Version 2.0, " in versions 3.x of giflib.
@@ -90,4 +108,20 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GIF REQUIRED_VARS GIF_LIBRARY GIF_INCLUDE_DIR
VERSION_VAR GIF_VERSION )
+if(GIF_FOUND)
+ set(GIF_INCLUDE_DIRS "${GIF_INCLUDE_DIR}")
+ set(GIF_LIBRARIES ${GIF_LIBRARY})
+
+ if(NOT TARGET GIF::GIF)
+ add_library(GIF::GIF UNKNOWN IMPORTED)
+ set_target_properties(GIF::GIF PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${GIF_INCLUDE_DIRS}")
+ if(EXISTS "${GIF_LIBRARY}")
+ set_target_properties(GIF::GIF PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ IMPORTED_LOCATION "${GIF_LIBRARY}")
+ endif()
+ endif()
+endif()
+
mark_as_advanced(GIF_INCLUDE_DIR GIF_LIBRARY)
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index 62ff94c..7619664 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -96,6 +96,9 @@ if (NOT _libdir)
set(_libdir ENV LD_LIBRARY_PATH)
endif ()
endif ()
+
+list(APPEND _libdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
+
foreach(_library ${_list})
set(_combined_name ${_combined_name}_${_library})
@@ -175,6 +178,84 @@ if(BLAS_FOUND)
endif()
endif ()
+#intel lapack
+if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
+ if (NOT WIN32)
+ set(LAPACK_mkl_LM "-lm")
+ set(LAPACK_mkl_LDL "-ldl")
+ endif ()
+ if (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED)
+ if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
+ find_PACKAGE(Threads)
+ else()
+ find_package(Threads REQUIRED)
+ endif()
+
+ if (BLA_VENDOR MATCHES "_64ilp")
+ set(LAPACK_mkl_ILP_MODE "ilp64")
+ else ()
+ set(LAPACK_mkl_ILP_MODE "lp64")
+ endif ()
+
+ set(LAPACK_SEARCH_LIBS "")
+
+ if (BLA_F95)
+ set(LAPACK_mkl_SEARCH_SYMBOL "cheev_f95")
+ set(_LIBRARIES LAPACK95_LIBRARIES)
+ set(_BLAS_LIBRARIES ${BLAS95_LIBRARIES})
+
+ # old
+ list(APPEND LAPACK_SEARCH_LIBS
+ "mkl_lapack95")
+ # new >= 10.3
+ list(APPEND LAPACK_SEARCH_LIBS
+ "mkl_intel_c")
+ list(APPEND LAPACK_SEARCH_LIBS
+ "mkl_lapack95_${LAPACK_mkl_ILP_MODE}")
+ else()
+ set(LAPACK_mkl_SEARCH_SYMBOL "cheev")
+ set(_LIBRARIES LAPACK_LIBRARIES)
+ set(_BLAS_LIBRARIES ${BLAS_LIBRARIES})
+
+ # old
+ list(APPEND LAPACK_SEARCH_LIBS
+ "mkl_lapack")
+ endif()
+
+ # First try empty lapack libs
+ if (NOT ${_LIBRARIES})
+ check_lapack_libraries(
+ ${_LIBRARIES}
+ LAPACK
+ ${LAPACK_mkl_SEARCH_SYMBOL}
+ ""
+ ""
+ "${_BLAS_LIBRARIES}"
+ ""
+ )
+ endif ()
+ # Then try the search libs
+ foreach (IT ${LAPACK_SEARCH_LIBS})
+ if (NOT ${_LIBRARIES})
+ check_lapack_libraries(
+ ${_LIBRARIES}
+ LAPACK
+ ${LAPACK_mkl_SEARCH_SYMBOL}
+ ""
+ "${IT}"
+ "${_BLAS_LIBRARIES}"
+ "${CMAKE_THREAD_LIBS_INIT};${LAPACK_mkl_LM};${LAPACK_mkl_LDL}"
+ )
+ endif ()
+ endforeach ()
+
+ unset(LAPACK_mkl_ILP_MODE)
+ unset(LAPACK_mkl_SEARCH_SYMBOL)
+ unset(LAPACK_mkl_LM)
+ unset(LAPACK_mkl_LDL)
+ endif ()
+endif()
+
if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
if(NOT LAPACK_LIBRARIES)
check_lapack_libraries(
@@ -267,82 +348,7 @@ if (BLA_VENDOR STREQUAL "Generic" OR
)
endif ()
endif ()
-#intel lapack
-if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
- if (NOT WIN32)
- set(LM "-lm")
- endif ()
- if (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED)
- if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
- find_PACKAGE(Threads)
- else()
- find_package(Threads REQUIRED)
- endif()
-
- if (BLA_VENDOR MATCHES "_64ilp")
- set(BLAS_mkl_ILP_MODE "ilp64")
- else ()
- set(BLAS_mkl_ILP_MODE "lp64")
- endif ()
-
- set(LAPACK_SEARCH_LIBS "")
-
- if (BLA_F95)
- set(LAPACK_mkl_SEARCH_SYMBOL "cheev_f95")
- set(_LIBRARIES LAPACK95_LIBRARIES)
- set(_BLAS_LIBRARIES ${BLAS95_LIBRARIES})
-
- # old
- list(APPEND LAPACK_SEARCH_LIBS
- "mkl_lapack95")
- # new >= 10.3
- list(APPEND LAPACK_SEARCH_LIBS
- "mkl_intel_c")
- list(APPEND LAPACK_SEARCH_LIBS
- "mkl_lapack95_${BLAS_mkl_ILP_MODE}")
- else()
- set(LAPACK_mkl_SEARCH_SYMBOL "cheev")
- set(_LIBRARIES LAPACK_LIBRARIES)
- set(_BLAS_LIBRARIES ${BLAS_LIBRARIES})
- # old
- list(APPEND LAPACK_SEARCH_LIBS
- "mkl_lapack")
- # new >= 10.3
- list(APPEND LAPACK_SEARCH_LIBS
- "mkl_gf_${BLAS_mkl_ILP_MODE}")
- endif()
-
- # First try empty lapack libs
- if (NOT ${_LIBRARIES})
- check_lapack_libraries(
- ${_LIBRARIES}
- BLAS
- ${LAPACK_mkl_SEARCH_SYMBOL}
- ""
- ""
- "${_BLAS_LIBRARIES}"
- "${CMAKE_THREAD_LIBS_INIT};${LM}"
- )
- endif ()
- # Then try the search libs
- foreach (IT ${LAPACK_SEARCH_LIBS})
- if (NOT ${_LIBRARIES})
- check_lapack_libraries(
- ${_LIBRARIES}
- BLAS
- ${LAPACK_mkl_SEARCH_SYMBOL}
- ""
- "${IT}"
- "${_BLAS_LIBRARIES}"
- "${CMAKE_THREAD_LIBS_INIT};${LM}"
- )
- endif ()
- endforeach ()
-
- unset(BLAS_mkl_ILP_MODE)
- endif ()
-endif()
else()
message(STATUS "LAPACK requires BLAS")
endif()
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 4a312ec..63a1573 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 13)
-set(CMake_VERSION_PATCH 20181120)
+set(CMake_VERSION_PATCH 20181127)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 1d938e6..2e1bb0a 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -3,6 +3,7 @@
#include "cmCTestTestHandler.h"
#include <algorithm>
#include <chrono>
+#include <cmath>
#include <cmsys/Base64.h>
#include <cmsys/Directory.hxx>
#include <cmsys/RegularExpression.hxx>
@@ -544,8 +545,7 @@ int cmCTestTestHandler::ProcessHandler()
}
cmCTestLog(this->CTest, HANDLER_OUTPUT,
std::endl
- << passColorCode << static_cast<int>(percent + .5f)
- << "% tests passed"
+ << passColorCode << std::lround(percent) << "% tests passed"
<< this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR)
<< ", " << failedColorCode << failed.size() << " tests failed"
<< this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR)
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index 1b57fd8..d941c16 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -22,6 +22,8 @@ function(cm_check_cxx_feature name)
# Filter out warnings caused by local configuration.
string(REGEX REPLACE "[^\n]*warning:[^\n]*directory not found for option[^\n]*" "" check_output "${check_output}")
string(REGEX REPLACE "[^\n]*warning:[^\n]*object file compiled with -mlong-branch which is no longer needed[^\n]*" "" check_output "${check_output}")
+ # Filter out other warnings unrelated to feature checks.
+ string(REGEX REPLACE "[^\n]*warning:[^\n]*sprintf\\(\\) is often misused, please use snprintf[^\n]*" "" check_output "${check_output}")
# Filter out xcodebuild warnings.
string(REGEX REPLACE "[^\n]* xcodebuild\\[[0-9]*:[0-9]*\\] warning: [^\n]*" "" check_output "${check_output}")
# If using the feature causes warnings, treat it as broken/unavailable.
diff --git a/Source/LexerParser/cmFortranLexer.cxx b/Source/LexerParser/cmFortranLexer.cxx
index dec0f5e..82048df 100644
--- a/Source/LexerParser/cmFortranLexer.cxx
+++ b/Source/LexerParser/cmFortranLexer.cxx
@@ -593,13 +593,13 @@ static const YY_CHAR yy_ec[256] =
13, 14, 1, 15, 1, 1, 1, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 17, 18, 19,
20, 21, 22, 1, 23, 24, 25, 26, 27, 28,
- 24, 24, 29, 24, 24, 30, 31, 32, 33, 24,
- 24, 34, 35, 36, 37, 24, 24, 24, 24, 24,
- 1, 38, 1, 1, 39, 1, 23, 40, 41, 42,
+ 29, 29, 30, 29, 29, 31, 32, 33, 34, 29,
+ 29, 35, 36, 37, 38, 29, 29, 29, 29, 29,
+ 1, 39, 1, 1, 40, 1, 23, 24, 41, 42,
- 43, 44, 24, 24, 45, 24, 24, 46, 31, 47,
- 33, 24, 24, 34, 48, 36, 49, 24, 24, 24,
- 24, 24, 1, 1, 1, 1, 1, 1, 1, 1,
+ 43, 44, 29, 29, 45, 29, 29, 46, 32, 47,
+ 34, 29, 29, 35, 48, 37, 49, 29, 29, 29,
+ 29, 29, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -621,7 +621,7 @@ static const YY_CHAR yy_meta[50] =
1, 2, 2, 3, 4, 3, 3, 1, 1, 3,
3, 3, 3, 1, 3, 5, 3, 3, 1, 3,
6, 1, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 1, 5, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 1, 5,
7, 7, 7, 7, 7, 7, 7, 7, 7
} ;
@@ -629,28 +629,28 @@ static const flex_int16_t yy_base[219] =
{ 0,
0, 48, 0, 49, 464, 56, 52, 57, 62, 68,
466, 0, 468, 468, 462, 468, 74, 81, 468, 468,
- 468, 468, 447, 468, 442, 440, 0, 41, 42, 428,
- 43, 42, 91, 119, 97, 157, 455, 206, 245, 468,
- 454, 101, 468, 468, 0, 455, 468, 105, 430, 424,
- 62, 68, 119, 141, 468, 468, 468, 111, 0, 59,
- 98, 88, 415, 109, 158, 468, 0, 162, 293, 0,
- 163, 411, 107, 122, 408, 405, 446, 342, 447, 468,
- 0, 444, 169, 173, 420, 421, 132, 404, 90, 404,
- 179, 185, 191, 227, 295, 397, 0, 146, 178, 149,
-
- 412, 0, 208, 206, 398, 171, 399, 170, 399, 391,
- 387, 422, 417, 221, 468, 374, 365, 347, 347, 334,
- 335, 335, 330, 334, 259, 340, 188, 340, 327, 327,
- 327, 324, 325, 325, 320, 322, 319, 355, 354, 325,
- 327, 468, 468, 310, 309, 309, 300, 301, 273, 273,
- 275, 277, 297, 468, 468, 293, 289, 283, 275, 305,
- 261, 238, 237, 214, 468, 468, 468, 196, 197, 189,
- 277, 181, 0, 274, 112, 468, 468, 105, 103, 311,
- 468, 233, 0, 468, 468, 83, 76, 0, 281, 282,
- 468, 468, 52, 468, 468, 468, 468, 23, 287, 298,
-
- 327, 468, 0, 0, 329, 0, 31, 468, 468, 381,
- 388, 394, 397, 404, 411, 418, 425, 432
+ 468, 468, 447, 468, 442, 440, 0, 19, 41, 427,
+ 47, 41, 90, 119, 97, 158, 455, 207, 247, 468,
+ 454, 101, 468, 468, 0, 455, 468, 105, 430, 423,
+ 62, 67, 119, 151, 468, 468, 468, 121, 0, 90,
+ 93, 110, 431, 112, 142, 468, 0, 160, 295, 0,
+ 162, 411, 123, 102, 408, 405, 446, 344, 447, 468,
+ 0, 444, 170, 174, 420, 421, 132, 404, 95, 404,
+ 180, 186, 192, 228, 297, 397, 0, 168, 144, 52,
+
+ 411, 0, 204, 217, 397, 179, 390, 170, 389, 378,
+ 364, 390, 389, 230, 468, 363, 355, 337, 337, 334,
+ 335, 335, 330, 334, 187, 339, 267, 339, 327, 327,
+ 327, 324, 325, 325, 318, 319, 318, 354, 352, 323,
+ 327, 468, 468, 310, 307, 305, 297, 297, 275, 275,
+ 277, 279, 287, 468, 468, 286, 283, 273, 196, 307,
+ 200, 238, 234, 210, 468, 468, 468, 174, 171, 162,
+ 279, 182, 0, 269, 150, 468, 468, 137, 109, 323,
+ 468, 239, 0, 468, 468, 72, 71, 0, 283, 283,
+ 468, 468, 51, 468, 468, 468, 468, 37, 283, 288,
+
+ 330, 468, 0, 0, 331, 0, 52, 468, 468, 384,
+ 391, 397, 400, 407, 414, 421, 428, 435
} ;
static const flex_int16_t yy_def[219] =
@@ -685,53 +685,53 @@ static const flex_int16_t yy_nxt[518] =
{ 0,
12, 13, 14, 13, 13, 15, 16, 12, 17, 18,
19, 20, 21, 12, 22, 12, 23, 24, 12, 25,
- 12, 26, 27, 27, 27, 27, 28, 27, 29, 27,
- 30, 27, 27, 27, 31, 27, 32, 33, 34, 27,
+ 12, 26, 27, 27, 27, 27, 28, 27, 27, 29,
+ 27, 30, 27, 27, 27, 31, 27, 32, 33, 34,
27, 27, 28, 27, 29, 27, 27, 31, 32, 35,
- 35, 208, 35, 35, 41, 36, 36, 35, 37, 41,
- 35, 42, 43, 36, 41, 202, 42, 43, 44, 38,
- 41, 42, 60, 61, 44, 48, 64, 42, 48, 63,
- 39, 39, 53, 53, 97, 53, 54, 60, 61, 64,
- 55, 63, 65, 66, 201, 65, 39, 39, 68, 49,
-
- 97, 68, 83, 84, 69, 83, 48, 87, 88, 48,
- 50, 89, 95, 100, 90, 95, 51, 198, 52, 45,
- 53, 53, 98, 53, 54, 197, 45, 45, 55, 100,
- 49, 121, 45, 99, 67, 102, 122, 45, 98, 45,
- 45, 50, 92, 53, 193, 92, 93, 51, 192, 52,
- 94, 102, 106, 107, 191, 96, 45, 67, 70, 65,
- 66, 70, 65, 68, 104, 108, 68, 104, 109, 69,
- 83, 84, 71, 83, 114, 125, 118, 114, 71, 119,
- 92, 53, 115, 92, 93, 127, 92, 53, 94, 92,
- 93, 125, 92, 53, 94, 92, 93, 127, 72, 73,
-
- 94, 74, 75, 189, 126, 76, 78, 104, 80, 104,
- 104, 133, 104, 78, 78, 130, 134, 151, 131, 78,
- 126, 78, 114, 103, 78, 114, 78, 78, 92, 53,
- 115, 92, 93, 151, 195, 195, 94, 187, 186, 185,
- 184, 183, 182, 78, 78, 79, 79, 80, 79, 79,
+ 35, 60, 35, 35, 41, 36, 36, 35, 37, 41,
+ 35, 42, 43, 36, 41, 60, 42, 43, 44, 38,
+ 41, 42, 208, 61, 44, 48, 64, 42, 48, 202,
+ 39, 39, 53, 53, 63, 53, 54, 61, 64, 127,
+ 55, 65, 66, 201, 65, 63, 39, 39, 68, 49,
+
+ 127, 68, 83, 84, 69, 83, 48, 87, 88, 48,
+ 89, 50, 198, 90, 197, 97, 51, 98, 52, 45,
+ 53, 53, 95, 53, 54, 95, 45, 45, 55, 99,
+ 49, 97, 45, 98, 67, 100, 121, 45, 102, 45,
+ 45, 122, 50, 65, 66, 108, 65, 51, 109, 52,
+ 193, 100, 92, 53, 102, 92, 93, 45, 67, 70,
+ 94, 68, 70, 104, 68, 96, 104, 69, 106, 107,
+ 126, 83, 84, 71, 83, 114, 118, 71, 114, 119,
+ 192, 92, 53, 115, 92, 93, 126, 92, 53, 94,
+ 92, 93, 191, 92, 53, 94, 92, 93, 125, 72,
+
+ 73, 94, 74, 75, 189, 104, 76, 78, 104, 80,
+ 187, 133, 186, 125, 78, 78, 134, 185, 104, 103,
+ 78, 104, 78, 130, 149, 78, 131, 78, 78, 92,
+ 53, 114, 92, 93, 114, 149, 184, 94, 183, 115,
+ 195, 195, 182, 181, 179, 78, 78, 79, 79, 80,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
- 81, 79, 79, 79, 79, 79, 79, 81, 81, 81,
+ 79, 79, 81, 79, 79, 79, 79, 79, 79, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
- 81, 81, 79, 81, 81, 81, 81, 81, 81, 81,
- 81, 81, 81, 81, 70, 149, 95, 70, 171, 95,
-
- 172, 173, 174, 188, 181, 199, 180, 149, 103, 180,
- 190, 200, 180, 203, 171, 180, 172, 173, 174, 188,
- 103, 199, 190, 179, 204, 178, 103, 200, 205, 203,
- 205, 205, 177, 205, 72, 73, 176, 74, 75, 96,
- 204, 76, 78, 175, 80, 206, 170, 206, 169, 78,
- 78, 168, 167, 166, 165, 78, 164, 78, 163, 162,
- 78, 161, 78, 78, 160, 159, 158, 157, 156, 155,
- 154, 153, 152, 150, 148, 147, 146, 145, 144, 78,
- 78, 40, 40, 40, 40, 40, 40, 40, 45, 143,
- 142, 141, 45, 45, 46, 46, 46, 46, 46, 46,
-
- 46, 59, 140, 59, 79, 79, 79, 79, 79, 79,
- 79, 91, 91, 91, 91, 91, 91, 91, 194, 194,
- 194, 139, 194, 194, 194, 196, 138, 196, 137, 196,
- 196, 196, 207, 207, 207, 207, 207, 136, 207, 135,
- 132, 129, 128, 124, 123, 120, 117, 116, 113, 80,
+ 81, 81, 81, 81, 81, 79, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 70, 151, 95, 70,
+
+ 171, 95, 172, 173, 174, 188, 190, 199, 180, 203,
+ 103, 180, 151, 200, 204, 178, 171, 190, 172, 173,
+ 174, 188, 103, 199, 180, 203, 177, 180, 200, 176,
+ 204, 205, 205, 175, 205, 205, 72, 73, 103, 74,
+ 75, 96, 170, 76, 78, 169, 80, 168, 206, 206,
+ 167, 78, 78, 166, 165, 164, 163, 78, 162, 78,
+ 161, 160, 78, 159, 78, 78, 158, 157, 156, 155,
+ 154, 153, 152, 150, 148, 147, 146, 145, 144, 143,
+ 142, 141, 78, 78, 40, 40, 40, 40, 40, 40,
+ 40, 45, 140, 139, 138, 45, 45, 46, 46, 46,
+
+ 46, 46, 46, 46, 59, 137, 59, 79, 79, 79,
+ 79, 79, 79, 79, 91, 91, 91, 91, 91, 91,
+ 91, 194, 194, 194, 136, 194, 194, 194, 196, 135,
+ 196, 132, 196, 196, 196, 207, 207, 207, 207, 207,
+ 129, 207, 128, 124, 123, 120, 117, 116, 113, 80,
112, 111, 110, 105, 101, 86, 85, 47, 82, 77,
62, 58, 57, 56, 47, 209, 37, 11, 209, 209,
209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
@@ -749,50 +749,50 @@ static const flex_int16_t yy_chk[518] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
- 4, 207, 2, 4, 7, 2, 4, 6, 6, 8,
- 6, 7, 7, 6, 9, 198, 8, 8, 9, 6,
- 10, 9, 28, 29, 10, 17, 32, 10, 17, 31,
- 6, 6, 18, 18, 60, 18, 18, 28, 29, 32,
- 18, 31, 33, 33, 193, 33, 6, 6, 35, 17,
-
- 60, 35, 42, 42, 35, 42, 48, 51, 51, 48,
- 17, 52, 58, 62, 52, 58, 17, 187, 17, 34,
- 53, 53, 61, 53, 53, 186, 34, 34, 53, 62,
- 48, 89, 34, 61, 34, 64, 89, 34, 61, 34,
- 34, 48, 54, 54, 179, 54, 54, 48, 178, 48,
- 54, 64, 73, 73, 175, 58, 34, 34, 36, 65,
- 65, 36, 65, 68, 71, 74, 68, 71, 74, 68,
- 83, 83, 36, 83, 84, 98, 87, 84, 71, 87,
- 91, 91, 84, 91, 91, 100, 92, 92, 91, 92,
- 92, 98, 93, 93, 92, 93, 93, 100, 36, 36,
-
- 93, 36, 36, 172, 99, 36, 38, 104, 38, 103,
- 104, 108, 103, 38, 38, 106, 108, 127, 106, 38,
- 99, 38, 114, 103, 38, 114, 38, 38, 94, 94,
- 114, 94, 94, 127, 182, 182, 94, 170, 169, 168,
- 164, 163, 162, 38, 38, 39, 39, 39, 39, 39,
+ 4, 28, 2, 4, 7, 2, 4, 6, 6, 8,
+ 6, 7, 7, 6, 9, 28, 8, 8, 9, 6,
+ 10, 9, 207, 29, 10, 17, 32, 10, 17, 198,
+ 6, 6, 18, 18, 31, 18, 18, 29, 32, 100,
+ 18, 33, 33, 193, 33, 31, 6, 6, 35, 17,
+
+ 100, 35, 42, 42, 35, 42, 48, 51, 51, 48,
+ 52, 17, 187, 52, 186, 60, 17, 61, 17, 34,
+ 53, 53, 58, 53, 53, 58, 34, 34, 53, 61,
+ 48, 60, 34, 61, 34, 62, 89, 34, 64, 34,
+ 34, 89, 48, 65, 65, 74, 65, 48, 74, 48,
+ 179, 62, 54, 54, 64, 54, 54, 34, 34, 36,
+ 54, 68, 36, 71, 68, 58, 71, 68, 73, 73,
+ 99, 83, 83, 36, 83, 84, 87, 71, 84, 87,
+ 178, 91, 91, 84, 91, 91, 99, 92, 92, 91,
+ 92, 92, 175, 93, 93, 92, 93, 93, 98, 36,
+
+ 36, 93, 36, 36, 172, 103, 36, 38, 103, 38,
+ 170, 108, 169, 98, 38, 38, 108, 168, 104, 103,
+ 38, 104, 38, 106, 125, 38, 106, 38, 38, 94,
+ 94, 114, 94, 94, 114, 125, 164, 94, 163, 114,
+ 182, 182, 162, 161, 159, 38, 38, 39, 39, 39,
39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 69, 125, 95, 69, 149, 95,
-
- 150, 151, 152, 171, 161, 189, 160, 125, 69, 160,
- 174, 190, 180, 199, 149, 180, 150, 151, 152, 171,
- 160, 189, 174, 159, 200, 158, 180, 190, 201, 199,
- 205, 201, 157, 205, 69, 69, 156, 69, 69, 95,
- 200, 69, 78, 153, 78, 201, 148, 205, 147, 78,
- 78, 146, 145, 144, 141, 78, 140, 78, 139, 138,
- 78, 137, 78, 78, 136, 135, 134, 133, 132, 131,
- 130, 129, 128, 126, 124, 123, 122, 121, 120, 78,
- 78, 210, 210, 210, 210, 210, 210, 210, 211, 119,
- 118, 117, 211, 211, 212, 212, 212, 212, 212, 212,
-
- 212, 213, 116, 213, 214, 214, 214, 214, 214, 214,
- 214, 215, 215, 215, 215, 215, 215, 215, 216, 216,
- 216, 113, 216, 216, 216, 217, 112, 217, 111, 217,
- 217, 217, 218, 218, 218, 218, 218, 110, 218, 109,
- 107, 105, 101, 96, 90, 88, 86, 85, 82, 79,
+ 39, 39, 39, 39, 39, 39, 69, 127, 95, 69,
+
+ 149, 95, 150, 151, 152, 171, 174, 189, 160, 199,
+ 69, 160, 127, 190, 200, 158, 149, 174, 150, 151,
+ 152, 171, 160, 189, 180, 199, 157, 180, 190, 156,
+ 200, 201, 205, 153, 201, 205, 69, 69, 180, 69,
+ 69, 95, 148, 69, 78, 147, 78, 146, 201, 205,
+ 145, 78, 78, 144, 141, 140, 139, 78, 138, 78,
+ 137, 136, 78, 135, 78, 78, 134, 133, 132, 131,
+ 130, 129, 128, 126, 124, 123, 122, 121, 120, 119,
+ 118, 117, 78, 78, 210, 210, 210, 210, 210, 210,
+ 210, 211, 116, 113, 112, 211, 211, 212, 212, 212,
+
+ 212, 212, 212, 212, 213, 111, 213, 214, 214, 214,
+ 214, 214, 214, 214, 215, 215, 215, 215, 215, 215,
+ 215, 216, 216, 216, 110, 216, 216, 216, 217, 109,
+ 217, 107, 217, 217, 217, 218, 218, 218, 218, 218,
+ 105, 218, 101, 96, 90, 88, 86, 85, 82, 79,
77, 76, 75, 72, 63, 50, 49, 46, 41, 37,
30, 26, 25, 23, 15, 11, 5, 209, 209, 209,
209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
diff --git a/Source/LexerParser/cmFortranLexer.in.l b/Source/LexerParser/cmFortranLexer.in.l
index 9acba4c..b7e837b 100644
--- a/Source/LexerParser/cmFortranLexer.in.l
+++ b/Source/LexerParser/cmFortranLexer.in.l
@@ -146,7 +146,7 @@ $[ \t]*endif { return F90PPR_ENDIF; }
[Ii][Nn][Cc][Ll][Uu][Dd][Ee] { return INCLUDE; }
[Ii][Nn][Tt][Ee][Rr][Ff][Aa][Cc][Ee] { return INTERFACE; }
[Mm][Oo][Dd][Uu][Ll][Ee] { return MODULE; }
-[Ss][Uu][bb][Mm][Oo][Dd][Uu][Ll][Ee] { return SUBMODULE; }
+[Ss][Uu][Bb][Mm][Oo][Dd][Uu][Ll][Ee] { return SUBMODULE; }
[Uu][Ss][Ee] { return USE; }
[a-zA-Z_][a-zA-Z_0-9]* {
diff --git a/Source/QtDialog/AddCacheEntry.cxx b/Source/QtDialog/AddCacheEntry.cxx
index 6284ac9..70610d7 100644
--- a/Source/QtDialog/AddCacheEntry.cxx
+++ b/Source/QtDialog/AddCacheEntry.cxx
@@ -21,8 +21,8 @@ AddCacheEntry::AddCacheEntry(QWidget* p, const QStringList& varNames,
, VarTypes(varTypes)
{
this->setupUi(this);
- for (int i = 0; i < NumTypes; i++) {
- this->Type->addItem(TypeStrings[i]);
+ for (auto const& elem : TypeStrings) {
+ this->Type->addItem(elem);
}
QWidget* cb = new QCheckBox();
QWidget* path = new QCMakePathEditor();
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 330b747..9ce0323 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -19,9 +19,20 @@ if (Qt5Widgets_FOUND)
macro(qt4_add_resources)
qt5_add_resources(${ARGN})
endmacro()
+
set(CMake_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
set(QT_QTMAIN_LIBRARY ${Qt5Core_QTMAIN_LIBRARIES})
+ # Try to find the package WinExtras for the task bar progress
+ if(WIN32)
+ find_package(Qt5WinExtras QUIET)
+ if (Qt5WinExtras_FOUND)
+ include_directories(${Qt5WinExtras_INCLUDE_DIRS})
+ add_definitions(-DQT_WINEXTRAS)
+ list(APPEND CMake_QT_LIBRARIES ${Qt5WinExtras_LIBRARIES})
+ endif()
+ endif()
+
# Remove this when the minimum version of Qt is 4.6.
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 3761bd3..444a980 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -21,6 +21,11 @@
#include <QToolButton>
#include <QUrl>
+#ifdef QT_WINEXTRAS
+# include <QWinTaskbarButton>
+# include <QWinTaskbarProgress>
+#endif
+
#include "AddCacheEntry.h"
#include "FirstConfigure.h"
#include "QCMake.h"
@@ -294,6 +299,12 @@ void CMakeSetupDialog::initialize()
} else {
this->onBinaryDirectoryChanged(this->BinaryDirectory->lineEdit()->text());
}
+
+#ifdef QT_WINEXTRAS
+ this->TaskbarButton = new QWinTaskbarButton(this);
+ this->TaskbarButton->setWindow(this->windowHandle());
+ this->TaskbarButton->setOverlayIcon(QIcon(":/loading.png"));
+#endif
}
CMakeSetupDialog::~CMakeSetupDialog()
@@ -381,6 +392,10 @@ void CMakeSetupDialog::doConfigure()
this->CacheValues->scrollToTop();
}
this->ProgressBar->reset();
+
+#ifdef QT_WINEXTRAS
+ this->TaskbarButton->progress()->reset();
+#endif
}
bool CMakeSetupDialog::doConfigureInternal()
@@ -495,6 +510,9 @@ void CMakeSetupDialog::doGenerate()
this->enterState(ReadyConfigure);
this->ProgressBar->reset();
+#ifdef QT_WINEXTRAS
+ this->TaskbarButton->progress()->reset();
+#endif
this->ConfigureNeeded = true;
}
@@ -674,6 +692,12 @@ void CMakeSetupDialog::showProgress(const QString& /*msg*/, float percent)
{
percent = (percent * ProgressFactor) + ProgressOffset;
this->ProgressBar->setValue(qRound(percent * 100));
+
+#ifdef QT_WINEXTRAS
+ QWinTaskbarProgress* progress = this->TaskbarButton->progress();
+ progress->setVisible(true);
+ progress->setValue(qRound(percent * 100));
+#endif
}
void CMakeSetupDialog::error(const QString& msg)
diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h
index 1cce35c..39c1053 100644
--- a/Source/QtDialog/CMakeSetupDialog.h
+++ b/Source/QtDialog/CMakeSetupDialog.h
@@ -15,6 +15,10 @@ class CMakeCacheModel;
class QProgressBar;
class QToolButton;
+#ifdef QT_WINEXTRAS
+class QWinTaskbarButton;
+#endif
+
/// Qt user interface for CMake
class CMakeSetupDialog
: public QMainWindow
@@ -118,6 +122,10 @@ protected:
QEventLoop LocalLoop;
+#ifdef QT_WINEXTRAS
+ QWinTaskbarButton* TaskbarButton;
+#endif
+
float ProgressOffset;
float ProgressFactor;
};
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index 0ccd68a..27f9131 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -684,7 +684,7 @@ cmELF::cmELF(const char* fname)
std::unique_ptr<cmsys::ifstream> fin(new cmsys::ifstream(fname));
// Quit now if the file could not be opened.
- if (!fin.get() || !*fin) {
+ if (!fin || !*fin) {
this->ErrorMessage = "Error opening input file.";
return;
}
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index bddc3c4..df27c62 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -79,7 +79,7 @@ bool cmExportFileGenerator::GenerateImportFile()
ap->SetCopyIfDifferent(true);
foutPtr = std::move(ap);
}
- if (!foutPtr.get() || !*foutPtr) {
+ if (!foutPtr || !*foutPtr) {
std::string se = cmSystemTools::GetLastSystemError();
std::ostringstream e;
e << "cannot write to file \"" << this->MainImportFile << "\": " << se;
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index f86e5e2..fa2a3e1 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -10,6 +10,7 @@
#include <algorithm>
#include <assert.h>
+#include <cmath>
#include <ctype.h>
#include <memory> // IWYU pragma: keep
#include <sstream>
@@ -2602,10 +2603,10 @@ public:
bool UpdatePercentage(double value, double total, std::string& status)
{
- int OldPercentage = this->CurrentPercentage;
+ long OldPercentage = this->CurrentPercentage;
if (total > 0.0) {
- this->CurrentPercentage = static_cast<int>(value / total * 100.0 + 0.5);
+ this->CurrentPercentage = std::lround(value / total * 100.0);
if (this->CurrentPercentage > 100) {
// Avoid extra progress reports for unexpected data beyond total.
this->CurrentPercentage = 100;
@@ -2627,7 +2628,7 @@ public:
cmFileCommand* GetFileCommand() { return this->FileCommand; }
private:
- int CurrentPercentage;
+ long CurrentPercentage;
cmFileCommand* FileCommand;
std::string Text;
};
@@ -2824,7 +2825,7 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
std::string algo = i->substr(0, pos);
expectedHash = cmSystemTools::LowerCase(i->substr(pos + 1));
hash = std::unique_ptr<cmCryptoHash>(cmCryptoHash::New(algo.c_str()));
- if (!hash.get()) {
+ if (!hash) {
std::string err = "DOWNLOAD EXPECTED_HASH given unknown ALGO: ";
err += algo;
this->SetError(err);
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index 9ff967c..739c9c0 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -38,7 +38,7 @@ bool cmForEachFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
// Remove the function blocker for this scope or bail.
std::unique_ptr<cmFunctionBlocker> fb(
mf.RemoveFunctionBlocker(this, lff));
- if (!fb.get()) {
+ if (!fb) {
return false;
}
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 0b28d1e..80d81d5 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -4379,8 +4379,7 @@ const char* impliedValue<const char*>(const char* /*unused*/)
return "";
}
template <>
-std::string impliedValue<std::string>(
- std::string /*unused*/) // NOLINT(clang-tidy)
+std::string impliedValue<std::string>(std::string /*unused*/) // NOLINT(*)
{
return std::string();
}
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index fbc756c..0271b6f 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -112,7 +112,7 @@ std::string cmGlobalNinjaGenerator::EncodeLiteral(const std::string& lit)
std::string cmGlobalNinjaGenerator::EncodePath(const std::string& path)
{
- std::string result = path; // NOLINT(clang-tidy)
+ std::string result = path;
#ifdef _WIN32
if (this->IsGCCOnWindows())
std::replace(result.begin(), result.end(), '\\', '/');
@@ -254,7 +254,7 @@ void cmGlobalNinjaGenerator::WriteCustomCommandBuild(
bool restat, const cmNinjaDeps& outputs, const cmNinjaDeps& deps,
const cmNinjaDeps& orderOnly)
{
- std::string cmd = command; // NOLINT(clang-tidy)
+ std::string cmd = command; // NOLINT(*)
#ifdef _WIN32
if (cmd.empty())
// TODO Shouldn't an empty command be handled by ninja?
@@ -1940,7 +1940,7 @@ int cmcmd_cmake_ninja_dyndep(std::vector<std::string>::const_iterator argBeg,
cm.SetHomeOutputDirectory(dir_top_bld);
std::unique_ptr<cmGlobalNinjaGenerator> ggd(
static_cast<cmGlobalNinjaGenerator*>(cm.CreateGlobalGenerator("Ninja")));
- if (!ggd.get() ||
+ if (!ggd ||
!ggd->WriteDyndepFile(dir_top_src, dir_top_bld, dir_cur_src, dir_cur_bld,
arg_dd, arg_ddis, module_dir,
linked_target_dirs)) {
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx
index c3ddb3e..92ee2e0 100644
--- a/Source/cmGlobalVisualStudio14Generator.cxx
+++ b/Source/cmGlobalVisualStudio14Generator.cxx
@@ -215,6 +215,10 @@ bool cmGlobalVisualStudio14Generator::IsWindowsStoreToolsetInstalled() const
std::string cmGlobalVisualStudio14Generator::GetWindows10SDKMaxVersion() const
{
// The last Windows 10 SDK version that VS 2015 can target is 10.0.14393.0.
+ //
+ // "VS 2015 Users: The Windows 10 SDK (15063, 16299, 17134, 17763) is
+ // officially only supported for VS 2017." From:
+ // https://blogs.msdn.microsoft.com/chuckw/2018/10/02/windows-10-october-2018-update/
return "10.0.14393.0";
}
@@ -287,28 +291,28 @@ std::string cmGlobalVisualStudio14Generator::GetWindows10SDKVersion()
// only the UCRT MSIs were installed for them.
cmEraseIf(sdks, NoWindowsH());
- if (!sdks.empty()) {
- // Only use the filename, which will be the SDK version.
- for (std::string& i : sdks) {
- i = cmSystemTools::GetFilenameName(i);
- }
+ // Only use the filename, which will be the SDK version.
+ for (std::string& i : sdks) {
+ i = cmSystemTools::GetFilenameName(i);
+ }
- // Sort the results to make sure we select the most recent one.
- std::sort(sdks.begin(), sdks.end(), cmSystemTools::VersionCompareGreater);
+ // Skip SDKs that cannot be used with our toolset.
+ std::string maxVersion = this->GetWindows10SDKMaxVersion();
+ if (!maxVersion.empty()) {
+ cmEraseIf(sdks, WindowsSDKTooRecent(maxVersion));
+ }
- // Skip SDKs that cannot be used with our toolset.
- std::string maxVersion = this->GetWindows10SDKMaxVersion();
- if (!maxVersion.empty()) {
- cmEraseIf(sdks, WindowsSDKTooRecent(maxVersion));
- }
+ // Sort the results to make sure we select the most recent one.
+ std::sort(sdks.begin(), sdks.end(), cmSystemTools::VersionCompareGreater);
- // Look for a SDK exactly matching the requested target version.
- for (std::string const& i : sdks) {
- if (cmSystemTools::VersionCompareEqual(i, this->SystemVersion)) {
- return i;
- }
+ // Look for a SDK exactly matching the requested target version.
+ for (std::string const& i : sdks) {
+ if (cmSystemTools::VersionCompareEqual(i, this->SystemVersion)) {
+ return i;
}
+ }
+ if (!sdks.empty()) {
// Use the latest Windows 10 SDK since the exact version is not available.
return sdks.at(0);
}
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index ae4041d..5d952da 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -39,7 +39,7 @@ bool cmIfFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
// Remove the function blocker for this scope or bail.
std::unique_ptr<cmFunctionBlocker> fb(
mf.RemoveFunctionBlocker(this, lff));
- if (!fb.get()) {
+ if (!fb) {
return false;
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 790f6e0..5ad8ef6 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2342,7 +2342,7 @@ cmMakefile::AppleSDK cmMakefile::GetAppleSDKType() const
{ "watchsimulator", AppleSDK::WatchSimulator },
};
- for (auto entry : sdkDatabase) {
+ for (auto const& entry : sdkDatabase) {
if (sdkRoot.find(entry.name) == 0 ||
sdkRoot.find(std::string("/") + entry.name) != std::string::npos) {
return entry.sdk;
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx
index d5bcfc2..9d43d19 100644
--- a/Source/cmWhileCommand.cxx
+++ b/Source/cmWhileCommand.cxx
@@ -37,7 +37,7 @@ bool cmWhileFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
// Remove the function blocker for this scope or bail.
std::unique_ptr<cmFunctionBlocker> fb(
mf.RemoveFunctionBlocker(this, lff));
- if (!fb.get()) {
+ if (!fb) {
return false;
}
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 35730b8..2ac7f4d 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2596,7 +2596,7 @@ bool cmake::Open(const std::string& dir, bool dryRun)
std::unique_ptr<cmGlobalGenerator> gen(
this->CreateGlobalGenerator(fullName));
- if (!gen.get()) {
+ if (!gen) {
std::cerr << "Error: could create CMAKE_GENERATOR \"" << fullName
<< "\"\n";
return false;
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 96cdfd0..8b5f2e9 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1388,6 +1388,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
add_subdirectory(FindGDAL)
endif()
+ if(CMake_TEST_FindGIF)
+ add_subdirectory(FindGIF)
+ endif()
+
if(CMake_TEST_FindGSL)
add_subdirectory(FindGSL)
endif()
diff --git a/Tests/FindBoost/Test/CMakeLists.txt b/Tests/FindBoost/Test/CMakeLists.txt
index 663f414..39e92c1 100644
--- a/Tests/FindBoost/Test/CMakeLists.txt
+++ b/Tests/FindBoost/Test/CMakeLists.txt
@@ -13,6 +13,9 @@ if(NOT Boost_PROGRAM_OPTIONS_FOUND)
message(FATAL_ERROR "Optional Boost component \"program_options\" not found which is unexpected")
endif(NOT Boost_PROGRAM_OPTIONS_FOUND)
+add_definitions(-DCMAKE_EXPECTED_BOOST_VERSION="${Boost_VERSION}")
+add_definitions(-DCMAKE_EXPECTED_BOOST_VERSION_COMPONENTS="${Boost_VERSION_STRING}")
+
add_executable(test_boost_tgt main.cxx)
target_link_libraries(test_boost_tgt
Boost::dynamic_linking
diff --git a/Tests/FindBoost/Test/main.cxx b/Tests/FindBoost/Test/main.cxx
index 6e8b5da..50ddadf 100644
--- a/Tests/FindBoost/Test/main.cxx
+++ b/Tests/FindBoost/Test/main.cxx
@@ -20,5 +20,20 @@ int main()
boost::thread foo(threadmain);
foo.join();
- return 0;
+ int version = BOOST_VERSION;
+ int major = version / 100000;
+ int minor = version / 100 % 1000;
+ int patch = version % 100;
+ char version_string[100];
+ snprintf(version_string, sizeof(version_string), "%d.%d.%d", major, minor,
+ patch);
+ printf("Found Boost version %s, expected version %s\n", version_string,
+ CMAKE_EXPECTED_BOOST_VERSION_COMPONENTS);
+ int ret = strcmp(version_string, CMAKE_EXPECTED_BOOST_VERSION_COMPONENTS);
+ char raw_version_string[100];
+ snprintf(raw_version_string, sizeof(raw_version_string), "%d",
+ BOOST_VERSION);
+ printf("Found Boost version %s, expected version %s\n", raw_version_string,
+ CMAKE_EXPECTED_BOOST_VERSION);
+ return ret | strcmp(raw_version_string, CMAKE_EXPECTED_BOOST_VERSION);
}
diff --git a/Tests/FindGIF/CMakeLists.txt b/Tests/FindGIF/CMakeLists.txt
new file mode 100644
index 0000000..bac64af
--- /dev/null
+++ b/Tests/FindGIF/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindGIF.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindGIF/Test"
+ "${CMake_BINARY_DIR}/Tests/FindGIF/Test"
+ ${build_generator_args}
+ --build-project TestFindGIF
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindGIF/Test/CMakeLists.txt b/Tests/FindGIF/Test/CMakeLists.txt
new file mode 100644
index 0000000..961e636
--- /dev/null
+++ b/Tests/FindGIF/Test/CMakeLists.txt
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 3.4)
+project(TestFindGIF C)
+include(CTest)
+
+find_package(GIF REQUIRED)
+
+add_definitions(-DCMAKE_EXPECTED_GIF_VERSION="${GIF_VERSION}")
+
+add_executable(test_tgt main.c)
+target_link_libraries(test_tgt GIF::GIF)
+add_test(NAME test_tgt COMMAND test_tgt)
+
+add_executable(test_var main.c)
+target_include_directories(test_var PRIVATE ${GIF_INCLUDE_DIRS})
+target_link_libraries(test_var PRIVATE ${GIF_LIBRARIES})
+add_test(NAME test_var COMMAND test_var)
diff --git a/Tests/FindGIF/Test/main.c b/Tests/FindGIF/Test/main.c
new file mode 100644
index 0000000..4ed72ec
--- /dev/null
+++ b/Tests/FindGIF/Test/main.c
@@ -0,0 +1,35 @@
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <gif_lib.h>
+
+// GIFLIB before version 5 didn't know this macro
+#ifndef GIFLIB_MAJOR
+# define GIFLIB_MAJOR 4
+#endif
+
+int main()
+{
+ // because of the API changes we have to test different functions depending
+ // on the version of GIFLIB
+#if GIFLIB_MAJOR >= 5
+ // test the linker
+ GifErrorString(D_GIF_SUCCEEDED);
+
+ // check the version
+ char gif_version_string[16];
+ snprintf(gif_version_string, 16, "%i.%i.%i", GIFLIB_MAJOR, GIFLIB_MINOR,
+ GIFLIB_RELEASE);
+
+ assert(strcmp(gif_version_string, CMAKE_EXPECTED_GIF_VERSION) == 0);
+#else
+ // test the linker
+ GifLastError();
+
+ // unfortunately there is no way to check the version in older version of
+ // GIFLIB
+#endif
+
+ return 0;
+}
diff --git a/Tests/FortranModules/Submodules/child.f90 b/Tests/FortranModules/Submodules/child.f90
index 838ab61..c314835 100644
--- a/Tests/FortranModules/Submodules/child.f90
+++ b/Tests/FortranModules/Submodules/child.f90
@@ -1,10 +1,10 @@
! Test the notation for a 1st-generation direct
! descendant of a parent module
-submodule ( parent ) child
+SUBMODULE ( parent ) child
implicit none
-contains
+CONTAINS
module function child_function() result(child_stuff)
logical :: child_stuff
child_stuff=.true.
end function
-end submodule child
+END SUBMODULE child
diff --git a/Tests/RunCMake/FindBoost/NoCXX-stderr.txt b/Tests/RunCMake/FindBoost/NoCXX-stderr.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/FindBoost/NoCXX-stderr.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/FindBoost/NoCXX.cmake b/Tests/RunCMake/FindBoost/NoCXX.cmake
new file mode 100644
index 0000000..04b9cac
--- /dev/null
+++ b/Tests/RunCMake/FindBoost/NoCXX.cmake
@@ -0,0 +1 @@
+find_package(Boost)
diff --git a/Tests/RunCMake/FindBoost/RunCMakeTest.cmake b/Tests/RunCMake/FindBoost/RunCMakeTest.cmake
index a153ae1..5d0577b 100644
--- a/Tests/RunCMake/FindBoost/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FindBoost/RunCMakeTest.cmake
@@ -1,3 +1,4 @@
include(RunCMake)
run_cmake(CMakePackage)
+run_cmake(NoCXX)