Skip to content

Commit

Permalink
[Conf] Upgraded CMake files
Browse files Browse the repository at this point in the history
  • Loading branch information
da115115 committed Mar 24, 2024
1 parent efaec88 commit 7498cb7
Show file tree
Hide file tree
Showing 8 changed files with 211 additions and 112 deletions.
6 changes: 1 addition & 5 deletions config/FindDoxygenWrapper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@

# Extract the version information
if (DOXYGEN_FOUND STREQUAL "YES")
execute_process (
COMMAND ${DOXYGEN_EXECUTABLE} --version
OUTPUT_VARIABLE MY_TMP
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process (COMMAND ${DOXYGEN_EXECUTABLE} --version OUTPUT_VARIABLE MY_TMP)
set (DOXYGEN_VERSION ${MY_TMP})

# Check the version requirement only
Expand Down
20 changes: 4 additions & 16 deletions config/FindMySQL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,17 @@ if (UNIX)
if (MYSQL_CONFIG)
message (STATUS "Using mysql-config: ${MYSQL_CONFIG}")
# Set VERSION
execute_process (
COMMAND ${MYSQL_CONFIG} --version
OUTPUT_VARIABLE MY_TMP
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set (MYSQL_VERSION ${MY_TMP})
execute_process (COMMAND ${MYSQL_CONFIG} --version OUTPUT_VARIABLE MY_TMP)
set (MYSQL_VERSION ${MY_TMP})

# Set INCLUDE_DIR
execute_process (
COMMAND ${MYSQL_CONFIG} --include
OUTPUT_VARIABLE MY_TMP
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process (COMMAND ${MYSQL_CONFIG} --include OUTPUT_VARIABLE MY_TMP)

string (REGEX REPLACE "-I([^ ]*)( .*)?" "\\1" MY_TMP "${MY_TMP}")
set (MYSQL_ADD_INCLUDE_PATH ${MY_TMP} CACHE FILEPATH INTERNAL)
#message("[DEBUG] MYSQL ADD_INCLUDE_PATH : ${MYSQL_ADD_INCLUDE_PATH}")
# set LIBRARY_DIR
execute_process (
COMMAND ${MYSQL_CONFIG} --libs_r
OUTPUT_VARIABLE MY_TMP
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process (COMMAND ${MYSQL_CONFIG} --libs_r OUTPUT_VARIABLE MY_TMP)

set (MYSQL_ADD_LIBRARIES "")
string (REGEX MATCHALL "-l[^ ]*" MYSQL_LIB_LIST "${MY_TMP}")
Expand Down
28 changes: 11 additions & 17 deletions config/FindPython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -125,38 +125,28 @@ This module will set the following variables in your project
``Python_STDLIB``
Standard platform independent installation directory.

Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=False,standard_lib=True)``
or else ``sysconfig.get_path('stdlib')``.
Information returned by ``sysconfig.get_path('stdlib')``.
``Python_STDARCH``
Standard platform dependent installation directory.

Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=True)``
or else ``sysconfig.get_path('platstdlib')``.
Information returned by ``sysconfig.get_path('platstdlib')``.
``Python_SITELIB``
Third-party platform independent installation directory.

Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=False,standard_lib=False)``
or else ``sysconfig.get_path('purelib')``.
Information returned by ``sysconfig.get_path('purelib')``.
``Python_SITEARCH``
Third-party platform dependent installation directory.

Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=False)``
or else ``sysconfig.get_path('platlib')``.
Information returned by ``sysconfig.get_path('platlib')``.

``Python_SOABI``
.. versionadded:: 3.17

Extension suffix for modules.

Information computed from ``distutils.sysconfig.get_config_var('EXT_SUFFIX')``
or ``distutils.sysconfig.get_config_var('SOABI')`` or
``python3-config --extension-suffix``. If package ``distutils.sysconfig`` is
not available, ``sysconfig.get_config_var('EXT_SUFFIX')`` or
``sysconfig.get_config_var('SOABI')`` are used.
Information computed from ``sysconfig.get_config_var('EXT_SUFFIX')`` or
``sysconfig.get_config_var('SOABI')`` or
``python3-config --extension-suffix``.

``Python_SOSABI``
.. versionadded:: 3.26
Expand Down Expand Up @@ -335,6 +325,8 @@ Hints
constraints is founded.
This is the default if policy :policy:`CMP0094` is set to ``NEW``.

See also ``Python_FIND_UNVERSIONED_NAMES``.

``Python_FIND_REGISTRY``
.. versionadded:: 3.13

Expand Down Expand Up @@ -442,6 +434,8 @@ Hints
This is the default.
* ``NEVER``: The generic name are not searched at all.

See also ``Python_FIND_STRATEGY``.

