-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy pathCMakeLists.txt
61 lines (48 loc) · 2.12 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
# python_interface/CMakeLists.txt
find_package(clandmark REQUIRED)
find_package(python)
include_directories(
${CLANDMARK_INCLUDE_DIRS}
${FLANDMARK_INCLUDE_DIRS}
)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
# include_directories(${PROJECT_SOURCE_DIR}/3rd_party/rapidxml-1.13)
# include_directories(${PROJECT_SOURCE_DIR}/3rd_party/CImg-1.5.6)
# execute_process(COMMAND python -c "import numpy as np; print np.get_include()" OUTPUT_VARIABLE NUMPY_INCLUDE)
execute_process(
# COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; print('\"{}\"'.format(numpy.get_include()));"
COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; print('{}'.format(numpy.get_include()));"
ERROR_VARIABLE NUMPY_FIND_ERROR
RESULT_VARIABLE NUMPY_FIND_RESULT
OUTPUT_VARIABLE NUMPY_FIND_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "NUMPY_FIND_ERROR = ${NUMPY_FIND_ERROR}")
message(STATUS "NUMPY_FIND_RESULT = ${NUMPY_FIND_RESULT}")
message(STATUS "NUMPY_FIND_OUTPUT = ${NUMPY_FIND_OUTPUT}")
include_directories(${NUMPY_FIND_OUTPUT})
set(PY_NAME_interface python_interface)
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wlong-long -Wl,-rpath,'$ORIGIN/'")
endif(UNIX)
# if (WIN32)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /link,/rpath,$ORIGIN/")
# endif(WIN32)
#message("CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}")
# Include the CMake script UseCython.cmake. This defines add_cython_module().
# Instruction for use can be found at the top of cmake/UseCython.cmake.
include( UseCython )
# With CMake, a clean separation can be made between the source tree and the
# build tree. When all source is compiled, as with pure C/C++, the source is
# no-longer needed in the build tree. However, with pure *.py source, the
# source is processed directly. To handle this, we reproduce the availability
# of the source files in the build tree.
add_custom_target(
ReplicatePythonSourceTree ALL ${CMAKE_COMMAND} -P
${CMAKE_MODULE_PATH}/ReplicatePythonSourceTree.cmake
${CMAKE_CURRENT_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
# Process the CMakeLists.txt in the 'src' and 'bin' directory.
add_subdirectory(src)
add_subdirectory(bin)