-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
91 lines (74 loc) · 2.49 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
86
87
88
89
90
91
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.2 FATAL_ERROR)
if (CMAKE_MAJOR_VERSION VERSION_GREATER 2)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
cmake_policy(SET CMP0026 OLD)
cmake_policy(SET CMP0042 OLD)
endif(COMMAND cmake_policy)
endif()
project (FREUD)
add_subdirectory(CMake)
# find TBB lib and includes
find_library(TBB_LIBRARY tbb
PATHS ENV TBB_LINK)
find_path(TBB_INCLUDE_DIR tbb/tbb.h
PATHS ENV TBB_INC)
include_directories(${TBB_INCLUDE_DIR})
if (TBB_LIBRARY)
mark_as_advanced(TBB_LIBRARY)
endif()
if (TBB_INCLUDE_DIR)
mark_as_advanced(TBB_INCLUDE_DIR)
endif()
# find ISPC
# find_program(ISPC_EXECUTABLE ispc)
# if (ISPC_EXECUTABLE)
# mark_as_advanced(ISPC_EXECUTABLE)
# endif()
include(FREUDCFlagsSetup)
# setup python
include(FREUDPythonSetup)
include_directories(${PYTHON_INCLUDE_DIR})
# setup cython
# include(FREUDCythonSetup)
find_package(Cython)
include(UseCython)
# Find the boost libraries and set them up
include (FREUDBoostSetup)
include_directories(SYSTEM ${Boost_INCLUDE_DIR})
# setup numpy
include (FREUDNumpySetup)
include_directories(${NUMPY_INCLUDE_DIR})
# cython uses the deprecated api, so these remain commented til further notice
# add_definitions(-DPY_ARRAY_UNIQUE_SYMBOL=PyArrayHandle)
# add_definitions(-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION)
# macros
include (FREUDMacros)
# include external source projects
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/extern)
set (UPDATE_SUBMODULES 1 CACHE BOOL "Update git submodules for dependency projects")
if (UPDATE_SUBMODULES)
message(STATUS "Updating git submodules")
execute_process(COMMAND git submodule update --init
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
else (UPDATE_SUBMODULES)
message(STATUS "Not updating git submodules")
endif (UPDATE_SUBMODULES)
# set the default install prefix
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET(CMAKE_INSTALL_PREFIX ${PYTHON_USER_SITE} CACHE PATH "Python site installation directory (defaults to USER_SITE)" FORCE)
ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
# Fixup conda linking, if this python appears to be a conda python
if (${CMAKE_MAJOR_VERSION} GREATER 2)
get_filename_component(_python_bin_dir ${PYTHON_EXECUTABLE} DIRECTORY)
if (EXISTS "${_python_bin_dir}/conda")
message("-- Detected conda python, activating workaround")
set(_using_conda On)
else()
set(_using_conda Off)
endif()
endif()
#add_subdirectory(freud)
include(freud/CMakeLists.txt)
add_subdirectory(cpp)
# add_subdirectory(doc)