-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
105 lines (87 loc) · 2.88 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
93
94
95
96
97
98
99
100
101
102
103
104
105
cmake_minimum_required(VERSION 3.24)
cmake_policy(SET CMP0135 NEW)
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
set(CMAKE_CUDA_ARCHITECTURES native)
endif()
project(lala-octagon
HOMEPAGE_URL "https://github.com/lattice-land/lala-octagon"
LANGUAGES CUDA CXX)
option(GPU "GPU" ON)
option(LOCAL_DEPS "LOCAL_DEPS" OFF)
option(LALA_OCTAGON_BUILD_TESTS "LALA_OCTAGON_BUILD_TESTS" OFF)
# Dependencies
include(FetchContent)
if(LOCAL_DEPS)
FetchContent_Declare(lala_core SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../lala-core/")
else()
FetchContent_Declare(
lala_core
GIT_REPOSITORY "https://github.com/lattice-land/lala-core.git"
GIT_TAG v1.0.4
)
endif()
FetchContent_MakeAvailable(lala_core)
# Preparing the library
add_library(lala_octagon INTERFACE)
target_link_libraries(lala_octagon INTERFACE lala_core)
target_include_directories(lala_octagon INTERFACE include)
if(LALA_OCTAGON_BUILD_TESTS)
# Google Test dependency
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.14.0
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
enable_testing()
include(GoogleTest)
if(LOCAL_DEPS)
FetchContent_Declare(lala_parsing SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../lala-parsing/")
else()
FetchContent_Declare(
lala_parsing
GIT_REPOSITORY "https://github.com/lattice-land/lala-parsing.git"
GIT_TAG v1.0.3
)
endif()
FetchContent_MakeAvailable(lala_parsing)
file(GLOB cpu_test_files tests/*_test.cpp)
foreach(file ${cpu_test_files})
cmake_path(GET file STEM test_name)
add_executable(${test_name} ${file})
target_link_libraries(${test_name} lala_parsing lala_octagon gtest_main)
target_include_directories(${test_name} PRIVATE "${lala-core_SOURCE_DIR}/tests/include")
gtest_discover_tests(${test_name})
endforeach()
endif()
# Documentation
find_package(Doxygen REQUIRED doxygen)
set(DOXYGEN_PROJECT_NAME "Lattice land octagon library")
set(DOXYGEN_BUILTIN_STL_SUPPORT YES)
set(DOXYGEN_CASE_SENSE_NAMES NO)
set(DOXYGEN_CLASS_DIAGRAMS NO)
set(DOXYGEN_DISTRIBUTE_GROUP_DOC YES)
set(DOXYGEN_EXTRACT_ALL YES)
set(DOXYGEN_EXTRACT_PRIVATE NO)
set(DOXYGEN_FILE_PATTERNS *.hpp)
set(DOXYGEN_GENERATE_TREEVIEW YES)
set(DOXYGEN_HIDE_IN_BODY_DOCS YES)
set(DOXYGEN_QUIET YES)
set(DOXYGEN_RECURSIVE YES)
set(DOXYGEN_SORT_BY_SCOPE_NAME YES)
set(DOXYGEN_SORT_MEMBER_DOCS NO)
set(DOXYGEN_SOURCE_BROWSER NO)
set(DOXYGEN_STRIP_CODE_COMMENTS NO)
set(DOXYGEN_USE_MATHJAX YES)
set(DOXYGEN_EXTRA_PACKAGES stmaryrd)
set(DOXYGEN_EXCLUDE_SYMBOLS = impl)
set(DOXYGEN_ENABLE_PREPROCESSING YES)
set(DOXYGEN_PREDEFINED __NVCC__)
set(DOXYGEN_REFERENCED_BY_RELATION NO)
set(DOXYGEN_REFERENCES_RELATION NO)
doxygen_add_docs(doc_lala_octagon
"include/"
ALL
COMMENT "Generate HTML documentation")