-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
86 lines (59 loc) · 2.18 KB
/
CMakeLists.txt
File metadata and controls
86 lines (59 loc) · 2.18 KB
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
cmake_minimum_required(VERSION 3.20)
project(ITLabAI)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type" FORCE)
option(ENABLE_STATISTIC_TENSORS "Enable statistic tensors" OFF)
if(ENABLE_STATISTIC_TENSORS)
add_definitions(-DENABLE_STATISTIC_TENSORS)
endif()
option(ENABLE_STATISTIC_TIME "Enable statistic time" OFF)
if(ENABLE_STATISTIC_TIME)
add_definitions(-DENABLE_STATISTIC_TIME)
endif()
option(ENABLE_STATISTIC_WEIGHTS "Enable statistic weights" OFF)
if(ENABLE_STATISTIC_WEIGHTS)
add_definitions(-DENABLE_STATISTIC_WEIGHTS)
endif()
set(CMAKE_CXX_STANDARD 20)
enable_testing()
find_package(OpenMP REQUIRED)
if(OpenMP_FOUND)
message(STATUS "OpenMP found - enabling parallel support")
add_definitions(-DHAS_OPENMP)
link_libraries(OpenMP::OpenMP_CXX)
else()
message(STATUS "OpenMP not found - parallel features disabled")
endif()
include_directories("include")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
add_subdirectory(3rdparty)
include(cmake/opencv_config.cmake)
include(cmake/kokkos_config.cmake)
include_directories("${KOKKOS_INSTALL_DIR}/include")
add_library(Kokkos_imported INTERFACE)
add_dependencies(Kokkos_imported kokkos_external)
target_include_directories(Kokkos_imported INTERFACE
"${KOKKOS_INSTALL_DIR}/include"
)
target_link_directories(Kokkos_imported INTERFACE
"${KOKKOS_INSTALL_DIR}/lib"
)
target_link_libraries(Kokkos_imported INTERFACE kokkoscore kokkoscontainers)
if(MSVC)
add_compile_options(/wd4267 /wd4244 /wd4127 /wd4324)
endif()
if (NOT WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4 /wd4996 /wd4190 /wd4189 /WX")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /wd4996 /wd4190 /wd4189 /WX")
endif()
foreach(CONFIG "" _DEBUG _RELEASE)
set("CMAKE_ARCHIVE_OUTPUT_DIRECTORY${CONFIG}" "${CMAKE_BINARY_DIR}/lib")
set("CMAKE_LIBRARY_OUTPUT_DIRECTORY${CONFIG}" "${CMAKE_BINARY_DIR}/lib")
set("CMAKE_RUNTIME_OUTPUT_DIRECTORY${CONFIG}" "${CMAKE_BINARY_DIR}/bin")
endforeach()
add_subdirectory(app)
add_subdirectory(include)
add_subdirectory(src)
add_subdirectory(test)