forked from cnr-isti-vclab/vcglib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
85 lines (74 loc) · 2.72 KB
/
CMakeLists.txt
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
cmake_minimum_required (VERSION 2.6)
project (vcglib)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
if (BUILD_SHARED_LIBS)
else()
set(BUILD_SHARED_LIBS on)
endif()
if (NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release)
endif()
IF (NOT CMAKE_INSTALL_RPATH)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
ENDIF()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
include_directories(${CMAKE_SOURCE_DIR})
FIND_PACKAGE(PythonInterp)
FIND_PACKAGE(PythonLibs ${PYTHON_VERSION_STRING})
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIR})
SET(
PYTHON_SITE_PACKAGES_INSTALL_DIR
${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages
)
SET(
VCGLIB_PYTHON_SITE_PACKAGES_INSTALL_DIR
${PYTHON_SITE_PACKAGES_INSTALL_DIR}/vcg
)
FIND_PACKAGE(NumPy)
INCLUDE_DIRECTORIES(${NUMPY_INCLUDE_DIRS})
SET(BOOST_COMPONENTS system serialization)
SET(VCGLIB_BP_PYTHON python3)
SET(VCGLIB_BP_NUMPY numpy3)
IF (PYTHONLIBS_VERSION_STRING VERSION_LESS 3.0)
SET(VCGLIB_BP_PYTHON python)
SET(VCGLIB_BP_NUMPY numpy)
ENDIF()
SET(VCGLIB_BP_COMPONENT ${VCGLIB_BP_PYTHON} ${VCGLIB_BP_NUMPY})
SET(BOOST_MIN_VERSION 1.53)
MESSAGE(STATUS "Finding BOOST with components=${BOOST_COMPONENTS} ${VCGLIB_BP_COMPONENT}...")
FIND_PACKAGE(Boost ${BOOST_MIN_VERSION} COMPONENTS ${BOOST_COMPONENTS} ${VCGLIB_BP_COMPONENT})
IF (NOT Boost_PYTHON_LIBRARY AND NOT Boost_PYTHON3_LIBRARY )
# Extra search on multi-python-target Gentoo systems for boost python/numpy libs
FIND_LIBRARY(
BP_PYLIB
boost_${VCGLIB_BP_PYTHON}-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}
NAMES
boost_${VCGLIB_BP_PYTHON}-${PYTHON_VERSION_MAJOR}_${PYTHON_VERSION_MINOR}
boost_python-${PYTHON_VERSION_MAJOR}_${PYTHON_VERSION_MINOR}
boost_python-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}
boost_python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}
boost_python
)
FIND_LIBRARY(
BP_NPLIB
boost_${VCGLIB_BP_NUMPY}-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}
NAMES
boost_${VCGLIB_BP_NUMPY}-${PYTHON_VERSION_MAJOR}_${PYTHON_VERSION_MINOR}
boost_numpy-${PYTHON_VERSION_MAJOR}_${PYTHON_VERSION_MINOR}
boost_numpy-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}
boost_numpy${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}
boost_numpy
)
SET(VCGLIB_BOOST_PYTHON_LIBRARIES ${BP_PYLIB})
IF ( BP_NPLIB )
SET(VCGLIB_BOOST_PYTHON_LIBRARIES ${BP_NPLIB} ${VCGLIB_BOOST_PYTHON_LIBRARIES})
ENDIF()
ELSE()
IF (PYTHONLIBS_VERSION_STRING VERSION_LESS 3.0)
SET(VCGLIB_BOOST_PYTHON_LIBRARIES ${Boost_PYTHON_LIBRARY} ${Boost_NUMPY_LIBRARY})
ELSE()
SET(VCGLIB_BOOST_PYTHON_LIBRARIES ${Boost_PYTHON3_LIBRARY} ${Boost_NUMPY3_LIBRARY})
ENDIF()
ENDIF()
add_subdirectory(python)
add_subdirectory(apps)