Artifacts Specification
^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
191 changes: 146 additions & 45 deletions config/FindPython/Support.cmake

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions config/FindPython2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -112,27 +112,23 @@ This module will set the following variables in your project
``Python2_STDLIB``
Standard platform independent installation directory.

Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=False,standard_lib=True)``
or else ``sysconfig.get_path('stdlib')``.
Information returned by ``sysconfig.get_path('stdlib')`` or else
``distutils.sysconfig.get_python_lib(plat_specific=False,standard_lib=True)``.
``Python2_STDARCH``
Standard platform dependent installation directory.

Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=True)``
or else ``sysconfig.get_path('platstdlib')``.
Information returned by ``sysconfig.get_path('platstdlib')`` or else
``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=True)``.
``Python2_SITELIB``
Third-party platform independent installation directory.

Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=False,standard_lib=False)``
or else ``sysconfig.get_path('purelib')``.
Information returned by ``sysconfig.get_path('purelib')`` or else
``distutils.sysconfig.get_python_lib(plat_specific=False,standard_lib=False)``.
``Python2_SITEARCH``
Third-party platform dependent installation directory.

Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=False)``
or else ``sysconfig.get_path('platlib')``.
Information returned by ``sysconfig.get_path('platlib')`` or else
``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=False)``.
``Python2_Compiler_FOUND``
System has the Python 2 compiler.
``Python2_COMPILER``
Expand Down Expand Up @@ -234,6 +230,8 @@ Hints
constraints is founded.
This is the default if policy :policy:`CMP0094` is set to ``NEW``.

See also ``Python2_FIND_UNVERSIONED_NAMES``.

``Python2_FIND_REGISTRY``
.. versionadded:: 3.13

Expand Down Expand Up @@ -341,6 +339,8 @@ Hints
This is the default.
* ``NEVER``: The generic name are not searched at all.

See also ``Python2_FIND_STRATEGY``.

Artifacts Specification
^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
28 changes: 11 additions & 17 deletions config/FindPython3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -126,38 +126,28 @@ This module will set the following variables in your project
``Python3_STDLIB``
Standard platform independent installation directory.

Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=False,standard_lib=True)``
or else ``sysconfig.get_path('stdlib')``.
Information returned by ``sysconfig.get_path('stdlib')``.
``Python3_STDARCH``
Standard platform dependent installation directory.

Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=True)``
or else ``sysconfig.get_path('platstdlib')``.
Information returned by ``sysconfig.get_path('platstdlib')``.
``Python3_SITELIB``
Third-party platform independent installation directory.

Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=False,standard_lib=False)``
or else ``sysconfig.get_path('purelib')``.
Information returned by ``sysconfig.get_path('purelib')``.
``Python3_SITEARCH``
Third-party platform dependent installation directory.

Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=False)``
or else ``sysconfig.get_path('platlib')``.
Information returned by ``sysconfig.get_path('platlib')``.

``Python3_SOABI``
.. versionadded:: 3.17

Extension suffix for modules.

Information computed from ``distutils.sysconfig.get_config_var('EXT_SUFFIX')``
or ``distutils.sysconfig.get_config_var('SOABI')`` or
``python3-config --extension-suffix``. If package ``distutils.sysconfig`` is
not available, ``sysconfig.get_config_var('EXT_SUFFIX')`` or
``sysconfig.get_config_var('SOABI')`` are used.
Information computed from ``sysconfig.get_config_var('EXT_SUFFIX')`` or
``sysconfig.get_config_var('SOABI')`` or
``python3-config --extension-suffix``.

``Python3_SOSABI``
.. versionadded:: 3.26
Expand Down Expand Up @@ -333,6 +323,8 @@ Hints
constraints is founded.
This is the default if policy :policy:`CMP0094` is set to ``NEW``.

See also ``Python3_FIND_UNVERSIONED_NAMES``.

``Python3_FIND_REGISTRY``
.. versionadded:: 3.13

Expand Down Expand Up @@ -440,6 +432,8 @@ Hints
This is the default.
* ``NEVER``: The generic name are not searched at all.

See also ``Python3_FIND_STRATEGY``.

Artifacts Specification
^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
13 changes: 13 additions & 0 deletions config/FindPythonInterp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
FindPythonInterp
----------------

.. versionchanged:: 3.27
This module is available only if policy :policy:`CMP0148` is not set to ``NEW``.

.. deprecated:: 3.12

Use :module:`FindPython3`, :module:`FindPython2` or :module:`FindPython` instead.
Expand Down Expand Up @@ -50,6 +53,16 @@ of PYTHON_LIBRARIES.

#]=======================================================================]

cmake_policy(GET CMP0148 _FindPythonInterp_CMP0148)
if(_FindPythonInterp_CMP0148 STREQUAL "NEW")
message(FATAL_ERROR "The FindPythonInterp module has been removed by policy CMP0148.")
endif()

if(_FindPythonInterp_testing)
set(_FindPythonInterp_included TRUE)
return()
endif()

unset(_Python_NAMES)

set(_PYTHON1_VERSIONS 1.6 1.5)
Expand Down
13 changes: 13 additions & 0 deletions config/FindPythonLibs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
FindPythonLibs
--------------

.. versionchanged:: 3.27
This module is available only if policy :policy:`CMP0148` is not set to ``NEW``.

.. deprecated:: 3.12

Use :module:`FindPython3`, :module:`FindPython2` or :module:`FindPython` instead.
Expand Down Expand Up @@ -45,6 +48,16 @@ get the currently active Python version by default with a consistent version
of PYTHON_LIBRARIES.
#]=======================================================================]

cmake_policy(GET CMP0148 _FindPythonLibs_CMP0148)
if(_FindPythonLibs_CMP0148 STREQUAL "NEW")
message(FATAL_ERROR "The FindPythonLibs module has been removed by policy CMP0148.")
endif()

if(_FindPythonLibs_testing)
set(_FindPythonLibs_included TRUE)
return()
endif()

# Use the executable's path as a hint
set(_Python_LIBRARY_PATH_HINT)
if(IS_ABSOLUTE "${PYTHON_EXECUTABLE}")
Expand Down

0 comments on commit 7498cb7

Please sign in to comment.