summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2024-04-12 16:51:01 +0200
committerSlávek Banko <[email protected]>2024-04-12 17:07:39 +0200
commit2023e3887765bc0f2f6f4f5d4a0d59b71a4321de (patch)
treec9416fbe1fb2bfddedbd7f23d0c7608175ec975f
parentd80915dd0c305e7e29998aca38d7adfa02a08f1f (diff)
downloadtdeutils-2023e3887765bc0f2f6f4f5d4a0d59b71a4321de.tar.gz
tdeutils-2023e3887765bc0f2f6f4f5d4a0d59b71a4321de.zip
Use the new way to find Python with CMake >= 3.12.
Signed-off-by: Slávek Banko <[email protected]>
-rw-r--r--ConfigureChecks.cmake21
-rw-r--r--superkaramba/examples/globalMouse/CMakeLists.txt2
2 files changed, 20 insertions, 3 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 018df12..d1db8e3 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -201,8 +201,25 @@ endif ( BUILD_KSIM )
if ( BUILD_SUPERKARAMBA )
check_include_file( "sys/types.h" HAVE_SYS_TYPES_H )
- find_package( PythonLibs )
- if( NOT PYTHONLIBS_FOUND OR "${PYTHONLIBS_VERSION_STRING}" LESS "3" )
+ if( ${CMAKE_VERSION} VERSION_LESS "3.12" )
+ find_package( PythonLibs )
+ if( NOT PYTHONLIBS_FOUND )
+ tde_message_fatal( "Python is required, but was not found on your system" )
+ endif( NOT PYTHONLIBS_FOUND )
+ else( )
+ find_package( Python COMPONENTS Development )
+ if( NOT Python_Development_FOUND )
+ tde_message_fatal( "Python is required, but was not found on your system" )
+ endif( )
+ set( PYTHONLIBS_VERSION_STRING "${Python_VERSION}" )
+ set( PYTHON_VERSION_STRING "${Python_VERSION}" )
+ set( PYTHON_VERSION_MAJOR "${Python_VERSION_MAJOR}" )
+ set( PYTHON_VERSION_MINOR "${Python_VERSION_MINOR}" )
+ set( PYTHON_INCLUDE_DIRS "${Python_INCLUDE_DIRS}" )
+ set( PYTHON_LIBRARIES "${Python_LIBRARIES}" )
+ endif( )
+
+ if( "${PYTHONLIBS_VERSION_STRING}" LESS "3" )
tde_message_fatal( "Python3 is required, but was not found on your system" )
endif( )
diff --git a/superkaramba/examples/globalMouse/CMakeLists.txt b/superkaramba/examples/globalMouse/CMakeLists.txt
index 9df1a76..499a26b 100644
--- a/superkaramba/examples/globalMouse/CMakeLists.txt
+++ b/superkaramba/examples/globalMouse/CMakeLists.txt
@@ -1,7 +1,7 @@
##### xcursor.so #######################
include_directories(
- ${PYTHON_INCLUDE_DIR}
+ ${PYTHON_INCLUDE_DIRS}
)
tde_add_library( xcursor MODULE NO_LIBTOOL_FILE