-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
78 lines (60 loc) · 2.13 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
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(ScaRF)
##
# 2014-09-18
#
# ScaRF Project
#
# ScaRF is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ScaRF is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ScaRF. If not, see <http://www.gnu.org/licenses/>.
#
##
set(CMAKE_BUILD_TYPE DEBUG)
# Find packages
find_package(Doxygen)
find_package(CUDA REQUIRED)
find_package(Boost REQUIRED)
# Include third-party include files
include_directories(${Boost_INCLUDE_DIRS})
set(SCARF_SRC
include/scarf/DataSet.cuh
include/scarf/RFConfig.cuh
include/scarf/RF.cuh
include/scarf/InformationGain.cuh
include/scarf/Tree/Tree.cuh
include/scarf/Tree/TreeTrainingUtils.cuh
)
if(CMAKE_BUILD_TYPE MATCHES DEBUG)
set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS}; -arch=sm_20 --ptxas-options=-v)
endif(CMAKE_BUILD_TYPE MATCHES DEBUG)
cuda_include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
cuda_add_library(scarf SHARED ${SCARF_SRC})
# Set output directory for executables and libraries
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# Generate samples with 'make samples'
add_subdirectory(samples)
add_custom_target(samples
DEPENDS scarf simple_example
)
add_definitions("-Wall -Wextra -g")
# Generate Documentation with 'make doc'
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif(DOXYGEN_FOUND)