Commit 603b2834 authored by gerstrong@gmail.com's avatar gerstrong@gmail.com

Cmake Find python libs adjustments for older version.

parent 70e95196
......@@ -79,17 +79,24 @@ endif(USE_SDL2)
# Use python3 for AI scripting and more!
IF(USE_PYTHON3)
# Look for Python (Version 3.0 or later is required)
FIND_PACKAGE(Python3 COMPONENTS Interpreter Development)
if(Python3_FOUND)
ADD_DEFINITIONS(-DUSE_PYTHON3=1)
INCLUDE_DIRECTORIES(${Python3_INCLUDE_DIRS})
LINK_LIBRARIES(${Python3_LIBRARIES})
message(STATUS "Python3_LIBRARIES = ${Python3_LIBRARIES}")
message(STATUS "Python3_INCLUDE_DIRS = ${Python3_INCLUDE_DIRS}")
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
FIND_PACKAGE(PythonLibs REQUIRED)
TARGET_LINK_LIBRARIES(GsKit ${PYTHON_LIBRARIES})
else()
message(FATAL_ERROR "Python3 not found!")
# Look for Python (Version 3.0 or later is required)
FIND_PACKAGE(Python3 COMPONENTS Interpreter Development)
if(Python3_FOUND)
ADD_DEFINITIONS(-DUSE_PYTHON3=1)
INCLUDE_DIRECTORIES(${Python3_INCLUDE_DIRS})
LINK_LIBRARIES(${Python3_LIBRARIES})
message(STATUS "Python3_LIBRARIES = ${Python3_LIBRARIES}")
message(STATUS "Python3_INCLUDE_DIRS = ${Python3_INCLUDE_DIRS}")
else()
message(FATAL_ERROR "Python3 not found!")
endif()
endif()
ENDIF()
......
......@@ -46,17 +46,24 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=cast-align")
# Use python3 for AI scripting and more!
# Use python3 for AI scripting and more!
IF(USE_PYTHON3)
# Look for Python (Version 3.0 or later is required)
FIND_PACKAGE(Python3 COMPONENTS Interpreter Development)
if(Python3_FOUND)
ADD_DEFINITIONS(-DUSE_PYTHON3=1)
INCLUDE_DIRECTORIES(${Python3_INCLUDE_DIRS})
LINK_LIBRARIES(${Python3_LIBRARIES})
message(STATUS "Python3_LIBRARIES = ${Python3_LIBRARIES}")
message(STATUS "Python3_INCLUDE_DIRS = ${Python3_INCLUDE_DIRS}")
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
FIND_PACKAGE(PythonLibs REQUIRED)
TARGET_LINK_LIBRARIES(GsKit ${PYTHON_LIBRARIES})
else()
message(FATAL_ERROR " Python3 not found!")
# Look for Python (Version 3.0 or later is required)
FIND_PACKAGE(Python3 COMPONENTS Interpreter Development)
if(Python3_FOUND)
ADD_DEFINITIONS(-DUSE_PYTHON3=1)
INCLUDE_DIRECTORIES(${Python3_INCLUDE_DIRS})
LINK_LIBRARIES(${Python3_LIBRARIES})
message(STATUS "Python3_LIBRARIES = ${Python3_LIBRARIES}")
message(STATUS "Python3_INCLUDE_DIRS = ${Python3_INCLUDE_DIRS}")
else()
message(FATAL_ERROR " Python3 not found!")
endif()
endif()
ENDIF()
......
......@@ -42,7 +42,7 @@ public:
void processPython();
bool loadPythonScripts(const std::string &scriptBaseName) override;
bool loadPythonScripts(const std::string &scriptBaseName);
private:
int mHealth;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment