diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeCUDACompiler.cmake.in | 1 | ||||
-rw-r--r-- | Modules/CMakeFindBinUtils.cmake | 1 | ||||
-rw-r--r-- | Modules/FindOpenAL.cmake | 99 | ||||
-rw-r--r-- | Modules/FindPython.cmake | 24 | ||||
-rw-r--r-- | Modules/FindPython/Support.cmake | 70 | ||||
-rw-r--r-- | Modules/FindPython2.cmake | 21 | ||||
-rw-r--r-- | Modules/FindPython3.cmake | 26 | ||||
-rw-r--r-- | Modules/FindX11.cmake | 94 | ||||
-rw-r--r-- | Modules/Platform/Windows-Clang.cmake | 2 | ||||
-rw-r--r-- | Modules/Platform/Windows-Intel.cmake | 2 | ||||
-rw-r--r-- | Modules/Platform/Windows-MSVC.cmake | 2 | ||||
-rw-r--r-- | Modules/Platform/Windows-NVIDIA-CUDA.cmake | 2 |
12 files changed, 266 insertions, 78 deletions
diff --git a/Modules/CMakeCUDACompiler.cmake.in b/Modules/CMakeCUDACompiler.cmake.in index 4a615a3..14a39a9 100644 --- a/Modules/CMakeCUDACompiler.cmake.in +++ b/Modules/CMakeCUDACompiler.cmake.in @@ -54,4 +54,5 @@ set(CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES@ set(CMAKE_CUDA_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_CUDA_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@") set(CMAKE_LINKER "@CMAKE_LINKER@") +set(CMAKE_AR "@CMAKE_AR@") set(CMAKE_MT "@CMAKE_MT@") diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake index c23e447..de9ef9a 100644 --- a/Modules/CMakeFindBinUtils.cmake +++ b/Modules/CMakeFindBinUtils.cmake @@ -75,6 +75,7 @@ if(("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_SIMULATE_ID}" STREQUAL "xMSVC" AND endif() find_program(CMAKE_LINKER NAMES ${_CMAKE_ADDITIONAL_LINKER_NAMES} link HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) + find_program(CMAKE_AR NAMES lib HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_MT NAMES mt HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) list(APPEND _CMAKE_TOOL_VARS LINKER MT) diff --git a/Modules/FindOpenAL.cmake b/Modules/FindOpenAL.cmake index 27dcaf5..c9c0903 100644 --- a/Modules/FindOpenAL.cmake +++ b/Modules/FindOpenAL.cmake @@ -5,27 +5,45 @@ FindOpenAL ---------- - Finds Open Audio Library (OpenAL). -This module defines ``OPENAL_LIBRARY OPENAL_FOUND``, if -false, do not try to link to OpenAL ``OPENAL_INCLUDE_DIR``, where to find -the headers. -``$OPENALDIR`` is an environment variable that would correspond to the -``./configure --prefix=$OPENALDIR`` used in building OpenAL. +Projects using this module should use ``#include <al.h>`` to include the OpenAL +header file, **not** ``#include <AL.al.h>``. The reason for this is that the +latter is not entirely portable. Windows/Creative Labs does not by default put +their headers in ``AL/`` and macOS uses the convention ``<OpenAL/al.h>``. + +Hints +^^^^^ + +Environment variable ``$OPENALDIR`` can be used to set the prefix of OpenAL +installation to be found. + +By default on macOS, system framework is search first. In other words, +OpenAL is searched in the following order: + +1. System framework: ``/System/Library/Frameworks``, whose priority can be + changed via setting the :variable:`CMAKE_FIND_FRAMEWORK` variable. +2. Environment variable ``$OPENALDIR``. +3. System paths. +4. User-compiled framework: ``~/Library/Frameworks``. +5. Manually compiled framework: ``/Library/Frameworks``. +6. Add-on package: ``/opt``. + +Result Variables +^^^^^^^^^^^^^^^^ -Created by Eric Wing. This was influenced by the ``FindSDL.cmake`` -module. +This module defines the following variables: + +``OPENAL_FOUND`` + If false, do not try to link to OpenAL +``OPENAL_INCLUDE_DIR`` + OpenAL include directory +``OPENAL_LIBRARY`` + Path to the OpenAL library +``OPENAL_VERSION_STRING`` + Human-readable string containing the version of OpenAL #]=======================================================================] -# This makes the presumption that you are include al.h like -# #include "al.h" -# and not -# #include <AL/al.h> -# The reason for this is that the latter is not entirely portable. -# Windows/Creative Labs does not by default put their headers in AL/ and -# OS X uses the convention <OpenAL/al.h>. -# # For Windows, Creative Labs seems to have added a registry key for their # OpenAL 1.1 installer. I have added that key to the list of search paths, # however, the key looks like it could be a little fragile depending on @@ -36,36 +54,17 @@ module. # platforms are introduced. # The OpenAL 1.0 installer doesn't seem to have a useful key I can use. # I do not know if the Nvidia OpenAL SDK has a registry key. -# -# For OS X, remember that OpenAL was added by Apple in 10.4 (Tiger). -# To support the framework, I originally wrote special framework detection -# code in this module which I have now removed with CMake's introduction -# of native support for frameworks. -# In addition, OpenAL is open source, and it is possible to compile on Panther. -# Furthermore, due to bugs in the initial OpenAL release, and the -# transition to OpenAL 1.1, it is common to need to override the built-in -# framework. -# Per my request, CMake should search for frameworks first in -# the following order: -# ~/Library/Frameworks/OpenAL.framework/Headers -# /Library/Frameworks/OpenAL.framework/Headers -# /System/Library/Frameworks/OpenAL.framework/Headers -# -# On OS X, this will prefer the Framework version (if found) over others. -# People will have to manually change the cache values of -# OPENAL_LIBRARY to override this selection or set the CMake environment -# CMAKE_INCLUDE_PATH to modify the search paths. find_path(OPENAL_INCLUDE_DIR al.h HINTS ENV OPENALDIR - PATH_SUFFIXES include/AL include/OpenAL include AL OpenAL PATHS - ~/Library/Frameworks - /Library/Frameworks - /opt - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir] -) + ~/Library/Frameworks + /Library/Frameworks + /opt + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir] + PATH_SUFFIXES include/AL include/OpenAL include AL OpenAL + ) if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(_OpenAL_ARCH_DIR libs/Win64) @@ -77,17 +76,21 @@ find_library(OPENAL_LIBRARY NAMES OpenAL al openal OpenAL32 HINTS ENV OPENALDIR - PATH_SUFFIXES libx32 lib64 lib libs64 libs ${_OpenAL_ARCH_DIR} PATHS - ~/Library/Frameworks - /Library/Frameworks - /opt - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir] -) + ~/Library/Frameworks + /Library/Frameworks + /opt + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir] + PATH_SUFFIXES libx32 lib64 lib libs64 libs ${_OpenAL_ARCH_DIR} + ) unset(_OpenAL_ARCH_DIR) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenAL DEFAULT_MSG OPENAL_LIBRARY OPENAL_INCLUDE_DIR) +find_package_handle_standard_args( + OpenAL + REQUIRED_VARS OPENAL_LIBRARY OPENAL_INCLUDE_DIR + VERSION_VAR OPENAL_VERSION_STRING + ) mark_as_advanced(OPENAL_LIBRARY OPENAL_INCLUDE_DIR) diff --git a/Modules/FindPython.cmake b/Modules/FindPython.cmake index be272e1..6132693 100644 --- a/Modules/FindPython.cmake +++ b/Modules/FindPython.cmake @@ -288,6 +288,22 @@ setting the following variables: If more than one artifact is specified, it is the user's responsability to ensure the consistency of the various artifacts. +By default, this module supports multiple calls in different directories of a +project with different version/component requirements while providing correct +and consistent results for each call. To support this behavior, ``CMake`` cache +is not used in the traditional way which can be problematic for interactive +specification. So, to enable also interactive specification, module behavior +can be controled with the following variable: + +``Python_ARTIFACTS_INTERACTIVE`` + Selects the behavior of the module. This is a boolean variable: + + * If set to ``TRUE``: Create CMake cache entries for the above artifact + specification variables so that users can edit them interactively. + This disables support for multiple version/component requirements. + * If set to ``FALSE`` or undefined: Enable multiple version/component + requirements. + Commands ^^^^^^^^ @@ -297,9 +313,13 @@ This module defines the command ``Python_add_library`` (when when library type is ``MODULE``, to target ``Python::Module`` and takes care of Python module naming rules:: - Python_add_library (my_module MODULE src1.cpp) + Python_add_library (<name> [STATIC | SHARED | MODULE [WITH_SOABI]] + <source1> [<source2> ...]) + +If the library type is not specified, ``MODULE`` is assumed. -If library type is not specified, ``MODULE`` is assumed. +For ``MODULE`` library type, if option ``WITH_SOABI`` is specified, the +module suffix will include the ``Python_SOABI`` value, if any. #]=======================================================================] diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index 0f52008..e903f2a 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -75,22 +75,20 @@ macro (_PYTHON_SELECT_LIBRARY_CONFIGURATIONS _PYTHON_BASENAME) (_PYTHON_isMultiConfig OR CMAKE_BUILD_TYPE)) # if the generator is multi-config or if CMAKE_BUILD_TYPE is set for # single-config generators, set optimized and debug libraries - set (${_PYTHON_BASENAME}_LIBRARY "") - foreach (_PYTHON_libname IN LISTS ${_PYTHON_BASENAME}_LIBRARY_RELEASE ) - list( APPEND ${_PYTHON_BASENAME}_LIBRARY optimized "${_PYTHON_libname}" ) + set (${_PYTHON_BASENAME}_LIBRARIES "") + foreach (_PYTHON_libname IN LISTS ${_PYTHON_BASENAME}_LIBRARY_RELEASE) + list( APPEND ${_PYTHON_BASENAME}_LIBRARIES optimized "${_PYTHON_libname}") endforeach() - foreach (_PYTHON_libname IN LISTS ${_PYTHON_BASENAME}_LIBRARY_DEBUG ) - list( APPEND ${_PYTHON_BASENAME}_LIBRARY debug "${_PYTHON_libname}" ) + foreach (_PYTHON_libname IN LISTS ${_PYTHON_BASENAME}_LIBRARY_DEBUG) + list( APPEND ${_PYTHON_BASENAME}_LIBRARIES debug "${_PYTHON_libname}") endforeach() elseif (${_PYTHON_BASENAME}_LIBRARY_RELEASE) - set (${_PYTHON_BASENAME}_LIBRARY "${${_PYTHON_BASENAME}_LIBRARY_RELEASE}") + set (${_PYTHON_BASENAME}_LIBRARIES "${${_PYTHON_BASENAME}_LIBRARY_RELEASE}") elseif (${_PYTHON_BASENAME}_LIBRARY_DEBUG) - set (${_PYTHON_BASENAME}_LIBRARY "${${_PYTHON_BASENAME}_LIBRARY_DEBUG}") + set (${_PYTHON_BASENAME}_LIBRARIES "${${_PYTHON_BASENAME}_LIBRARY_DEBUG}") else() - set (${_PYTHON_BASENAME}_LIBRARY "${_PYTHON_BASENAME}_LIBRARY-NOTFOUND") + set (${_PYTHON_BASENAME}_LIBRARIES "${_PYTHON_BASENAME}_LIBRARY-NOTFOUND") endif() - - set (${_PYTHON_BASENAME}_LIBRARIES "${${_PYTHON_BASENAME}_LIBRARY}") endmacro() @@ -1412,6 +1410,10 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) endif() endif() + if (${_PYTHON_PREFIX}_ARTIFACTS_INTERACTIVE) + set (${_PYTHON_PREFIX}_EXECUTABLE "${_${_PYTHON_PREFIX}_EXECUTABLE}" CACHE FILEPATH "${_PYTHON_PREFIX} Interpreter") + endif() + _python_mark_as_internal (_${_PYTHON_PREFIX}_EXECUTABLE _${_PYTHON_PREFIX}_INTERPRETER_PROPERTIES _${_PYTHON_PREFIX}_INTERPRETER_SIGNATURE) @@ -1607,6 +1609,10 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) unset (${_PYTHON_PREFIX}_COMPILER_ID) endif() + if (${_PYTHON_PREFIX}_ARTIFACTS_INTERACTIVE) + set (${_PYTHON_PREFIX}_COMPILER "${_${_PYTHON_PREFIX}_COMPILER}" CACHE FILEPATH "${_PYTHON_PREFIX} Compiler") + endif() + _python_mark_as_internal (_${_PYTHON_PREFIX}_COMPILER _${_PYTHON_PREFIX}_COMPILER_SIGNATURE) endif() @@ -2298,6 +2304,11 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS set (CMAKE_FIND_LIBRARY_SUFFIXES ${_${_PYTHON_PREFIX}_CMAKE_FIND_LIBRARY_SUFFIXES}) endif() + if (${_PYTHON_PREFIX}_ARTIFACTS_INTERACTIVE) + set (${_PYTHON_PREFIX}_LIBRARY "${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}" CACHE FILEPATH "${_PYTHON_PREFIX} Library") + set (${_PYTHON_PREFIX}_INCLUDE_DIR "${_${_PYTHON_PREFIX}_INCLUDE_DIR}" CACHE FILEPATH "${_PYTHON_PREFIX} Include Directory") + endif() + _python_mark_as_internal (_${_PYTHON_PREFIX}_LIBRARY_RELEASE _${_PYTHON_PREFIX}_LIBRARY_DEBUG _${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE @@ -2376,6 +2387,10 @@ if ("NumPy" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS AND ${_PYTHON_PREFIX}_Inte unset (_${_PYTHON_PREFIX}_NUMPY_SIGNATURE CACHE) endif() + if (${_PYTHON_PREFIX}_ARTIFACTS_INTERACTIVE) + set (${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR "${_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR}" CACHE FILEPATH "${_PYTHON_PREFIX} NumPy Include Directory") + endif() + _python_mark_as_internal (_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR _${_PYTHON_PREFIX}_NUMPY_SIGNATURE) endif() @@ -2451,8 +2466,8 @@ if(_${_PYTHON_PREFIX}_CMAKE_ROLE STREQUAL "PROJECT") else() set_target_properties (${__name} PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_IMPLIB "${${_PYTHON_PREFIX}_LIBRARY}" - IMPORTED_LOCATION "${${_PYTHON_PREFIX}_RUNTIME_LIBRARY}") + IMPORTED_IMPLIB "${${_PYTHON_PREFIX}_LIBRARIES}" + IMPORTED_LOCATION "${${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE}") endif() else() if (${_PYTHON_PREFIX}_LIBRARY_RELEASE AND ${_PYTHON_PREFIX}_LIBRARY_DEBUG) @@ -2466,7 +2481,7 @@ if(_${_PYTHON_PREFIX}_CMAKE_ROLE STREQUAL "PROJECT") else() set_target_properties (${__name} PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION "${${_PYTHON_PREFIX}_LIBRARY}") + IMPORTED_LOCATION "${${_PYTHON_PREFIX}_LIBRARY_RELEASE}") endif() endif() @@ -2514,15 +2529,21 @@ if(_${_PYTHON_PREFIX}_CMAKE_ROLE STREQUAL "PROJECT") # function (__${_PYTHON_PREFIX}_ADD_LIBRARY prefix name) cmake_parse_arguments (PARSE_ARGV 2 PYTHON_ADD_LIBRARY - "STATIC;SHARED;MODULE" "" "") + "STATIC;SHARED;MODULE;WITH_SOABI" "" "") + + if (prefix STREQUAL "Python2" AND PYTHON_ADD_LIBRARY_WITH_SOABI) + message (AUTHOR_WARNING "FindPython2: Option `WITH_SOABI` is not supported for Python2 and will be ignored.") + unset (PYTHON_ADD_LIBRARY_WITH_SOABI) + endif() - unset (type) - if (NOT (PYTHON_ADD_LIBRARY_STATIC - OR PYTHON_ADD_LIBRARY_SHARED - OR PYTHON_ADD_LIBRARY_MODULE)) + if (PYTHON_ADD_LIBRARY_STATIC) + set (type STATIC) + elseif (PYTHON_ADD_LIBRARY_SHARED) + set (type SHARED) + else() set (type MODULE) endif() - add_library (${name} ${type} ${ARGN}) + add_library (${name} ${type} ${PYTHON_ADD_LIBRARY_UNPARSED_ARGUMENTS}) get_property (type TARGET ${name} PROPERTY TYPE) @@ -2533,7 +2554,18 @@ if(_${_PYTHON_PREFIX}_CMAKE_ROLE STREQUAL "PROJECT") if(CMAKE_SYSTEM_NAME STREQUAL "Windows") set_property (TARGET ${name} PROPERTY SUFFIX ".pyd") endif() + + if (PYTHON_ADD_LIBRARY_WITH_SOABI AND ${prefix}_SOABI) + get_property (suffix TARGET ${name} PROPERTY SUFFIX) + if (NOT suffix) + set (suffix "${CMAKE_SHARED_MODULE_SUFFIX}") + endif() + set_property (TARGET ${name} PROPERTY SUFFIX ".${${prefix}_SOABI}${suffix}") + endif() else() + if (PYTHON_ADD_LIBRARY_WITH_SOABI) + message (AUTHOR_WARNING "Find${prefix}: Option `WITH_SOABI` is only supported for `MODULE` library type.") + endif() target_link_libraries (${name} PRIVATE ${prefix}::Python) endif() endfunction() diff --git a/Modules/FindPython2.cmake b/Modules/FindPython2.cmake index 9d4eda2..10fe211 100644 --- a/Modules/FindPython2.cmake +++ b/Modules/FindPython2.cmake @@ -237,16 +237,33 @@ setting the following variables: If more than one artifact is specified, it is the user's responsability to ensure the consistency of the various artifacts. +By default, this module supports multiple calls in different directories of a +project with different version/component requirements while providing correct +and consistent results for each call. To support this behavior, ``CMake`` cache +is not used in the traditional way which can be problematic for interactive +specification. So, to enable also interactive specification, module behavior +can be controled with the following variable: + +``Python2_ARTIFACTS_INTERACTIVE`` + Selects the behavior of the module. This is a boolean variable: + + * If set to ``TRUE``: Create CMake cache entries for the above artifact + specification variables so that users can edit them interactively. + This disables support for multiple version/component requirements. + * If set to ``FALSE`` or undefined: Enable multiple version/component + requirements. + Commands ^^^^^^^^ -This module defines the command ``Python_add_library`` (when +This module defines the command ``Python2_add_library`` (when :prop_gbl:`CMAKE_ROLE` is ``PROJECT``), which has the same semantics as :command:`add_library` and adds a dependency to target ``Python2::Python`` or, when library type is ``MODULE``, to target ``Python2::Module`` and takes care of Python module naming rules:: - Python2_add_library (my_module MODULE src1.cpp) + Python2_add_library (<name> [STATIC | SHARED | MODULE] + <source1> [<source2> ...]) If library type is not specified, ``MODULE`` is assumed. #]=======================================================================] diff --git a/Modules/FindPython3.cmake b/Modules/FindPython3.cmake index 00c354e..211f982 100644 --- a/Modules/FindPython3.cmake +++ b/Modules/FindPython3.cmake @@ -285,18 +285,38 @@ setting the following variables: If more than one artifact is specified, it is the user's responsability to ensure the consistency of the various artifacts. +By default, this module supports multiple calls in different directories of a +project with different version/component requirements while providing correct +and consistent results for each call. To support this behavior, ``CMake`` cache +is not used in the traditional way which can be problematic for interactive +specification. So, to enable also interactive specification, module behavior +can be controled with the following variable: + +``Python3_ARTIFACTS_INTERACTIVE`` + Selects the behavior of the module. This is a boolean variable: + + * If set to ``TRUE``: Create CMake cache entries for the above artifact + specification variables so that users can edit them interactively. + This disables support for multiple version/component requirements. + * If set to ``FALSE`` or undefined: Enable multiple version/component + requirements. + Commands ^^^^^^^^ -This module defines the command ``Python_add_library`` (when +This module defines the command ``Python3_add_library`` (when :prop_gbl:`CMAKE_ROLE` is ``PROJECT``), which has the same semantics as :command:`add_library` and adds a dependency to target ``Python3::Python`` or, when library type is ``MODULE``, to target ``Python3::Module`` and takes care of Python module naming rules:: - Python3_add_library (my_module MODULE src1.cpp) + Python3_add_library (<name> [STATIC | SHARED | MODULE [WITH_SOABI]] + <source1> [<source2> ...]) + +If the library type is not specified, ``MODULE`` is assumed. -If library type is not specified, ``MODULE`` is assumed. +For ``MODULE`` library type, if option ``WITH_SOABI`` is specified, the +module suffix will include the ``Python3_SOABI`` value, if any. #]=======================================================================] diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake index b28dd12..aa83575 100644 --- a/Modules/FindX11.cmake +++ b/Modules/FindX11.cmake @@ -25,6 +25,10 @@ and also the following more fine grained variables and targets: X11_Xaccessrules_INCLUDE_PATH, X11_Xaccessstr_INCLUDE_PATH, X11_Xaccess_FOUND X11_Xau_INCLUDE_PATH, X11_Xau_LIB, X11_Xau_FOUND, X11::Xau + X11_xcb_INCLUDE_PATH, X11_xcb_LIB, X11_xcb_FOUND, X11::xcb + X11_X11_xcb_INCLUDE_PATH, X11_X11_xcb_LIB, X11_X11_xcb_FOUND, X11::X11_xcb + X11_xcb_icccm_INCLUDE_PATH, X11_xcb_icccm_LIB, X11_xcb_icccm_FOUND, X11::xcb_icccm + X11_xcb_xkb_INCLUDE_PATH, X11_xcb_xkb_LIB, X11_xcb_xkb_FOUND, X11::xcb_xkb X11_Xcomposite_INCLUDE_PATH, X11_Xcomposite_LIB, X11_Xcomposite_FOUND, X11::Xcomposite X11_Xcursor_INCLUDE_PATH, X11_Xcursor_LIB, X11_Xcursor_FOUND, X11::Xcursor X11_Xdamage_INCLUDE_PATH, X11_Xdamage_LIB, X11_Xdamage_FOUND, X11::Xdamage @@ -38,6 +42,8 @@ and also the following more fine grained variables and targets: X11_Xinerama_INCLUDE_PATH, X11_Xinerama_LIB, X11_Xinerama_FOUND, X11::Xinerama X11_Xkb_INCLUDE_PATH, X11_Xkblib_INCLUDE_PATH, X11_Xkb_FOUND, X11::Xkb + X11_xkbcommon_INCLUDE_PATH, X11_xkbcommon_LIB, X11_xkbcommon_FOUND, X11::xkbcommon + X11_xkbcommon_X11_INCLUDE_PATH,X11_xkbcommon_X11_LIB,X11_xkbcommon_X11_FOUND,X11::xkbcommon_X11 X11_xkbfile_INCLUDE_PATH, X11_xkbfile_LIB, X11_xkbfile_FOUND, X11::xkbfile X11_Xmu_INCLUDE_PATH, X11_Xmu_LIB, X11_Xmu_FOUND, X11::Xmu X11_Xpm_INCLUDE_PATH, X11_Xpm_LIB, X11_Xpm_FOUND, X11::Xpm @@ -94,6 +100,9 @@ if (UNIX) find_path(X11_Xaccessrules_INCLUDE_PATH X11/extensions/XKBrules.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xaccessstr_INCLUDE_PATH X11/extensions/XKBstr.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xau_INCLUDE_PATH X11/Xauth.h ${X11_INC_SEARCH_PATH}) + find_path(X11_xcb_INCLUDE_PATH xcb/xcb.h ${X11_INC_SEARCH_PATH}) + find_path(X11_X11_xcb_INCLUDE_PATH X11/Xlib-xcb.h ${X11_INC_SEARCH_PATH}) + find_path(X11_xcb_icccm_INCLUDE_PATH xcb/xcb_icccm.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xcomposite_INCLUDE_PATH X11/extensions/Xcomposite.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xcursor_INCLUDE_PATH X11/Xcursor/Xcursor.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xdamage_INCLUDE_PATH X11/extensions/Xdamage.h ${X11_INC_SEARCH_PATH}) @@ -107,6 +116,8 @@ if (UNIX) find_path(X11_Xi_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xinerama_INCLUDE_PATH X11/extensions/Xinerama.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xkb_INCLUDE_PATH X11/extensions/XKB.h ${X11_INC_SEARCH_PATH}) + find_path(X11_xkbcommon_INCLUDE_PATH xkbcommon/xkbcommon.h ${X11_INC_SEARCH_PATH}) + find_path(X11_xkbcommon_X11_INCLUDE_PATH xkbcommon/xkbcommon-x11.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xkblib_INCLUDE_PATH X11/XKBlib.h ${X11_INC_SEARCH_PATH}) find_path(X11_xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xmu_INCLUDE_PATH X11/Xmu/Xmu.h ${X11_INC_SEARCH_PATH}) @@ -137,6 +148,10 @@ if (UNIX) find_library(X11_ICE_LIB ICE ${X11_LIB_SEARCH_PATH}) find_library(X11_SM_LIB SM ${X11_LIB_SEARCH_PATH}) find_library(X11_Xau_LIB Xau ${X11_LIB_SEARCH_PATH}) + find_library(X11_xcb_LIB xcb ${X11_LIB_SEARCH_PATH}) + find_library(X11_X11_xcb_LIB X11-xcb ${X11_LIB_SEARCH_PATH}) + find_library(X11_xcb_icccm_LIB xcb-icccm ${X11_LIB_SEARCH_PATH}) + find_library(X11_xcb_xkb_LIB xcb-xkb ${X11_LIB_SEARCH_PATH}) find_library(X11_Xcomposite_LIB Xcomposite ${X11_LIB_SEARCH_PATH}) find_library(X11_Xcursor_LIB Xcursor ${X11_LIB_SEARCH_PATH}) find_library(X11_Xdamage_LIB Xdamage ${X11_LIB_SEARCH_PATH}) @@ -146,6 +161,8 @@ if (UNIX) find_library(X11_Xft_LIB Xft ${X11_LIB_SEARCH_PATH}) find_library(X11_Xi_LIB Xi ${X11_LIB_SEARCH_PATH}) find_library(X11_Xinerama_LIB Xinerama ${X11_LIB_SEARCH_PATH}) + find_library(X11_xkbcommon_LIB xkbcommon ${X11_LIB_SEARCH_PATH}) + find_library(X11_xkbcommon_X11_LIB xkbcommon-x11 ${X11_LIB_SEARCH_PATH}) find_library(X11_xkbfile_LIB xkbfile ${X11_LIB_SEARCH_PATH}) find_library(X11_Xmu_LIB Xmu ${X11_LIB_SEARCH_PATH}) find_library(X11_Xpm_LIB Xpm ${X11_LIB_SEARCH_PATH}) @@ -221,6 +238,22 @@ if (UNIX) set(X11_Xau_FOUND TRUE) endif () + if (X11_xcb_LIB AND X11_xcb_INCLUDE_PATH) + set(X11_xcb_FOUND TRUE) + endif () + + if (X11_X11_xcb_LIB AND X11_X11_xcb_INCLUDE_PATH) + set(X11_X11_xcb_FOUND TRUE) + endif () + + if (X11_xcb_icccm_LIB AND X11_xcb_icccm_INCLUDE_PATH) + set(X11_xcb_icccm_FOUND TRUE) + endif () + + if (X11_xcb_xkb_LIB) + set(X11_xcb_xkb_FOUND TRUE) + endif () + if (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB) set(X11_Xdmcp_FOUND TRUE) list(APPEND X11_INCLUDE_DIR ${X11_Xdmcp_INCLUDE_PATH}) @@ -326,6 +359,14 @@ if (UNIX) list(APPEND X11_INCLUDE_DIR ${X11_Xkb_INCLUDE_PATH} ) endif () + if (X11_xkbcommon_INCLUDE_PATH AND X11_xkbcommon_LIB) + set(X11_xkbcommon_FOUND TRUE) + endif () + + if (X11_xkbcommon_X11_INCLUDE_PATH AND X11_xkbcommon_X11_LIB) + set(X11_xkbcommon_X11_FOUND TRUE) + endif () + if (X11_xkbfile_INCLUDE_PATH AND X11_xkbfile_LIB AND X11_Xlib_INCLUDE_PATH) set(X11_xkbfile_FOUND TRUE) # Backwards compatibility. @@ -478,6 +519,35 @@ if (UNIX) INTERFACE_INCLUDE_DIRECTORIES "${X11_Xau_INCLUDE_PATH}") endif () + if (X11_xcb_FOUND AND NOT TARGET X11::xcb) + add_library(X11::xcb UNKNOWN IMPORTED) + set_target_properties(X11::xcb PROPERTIES + IMPORTED_LOCATION "${X11_xcb_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_xcb_INCLUDE_PATH}") + endif () + + if (X11_X11_xcb_FOUND AND NOT TARGET X11::X11_xcb) + add_library(X11::X11_xcb UNKNOWN IMPORTED) + set_target_properties(X11::X11_xcb PROPERTIES + IMPORTED_LOCATION "${X11_X11_xcb_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_X11_xcb_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::xcb;X11::X11") + endif () + + if (X11_xcb_icccm_FOUND AND NOT TARGET X11::xcb_icccm) + add_library(X11::xcb_icccm UNKNOWN IMPORTED) + set_target_properties(X11::xcb_icccm PROPERTIES + IMPORTED_LOCATION "${X11_xcb_icccm_LIB}" + INTERFACE_LINK_LIBRARIES "X11::xcb") + endif () + + if (X11_xcb_xkb_FOUND AND NOT TARGET X11::xcb_xkb) + add_library(X11::xcb_xkb UNKNOWN IMPORTED) + set_target_properties(X11::xcb_xkb PROPERTIES + IMPORTED_LOCATION "${X11_xcb_xkb_LIB}" + INTERFACE_LINK_LIBRARIES "X11::xcb") + endif () + if (X11_Xcomposite_FOUND AND NOT TARGET X11::Xcomposite) add_library(X11::Xcomposite UNKNOWN IMPORTED) set_target_properties(X11::Xcomposite PROPERTIES @@ -572,6 +642,21 @@ if (UNIX) INTERFACE_LINK_LIBRARIES "X11::X11") endif () + if (X11_xkbcommon_FOUND AND NOT TARGET X11::xkbcommon) + add_library(X11::xkbcommon UNKNOWN IMPORTED) + set_target_properties(X11::xkbcommon PROPERTIES + IMPORTED_LOCATION "${X11_xkbcommon_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_xkbcommon_INCLUDE_PATH}") + endif () + + if (X11_xkbcommon_X11_FOUND AND NOT TARGET X11::xkbcommon_X11) + add_library(X11::xkbcommon_X11 UNKNOWN IMPORTED) + set_target_properties(X11::xkbcommon_X11 PROPERTIES + IMPORTED_LOCATION "${X11_xkbcommon_X11_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_xkbcommon_X11_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::X11;X11::xkbcommon") + endif () + if (X11_xkbfile_FOUND AND NOT TARGET X11::xkbfile) add_library(X11::xkbfile UNKNOWN IMPORTED) set_target_properties(X11::xkbfile PROPERTIES @@ -668,6 +753,11 @@ if (UNIX) X11_Xext_LIB X11_Xau_LIB X11_Xau_INCLUDE_PATH + X11_xcb_LIB + X11_xcb_INCLUDE_PATH + X11_xcb_xkb_LIB + X11_X11_xcb_LIB + X11_X11_xcb_INCLUDE_PATH X11_Xlib_INCLUDE_PATH X11_Xutil_INCLUDE_PATH X11_Xcomposite_INCLUDE_PATH @@ -704,6 +794,10 @@ if (UNIX) X11_Xdmcp_INCLUDE_PATH X11_Xkb_INCLUDE_PATH X11_Xkblib_INCLUDE_PATH + X11_xkbcommon_INCLUDE_PATH + X11_xkbcommon_LIB + X11_xkbcommon_X11_INCLUDE_PATH + X11_xkbcommon_X11_LIB X11_xkbfile_INCLUDE_PATH X11_xkbfile_LIB X11_Xmu_INCLUDE_PATH diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake index dc8dd6f..87ddfcd 100644 --- a/Modules/Platform/Windows-Clang.cmake +++ b/Modules/Platform/Windows-Clang.cmake @@ -141,7 +141,7 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC" set(CMAKE_RC_PREPROCESSOR CMAKE_CXX_COMPILER) endif() if(DEFINED CMAKE_RC_PREPROCESSOR) - set(CMAKE_RC_COMPILE_OBJECT "${CMAKE_COMMAND} -E cmake_llvm_rc <OBJECT>.pp <${CMAKE_RC_PREPROCESSOR}> <DEFINES> -DRC_INVOKED <INCLUDES> <FLAGS> -clang:-MD -clang:-MF -clang:<SOURCE>.d -E <SOURCE> -- <CMAKE_RC_COMPILER> <FLAGS> /fo <OBJECT> <OBJECT>.pp") + set(CMAKE_RC_COMPILE_OBJECT "${CMAKE_COMMAND} -E cmake_llvm_rc <OBJECT>.pp <${CMAKE_RC_PREPROCESSOR}> <DEFINES> -DRC_INVOKED <INCLUDES> <FLAGS> -clang:-MD -clang:-MF -clang:<SOURCE>.d -E <SOURCE> -- <CMAKE_RC_COMPILER> <DEFINES> /fo <OBJECT> <OBJECT>.pp") if(CMAKE_GENERATOR STREQUAL "Ninja") set(CMAKE_NINJA_CMCLDEPS_RC 0) set(CMAKE_NINJA_DEP_TYPE_RC gcc) diff --git a/Modules/Platform/Windows-Intel.cmake b/Modules/Platform/Windows-Intel.cmake index 96b1760..5d8f7fc 100644 --- a/Modules/Platform/Windows-Intel.cmake +++ b/Modules/Platform/Windows-Intel.cmake @@ -11,7 +11,7 @@ set(__WINDOWS_INTEL 1) include(Platform/Windows-MSVC) macro(__windows_compiler_intel lang) __windows_compiler_msvc(${lang}) - string(REPLACE "<CMAKE_LINKER> /lib" "xilib" CMAKE_${lang}_CREATE_STATIC_LIBRARY "${CMAKE_${lang}_CREATE_STATIC_LIBRARY}") + string(REPLACE "<CMAKE_AR>" "xilib" CMAKE_${lang}_CREATE_STATIC_LIBRARY "${CMAKE_${lang}_CREATE_STATIC_LIBRARY}") foreach(rule CREATE_SHARED_LIBRARY CREATE_SHARED_MODULE LINK_EXECUTABLE) string(REPLACE "<CMAKE_LINKER>" "xilink" CMAKE_${lang}_${rule} "${CMAKE_${lang}_${rule}}") endforeach() diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index e1d6733..7ee501b 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -316,7 +316,7 @@ macro(__windows_compiler_msvc lang) "${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY}) - set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ") + set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_AR> ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ") set(CMAKE_${lang}_COMPILE_OBJECT "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <DEFINES> <INCLUDES> <FLAGS> /Fo<OBJECT> /Fd<TARGET_COMPILE_PDB>${_FS_${lang}} -c <SOURCE>${CMAKE_END_TEMP_FILE}") diff --git a/Modules/Platform/Windows-NVIDIA-CUDA.cmake b/Modules/Platform/Windows-NVIDIA-CUDA.cmake index f809094..af43f46 100644 --- a/Modules/Platform/Windows-NVIDIA-CUDA.cmake +++ b/Modules/Platform/Windows-NVIDIA-CUDA.cmake @@ -23,7 +23,7 @@ set(CMAKE_CUDA_CREATE_SHARED_LIBRARY "${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES>${__IMPLICT_LINKS} ${CMAKE_END_TEMP_FILE}") set(CMAKE_CUDA_CREATE_SHARED_MODULE ${CMAKE_CUDA_CREATE_SHARED_LIBRARY}) -set(CMAKE_CUDA_CREATE_STATIC_LIBRARY "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ") +set(CMAKE_CUDA_CREATE_STATIC_LIBRARY "<CMAKE_AR> ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ") set(CMAKE_CUDA_LINKER_SUPPORTS_PDB ON) set(CMAKE_CUDA_LINK_EXECUTABLE "${_CMAKE_VS_LINK_EXE}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES>${__IMPLICT_LINKS} ${CMAKE_END_TEMP_FILE}") |