1
0
mirror of synced 2025-01-18 00:56:49 +01:00

Fix cmake trying to remove patch version of python even if there was none

This fixes #159
This commit is contained in:
WerWolv 2021-02-15 12:44:38 +01:00
parent 5286a2d9ae
commit 096bdef25a

View File

@ -49,7 +49,12 @@ macro(findLibraries)
endif()
string(REPLACE "." ";" PYTHON_VERSION_MAJOR_MINOR ${Python_VERSION})
list(REMOVE_AT PYTHON_VERSION_MAJOR_MINOR 2)
list(LENGTH PYTHON_VERSION_MAJOR_MINOR PYTHON_VERSION_COMPONENT_COUNT)
if (PYTHON_VERSION_COMPONENT_COUNT EQUAL 3)
list(REMOVE_AT PYTHON_VERSION_MAJOR_MINOR 2)
endif ()
list(JOIN PYTHON_VERSION_MAJOR_MINOR "." PYTHON_VERSION_MAJOR_MINOR)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS} -DPYTHON_VERSION_MAJOR_MINOR=\"\\\"${PYTHON_VERSION_MAJOR_MINOR}\"\\\"")