forked from jwetzl/CudaLBFGS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
52 lines (34 loc) · 1.25 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
cmake_minimum_required(VERSION 2.8)
project(CudaLBFGS)
set(CUDALBFGS_MAJOR_VERSION 1)
set(CUDALBFGS_MINOR_VERSION 0)
set(CUDALBFGS_PATCH_VERSION 3)
set(CUDALBFGS_VERSION "${CUDALBFGS_MAJOR_VERSION}.${CUDALBFGS_MINOR_VERSION}.${CUDALBFGS_PATCH_VERSION}")
enable_testing()
# Export the package for use from the build-tree
# (this registers the build-tree with a global CMake-registry)
export(PACKAGE CudaLBFGS)
# Put all executables and libraries into the top level
# binary directory instead of into subfolders
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE})
# Where to look for Find*.cmake
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
find_package(CUDA REQUIRED)
include_directories(include)
include_directories(include/CudaLBFGS)
include(CheckComputeCapability.cmake)
# ---
option(LBFGS_CPU_DOUBLE_PRECISION "Enable double precision mode for CPU implementation")
if (LBFGS_CPU_DOUBLE_PRECISION)
add_definitions(-DLBFGS_CPU_DOUBLE_PRECISION)
endif()
# ---
file(GLOB HEADERS include/CudaLBFGS/*.h)
# ---
add_subdirectory(lbfgs)
# ---
option(BUILD_PROJECTS "Build example projects")
if (BUILD_PROJECTS)
add_subdirectory(projects)
endif()