Skip to content

Commit 206bd25

Browse files
committed
fix cmake to find correct boost libs based on python version
1 parent 6528796 commit 206bd25

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

Diff for: libpracmln/CMakeLists.txt

+15-2
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,26 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Warray-bounds -Wtype-limits -Wreturn-ty
3030
##################
3131

3232
## System dependencies are found with CMake's conventions
33-
find_package(PythonLibs $ENV{PYTHONDIST} REQUIRED)
33+
34+
35+
message(STATUS $ENV{PYTHONDIST})
36+
37+
if("$ENV{PYTHONDIST}" MATCHES "2.")
38+
set(PYTHONVERSION, "2.7")
39+
find_package(Boost REQUIRED COMPONENTS python)
40+
elseif("$ENV{PYTHONDIS}" MATCHES "3.")
41+
set(PYTHONVERSION, "3.5")
42+
find_package(Boost REQUIRED COMPONENTS python-py35)
43+
endif("$ENV{PYTHONDIST}" MATCHES "2.")
44+
45+
find_package(PythonLibs ${PYTHONVERSION} REQUIRED)
3446

3547
if(NOT PYTHONLIBS_FOUND)
3648
message(ERROR "PythonLibs not found!")
3749
endif()
3850

39-
find_package(Boost REQUIRED COMPONENTS python-py35)
51+
52+
message(STATUS ${Boost_LIBRARIES})
4053

4154
##################
4255
## Header files ##

0 commit comments

Comments
 (0)