diff options
-rw-r--r-- | Help/guide/using-dependencies/index.rst | 4 | ||||
-rw-r--r-- | Help/variable/CMAKE_OSX_VARIABLE.txt | 3 | ||||
-rw-r--r-- | Modules/FindGLEW.cmake | 3 | ||||
-rw-r--r-- | Modules/FindHDF5.cmake | 8 | ||||
-rw-r--r-- | Modules/FindPython/Support.cmake | 6 | ||||
-rw-r--r-- | Modules/Platform/Linux-LCC-Fortran.cmake | 6 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Tests/FindPython/CMakeLists.txt | 13 | ||||
-rw-r--r-- | Tests/FindPython/DifferentComponents/CMakeLists.txt | 7 | ||||
-rw-r--r-- | Tests/FindPython/DifferentComponents/subdir/CMakeLists.txt | 2 |
10 files changed, 43 insertions, 11 deletions
diff --git a/Help/guide/using-dependencies/index.rst b/Help/guide/using-dependencies/index.rst index 03285b6..6cab7ef 100644 --- a/Help/guide/using-dependencies/index.rst +++ b/Help/guide/using-dependencies/index.rst @@ -304,6 +304,8 @@ with this method. ``FetchContent`` And ``find_package()`` Integration =================================================== +.. versionadded:: 3.24 + Some dependencies support being added by either :command:`find_package` or :module:`FetchContent`. Such dependencies must ensure they define the same namespaced targets in both installed and built-from-source scenarios. @@ -375,6 +377,8 @@ For more advanced use cases, see the Dependency Providers ==================== +.. versionadded:: 3.24 + The preceding section discussed techniques that projects can use to specify their dependencies. Ideally, the project shouldn't really care where a dependency comes from, as long as it provides the things it expects (often diff --git a/Help/variable/CMAKE_OSX_VARIABLE.txt b/Help/variable/CMAKE_OSX_VARIABLE.txt index 16f3c1a..5670980 100644 --- a/Help/variable/CMAKE_OSX_VARIABLE.txt +++ b/Help/variable/CMAKE_OSX_VARIABLE.txt @@ -3,7 +3,8 @@ The value of this variable should be set prior to the first because it may influence configuration of the toolchain and flags. It is intended to be set locally by the user creating a build tree. This variable should be set as a ``CACHE`` entry (or else CMake may -remove it while initializing a cache entry of the same name). +remove it while initializing a cache entry of the same name) unless +policy :policy:`CMP0126` is set to ``NEW``. Despite the ``OSX`` part in the variable name(s) they apply also to other SDKs than macOS like iOS, tvOS, or watchOS. diff --git a/Modules/FindGLEW.cmake b/Modules/FindGLEW.cmake index a0fda1f..bfde40b 100644 --- a/Modules/FindGLEW.cmake +++ b/Modules/FindGLEW.cmake @@ -63,6 +63,7 @@ This module defines the following variables: #]=======================================================================] include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) find_package(GLEW CONFIG QUIET) @@ -195,8 +196,6 @@ find_library(GLEW_STATIC_LIBRARY_DEBUG set(CMAKE_FIND_LIBRARY_SUFFIXES ${__GLEW_CURRENT_FIND_LIBRARY_SUFFIXES}) unset(__GLEW_CURRENT_FIND_LIBRARY_SUFFIXES) -include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) - select_library_configurations(GLEW_SHARED) select_library_configurations(GLEW_STATIC) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 46ad015..40ed9a9 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -555,8 +555,8 @@ if(NOT HDF5_FOUND AND NOT HDF5_NO_FIND_PACKAGE_CONFIG_FILE) endif() if( _hdf5_lang_location ) set(HDF5_${_lang}_LIBRARY ${_hdf5_lang_location}) - list(APPEND HDF5_LIBRARIES ${HDF5_${_lang}_LIBRARY}) - set(HDF5_${_lang}_LIBRARIES ${HDF5_${_lang}_LIBRARY}) + list(APPEND HDF5_LIBRARIES ${HDF5_${_lang}_TARGET}${_suffix}) + set(HDF5_${_lang}_LIBRARIES ${HDF5_${_lang}_TARGET}${_suffix}) set(HDF5_${_lang}_FOUND TRUE) endif() if(HDF5_FIND_HL) @@ -569,8 +569,8 @@ if(NOT HDF5_FOUND AND NOT HDF5_NO_FIND_PACKAGE_CONFIG_FILE) endif() if( _hdf5_lang_hl_location ) set(HDF5_${_lang}_HL_LIBRARY ${_hdf5_lang_hl_location}) - list(APPEND HDF5_HL_LIBRARIES ${HDF5_${_lang}_HL_LIBRARY}) - set(HDF5_${_lang}_HL_LIBRARIES ${HDF5_${_lang}_HL_LIBRARY}) + list(APPEND HDF5_HL_LIBRARIES ${HDF5_${_lang}_HL_TARGET}${_suffix}) + set(HDF5_${_lang}_HL_LIBRARIES ${HDF5_${_lang}_HL_TARGET}${_suffix}) set(HDF5_HL_FOUND TRUE) endif() unset(_hdf5_lang_hl_location) diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index a8accae..53519ba 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -2895,7 +2895,8 @@ if (("Development.Module" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS endif() unset (_${_PYTHON_PREFIX}_INCLUDE_HINTS) - if (_${_PYTHON_PREFIX}_LIBRARY_RELEASE) + if ("LIBRARY" IN_LIST _${_PYTHON_PREFIX}_FIND_DEVELOPMENT_ARTIFACTS + AND _${_PYTHON_PREFIX}_LIBRARY_RELEASE) # Use the library's install prefix as a hint if (_${_PYTHON_PREFIX}_LIBRARY_RELEASE MATCHES "^(.+/Frameworks/Python.framework/Versions/[0-9.]+)") list (APPEND _${_PYTHON_PREFIX}_INCLUDE_HINTS "${CMAKE_MATCH_1}") @@ -2979,7 +2980,8 @@ if (("Development.Module" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS if (_${_PYTHON_PREFIX}_INCLUDE_DIR) # retrieve version from header file _python_get_version (INCLUDE PREFIX _${_PYTHON_PREFIX}_INC_) - if (_${_PYTHON_PREFIX}_LIBRARY_RELEASE) + if ("LIBRARY" IN_LIST _${_PYTHON_PREFIX}_FIND_DEVELOPMENT_ARTIFACTS + AND _${_PYTHON_PREFIX}_LIBRARY_RELEASE) if ("${_${_PYTHON_PREFIX}_INC_VERSION_MAJOR}.${_${_PYTHON_PREFIX}_INC_VERSION_MINOR}" VERSION_EQUAL _${_PYTHON_PREFIX}_VERSION) # update versioning diff --git a/Modules/Platform/Linux-LCC-Fortran.cmake b/Modules/Platform/Linux-LCC-Fortran.cmake index d3a4cf4..bf2a1c2 100644 --- a/Modules/Platform/Linux-LCC-Fortran.cmake +++ b/Modules/Platform/Linux-LCC-Fortran.cmake @@ -1,3 +1,7 @@ include(Platform/Linux-LCC) __linux_compiler_lcc(Fortran) -set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-llfortran") +if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS "1.26.03") + set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-llfortran") +else() + set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-lgfortran") +endif() diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 87f20d1..026b303 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 24) -set(CMake_VERSION_PATCH 20220626) +set(CMake_VERSION_PATCH 20220628) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Tests/FindPython/CMakeLists.txt b/Tests/FindPython/CMakeLists.txt index 520ba9e..d4cf36b 100644 --- a/Tests/FindPython/CMakeLists.txt +++ b/Tests/FindPython/CMakeLists.txt @@ -423,6 +423,19 @@ if(CMake_TEST_FindPython) --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) + add_test(NAME FindPython.DifferentComponents COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/DifferentComponents" + "${CMake_BINARY_DIR}/Tests/FindPython/DifferentComponents" + ${build_generator_args} + --build-project DifferentComponents + --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}" + "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}" + "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}" + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + if (CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin") add_test(NAME FindPython.Interpreter.SOABI COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> diff --git a/Tests/FindPython/DifferentComponents/CMakeLists.txt b/Tests/FindPython/DifferentComponents/CMakeLists.txt new file mode 100644 index 0000000..7476632 --- /dev/null +++ b/Tests/FindPython/DifferentComponents/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) + +project(TestDifferentComponents LANGUAGES C) + +add_subdirectory(subdir) + +find_package(Python3 REQUIRED COMPONENTS Development.Module) diff --git a/Tests/FindPython/DifferentComponents/subdir/CMakeLists.txt b/Tests/FindPython/DifferentComponents/subdir/CMakeLists.txt new file mode 100644 index 0000000..98fcd5f --- /dev/null +++ b/Tests/FindPython/DifferentComponents/subdir/CMakeLists.txt @@ -0,0 +1,2 @@ + +find_package(Python3 REQUIRED COMPONENTS Development) |