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 bf8b5e6 commit 1187954
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 211 deletions.
6 changes: 5 additions & 1 deletion config/FindDoxygenWrapper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@

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

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

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

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)
execute_process (
COMMAND ${MYSQL_CONFIG} --libs_r
OUTPUT_VARIABLE MY_TMP
OUTPUT_STRIP_TRAILING_WHITESPACE
)

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

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

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

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

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

``Python_SOABI``
.. versionadded:: 3.17

Extension suffix for modules.

Information computed from ``sysconfig.get_config_var('EXT_SUFFIX')`` or
``sysconfig.get_config_var('SOABI')`` or
``python3-config --extension-suffix``.
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.

``Python_SOSABI``
.. versionadded:: 3.26
Expand Down Expand Up @@ -325,8 +335,6 @@ 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 @@ -434,8 +442,6 @@ 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: 45 additions & 146 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,23 +112,27 @@ This module will set the following variables in your project
``Python2_STDLIB``
Standard platform independent installation directory.

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

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

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

Information returned by ``sysconfig.get_path('platlib')`` or else
``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=False)``.
Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=False)``
or else ``sysconfig.get_path('platlib')``.
``Python2_Compiler_FOUND``
System has the Python 2 compiler.
``Python2_COMPILER``
Expand Down Expand Up @@ -230,8 +234,6 @@ 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 @@ -339,8 +341,6 @@ 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: 17 additions & 11 deletions config/FindPython3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -126,28 +126,38 @@ This module will set the following variables in your project
``Python3_STDLIB``
Standard platform independent installation directory.

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

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

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

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

``Python3_SOABI``
.. versionadded:: 3.17

Extension suffix for modules.

Information computed from ``sysconfig.get_config_var('EXT_SUFFIX')`` or
``sysconfig.get_config_var('SOABI')`` or
``python3-config --extension-suffix``.
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.

``Python3_SOSABI``
.. versionadded:: 3.26
Expand Down Expand Up @@ -323,8 +333,6 @@ 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 @@ -432,8 +440,6 @@ 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: 0 additions & 13 deletions config/FindPythonInterp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
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 @@ -53,16 +50,6 @@ 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: 0 additions & 13 deletions config/FindPythonLibs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
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 @@ -48,16 +45,6 @@ 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 1187954

Please sign in to comment.