forked from microsoft/ADBench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
93 lines (73 loc) · 2.64 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
92
# CMakeList.txt : Top-level CMake project file, do global configuration
# and include sub-projects here.
#
cmake_minimum_required (VERSION 3.12)
# Set build type variable
# so RelWithDebInfo is treated as Release
if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
set(AD_BUILD_TYPE "Debug")
else ()
set(AD_BUILD_TYPE "Release")
endif ()
# $<1:> always resolves to empty string, but the fact, that a generator
# expression is used, forces Visual Studio generator to not create
# configuration-specific folders for outputs, thus making output paths
# consistent between different generators.
# See https://cmake.org/cmake/help/v3.5/prop_tgt/RUNTIME_OUTPUT_DIRECTORY.html#prop_tgt:RUNTIME_OUTPUT_DIRECTORY
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY $<1:>)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY $<1:>)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:>)
set(HUNTER_STATUS_DEBUG OFF)
set(HUNTER_BUILD_SHARED_LIBS OFF)
# Get HunterGate package manager
if(NOT DEFINED ENV{HUNTER_ROOT})
set(ENV{HUNTER_ROOT} "etc/HunterGate-Root-awf")
message(STATUS "Setting HUNTER_ROOT to $ENV{HUNTER_ROOT}")
endif()
include("etc/HunterGate.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.23.177.tar.gz"
SHA1 "c3d4bf987a1c5f8ce9bb8b2b80bc6c123185cd66"
LOCAL
)
# Declare project name
project ("ADBench")
# Get project-wide dependencies
hunter_add_package(Eigen)
find_package(Eigen3 REQUIRED)
include_directories("${EIGEN_ROOT}/share/eigen3/cmake")
include_directories("${EIGEN3_INCLUDE_DIRS}")
# Set constants
set(GMM_D_VALS 2 10 20 32 64 128)
set(GMM_K_VALS 5 10 25 50 100 200)
# TODO figure out why Ceres build crashes
# Make all platforms use .exe extensions for executables, for the
# benefit of other tooling.
set(CMAKE_EXECUTABLE_SUFFIX .exe)
# Make all platforms don't use any prefixes for libraries.
set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_SHARED_MODULE_PREFIX "")
# Make all platforms use .dll extensions for executables
# to simplify the use of modules.
set(CMAKE_SHARED_LIBRARY_SUFFIX .dll)
set(CMAKE_SHARED_MODULE_SUFFIX .dll)
# Make all platforms use similar names for release and debug binaries.
set(CMAKE_DEBUG_POSTFIX "")
# Include sub-projects.
add_subdirectory ("ADBench")
add_subdirectory ("src")
add_subdirectory ("tools")
# Enable tests
option(ENABLE_TESTS "Enable tests" ON)
if (${ENABLE_TESTS})
# Get gtest and gmock packages
hunter_add_package(GTest)
find_package (GTest CONFIG REQUIRED)
find_package(GMock CONFIG REQUIRED)
if(NOT EXISTS "${GTest_LICENSES}")
message(FATAL_ERROR "File not found: '${GTest_LICENSES}")
endif()
message("License file: '${GTest_LICENSES}'")
enable_testing()
add_subdirectory ("test")
endif()