-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
80 lines (66 loc) · 3.23 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
# @project optox - operator to X
# @author Erich Kobler <[email protected]>
# @date 01.07.2018
project(optoX)
cmake_minimum_required(VERSION 3.5)
##----------------------------------------------------------------------------
## CMake definitions
##----------------------------------------------------------------------------
set(CMAKE_PROPAGATE_HOST_FLAGS OFF)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
##-----------------------------------------------------------------------------
## Library output directory
##-----------------------------------------------------------------------------
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
##-----------------------------------------------------------------------------
# CUDA
##-----------------------------------------------------------------------------
find_package(CUDA 5.0 REQUIRED)
cuda_include_directories(${CUDA_INCLUDE_DIRS})
include_directories(${CUDA_INCLUDE_DIRS})
set(CUDA_SDK_ROOT_DIR $ENV{CUDA_SDK_ROOT_DIR}/common/inc)
cuda_include_directories(${CUDA_SDK_ROOT_DIR})
include_directories(${CUDA_SDK_ROOT_DIR})
##-----------------------------------------------------------------------------
# Compiler flags
##-----------------------------------------------------------------------------
include(${CMAKE_CURRENT_LIST_DIR}/settings.cmake)
##-----------------------------------------------------------------------------
## sources
##-----------------------------------------------------------------------------
include_directories(src)
add_subdirectory(src)
##-----------------------------------------------------------------------------
## optox include and library directories
##-----------------------------------------------------------------------------
set(OPTOX_LIBRARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(OPTOX_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
message(STATUS "optox include dir: ${OPTOX_INCLUDE_DIR}")
message(STATUS "optox library dir: ${OPTOX_LIBRARY_DIR}")
##-----------------------------------------------------------------------------
## interfaces
##-----------------------------------------------------------------------------
option(WITH_PYTHON "Use Python - build python interface. Requires numpy, pybind11" OFF)
if(WITH_PYTHON)
message(STATUS "[+] optox build python interfaces")
add_subdirectory(python)
else(WITH_PYTHON)
message(STATUS "[-] optox exclude python interfaces")
endif(WITH_PYTHON)
option(WITH_TENSORFLOW "Use Tensorflow - build tensorflow interface. Requires tensorflow" OFF)
if(WITH_TENSORFLOW)
message(STATUS "[+] optox build tensorflow interfaces")
add_subdirectory(tensorflow)
else(WITH_TENSORFLOW)
message(STATUS "[-] optox exclude tensorflow interfaces")
endif(WITH_TENSORFLOW)
option(WITH_PYTORCH "Use Pytorch - build pytorch interface. Requires pytorch" ON)
if(WITH_PYTORCH)
message(STATUS "[+] optox build pytorch interfaces")
add_subdirectory(pytorch)
else(WITH_PYTORCH)
message(STATUS "[-] optox exclude pytorch interfaces")
endif(WITH_PYTORCH)
enable_testing()