Skip to content

Commit df5f3d5

Browse files
bindings/CMakeLists.txt: Use the OLD cmake_policy for CMP0078.
This policy is related to the SWIG generated library name. For older versions, the name of the module and the target would be modify inside the swig_add_library function. The new version would keep the exact same name for the generated target. A constant fix for both versions would mean a change of name for the python module (which is not accepted right now). Until we find a better solution we will use the OLD behaviour for all the CMake versions (since this was proven to work until now) and we'll work on finding a better solution until the moment of deprecation. Signed-off-by: AlexandraTrifan <[email protected]>
1 parent f657b67 commit df5f3d5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

bindings/python/CMakeLists.txt

+3-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ cmake_minimum_required(VERSION 2.8.7)
33
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13.5")
44
# Check CMake Policy added in v3.13 regarding the SWIG generated target name
55
# https://cmake.org/cmake/help/v3.14/policy/CMP0078.html
6-
cmake_policy(SET CMP0078 NEW)
7-
set(SWIG_OUTPUT_NAME _libm2k)
8-
else()
9-
set(SWIG_OUTPUT_NAME libm2k)
6+
cmake_policy(SET CMP0078 OLD)
107
endif()
8+
set(SWIG_OUTPUT_NAME libm2k)
119

1210

1311
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14.7")
@@ -36,7 +34,7 @@ endif()
3634
FIND_PACKAGE(SWIG REQUIRED)
3735
include(UseSWIG)
3836

39-
INCLUDE_DIRECTORIES(${Python_INCLUDE_PATH}
37+
INCLUDE_DIRECTORIES(${Python_INCLUDE_DIRS}
4038
${CMAKE_SOURCE_DIR}/include
4139
${CMAKE_CURRENT_SOURCE_DIR})
4240

0 commit comments

Comments
 (0)