Skip to content

Commit 4dadb14

Browse files
Fix Python include issue introduced in 17d4cb2
The CMake FOUND variable is different for CMake < 3.12 Allow to work on Ubuntu 18.04 with ROS Melodic and CMake 3.10 Should fix #161
1 parent 22df486 commit 4dadb14

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

ct_core/CMakeLists.txt

+9-7
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,15 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/ct/core/templateDir.h.in ${CM
9999

100100
## define the directories to be included in all ct_core targets
101101
list(APPEND ct_core_target_include_dirs ${EIGEN3_INCLUDE_DIR})
102-
if(${Python_FOUND})
103-
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
104-
list(APPEND ct_core_target_include_dirs ${PYTHON_INCLUDE_DIRS})
105-
else()
106-
list(APPEND ct_core_target_include_dirs ${Python_INCLUDE_DIRS})
107-
list(APPEND ct_core_target_include_dirs ${Python_NumPy_INCLUDE_DIRS})
108-
endif()
102+
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
103+
if(PYTHONLIBS_FOUND)
104+
list(APPEND ct_core_target_include_dirs ${PYTHON_INCLUDE_DIRS})
105+
endif()
106+
else()
107+
if(Python_FOUND AND ${Python_VERSION_MAJOR} EQUAL 3)
108+
list(APPEND ct_core_target_include_dirs ${Python_INCLUDE_DIRS})
109+
list(APPEND ct_core_target_include_dirs ${Python_NumPy_INCLUDE_DIRS})
110+
endif()
109111
endif()
110112
list(APPEND ct_core_target_include_dirs ${QWT_INCLUDE_DIR})
111113
list(APPEND ct_core_target_include_dirs $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)

0 commit comments

Comments
 (0)