-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboost_util.cmake
More file actions
59 lines (49 loc) · 2.25 KB
/
boost_util.cmake
File metadata and controls
59 lines (49 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#preferred location of boost
set(BOOST_LIBRARYDIR /usr/local/lib)
set(BOOST_INCLUDEDIR /usr/local/include/boost)
find_package(Boost COMPONENTS system thread python REQUIRED)
message("boost version: ${Boost_MINOR_VERSION}")
if (${Boost_VERSION} LESS 104700)
message("using OLD boost: ${Boost_VERSION}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOLD_BOOST")
else()
message("--> using NEW boost: ${Boost_VERSION}")
endif()
message("Boost includes: ${Boost_INCLUDE_DIRS}")
message("Boost lib dirs: ${Boost_LIBRARY_DIRS}")
message("Boost libs: ${Boost_LIBRARIES}")
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/)
#temp hack
#set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /opt/local/lib)
find_package(PythonLibs 2.7 REQUIRED)
message("Python libs: " ${PYTHON_LIBRARIES})
message("Python include dir: " ${PYTHON_INCLUDE_DIRS})
if (NOT APPLE)
#set(PYTHON_MIN_VERSION "2.7")
set(OLD_PYLIBS ${PYTHON_LIBRARIES})
set(OLD_PYINCDIRS ${PYTHON_INCLUDE_DIRS})
execute_process(COMMAND "python" "$ENV{LIBPYARR_ROOT}/find_epd.py" "${PYTHON_MIN_VERSION}" OUTPUT_VARIABLE PYTHON_LIBRARIES ERROR_VARIABLE PYTHON_INCLUDE_DIRS)
if("${PYTHON_LIBRARIES}" STREQUAL "")
message("ERROR No python libraries found!!!")
message("Python min version requested: ${PYTHON_MIN_VERSION}")
message("Reverting to old pylibs: ${OLD_PYLIBS}")
set(PYTHON_LIBRARIES ${OLD_PYLIBS})
elseif("${PYTHON_INCLUDE_DIRS}" STREQUAL "")
message("ERROR No python includes found!!!")
message("Python min version requested: ${PYTHON_MIN_VERSION}")
message("Reverting to old py inc dirs: ${OLD_PYINCDIRS}")
set(PYTHON_INCLUDE_DIRS ${OLD_PYINCDIRS})
else()
message("Python libs: " ${PYTHON_LIBRARIES})
message("Python include dir: " ${PYTHON_INCLUDE_DIRS})
endif()
include_directories(/usr/include/python2.7)
endif()
include_directories(${Boost_INCLUDE_DIRS})
include_directories(${PYTHON_INCLUDE_DIRS})
include_directories(/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/)
link_directories(${Boost_LIBRARY_DIRS})
set(Boost_USE_MULTITHREADED ON)
if(LINK_PYTHON_THREADS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLINK_PYTHON_THREADS")
endif()