From e2c23fd5f9e1f01437fda0879e005bac8f54a8aa Mon Sep 17 00:00:00 2001 From: Toshiki Teramura Date: Thu, 20 Nov 2014 22:27:15 +0900 Subject: [PATCH] Append python version detector Slight modifications from Jim Bosch for more standard language in build system language. --- CMakeLists.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cdba6a1a..98f6a770 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,12 +31,17 @@ find_package(NumPy REQUIRED) # set(Boost_USE_STATIC_LIBS ON) # set(Boost_USE_MULTITHREADED ON) # set(Boost_USE_STATIC_RUNTIME ON) -FIND_PACKAGE(Boost COMPONENTS python REQUIRED) +if(${PYTHON_VERSION_STRING} GREATER 3.0) + message(STATUS "Using Python3") + find_package(Boost COMPONENTS python3 REQUIRED) +else() + message(STATUS "Using Python2") + find_package(Boost COMPONENTS python REQUIRED) +endif() -message( STATUS "found boost:" - "\nINCLUDE: ${Boost_INCLUDE_DIRS}" - "\nLIB: ${Boost_LIBRARIES}" -) +message( STATUS "Boost Paths:") +message( STATUS "Include : " ${Boost_INCLUDE_DIRS}) +message( STATUS "Libraries: " ${Boost_LIBRARIES}) # add_definitions( -DBOOST_ALL_NO_LIB ) # In some cases, you may need to explicitly specify that a dynamic Boost is used; if so use: