11cmake_minimum_required (VERSION 3.20 )
22
3- project (ITLabAI LANGUAGES CXX )
3+ project (ITLabAI)
44
55set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type" FORCE )
66option (ITLABAI_ENABLE_SYCL "Build SYCL example and helper targets" OFF )
7- option (ITLABAI_ENABLE_OPENCV_APPS "Build OpenCV-dependent apps" ON )
8- option (ITLABAI_BUILD_TESTS "Build unit tests" ON )
9- set (ITLABAI_SYCL_IMPLEMENTATION "AdaptiveCpp" CACHE STRING
10- "SYCL implementation to use" )
11- set_property (CACHE ITLABAI_SYCL_IMPLEMENTATION PROPERTY STRINGS AdaptiveCpp)
127set (ITLABAI_SYCL_TARGETS "" CACHE STRING
138 "Optional SYCL targets; forwarded to AdaptiveCpp as ACPP_TARGETS" )
149
@@ -29,25 +24,22 @@ option(ENABLE_STATISTIC_WEIGHTS "Enable statistic weights" OFF)
2924if (ENABLE_STATISTIC_WEIGHTS)
3025 add_definitions (-DENABLE_STATISTIC_WEIGHTS )
3126endif ()
27+
3228set (CMAKE_CXX_STANDARD 20)
3329
3430enable_testing ()
3531
36- find_package (OpenMP REQUIRED COMPONENTS CXX )
32+ find_package (OpenMP REQUIRED )
3733
3834if (OpenMP_FOUND)
3935 message (STATUS "OpenMP found - enabling parallel support" )
36+ add_definitions (-DHAS_OPENMP )
37+ link_libraries (OpenMP::OpenMP_CXX )
4038else ()
4139 message (STATUS "OpenMP not found - parallel features disabled" )
4240endif ()
4341
4442if (ITLABAI_ENABLE_SYCL)
45- if (NOT ITLABAI_SYCL_IMPLEMENTATION STREQUAL "AdaptiveCpp" )
46- message (FATAL_ERROR
47- "ITLABAI_ENABLE_SYCL=ON currently supports only "
48- "ITLABAI_SYCL_IMPLEMENTATION=AdaptiveCpp" )
49- endif ()
50-
5143 if (ITLABAI_SYCL_TARGETS)
5244 set (ACPP_TARGETS "${ITLABAI_SYCL_TARGETS} " CACHE STRING
5345 "AdaptiveCpp targets" FORCE )
@@ -64,46 +56,31 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
6456
6557add_subdirectory (3rdparty )
6658
67- if (ITLABAI_ENABLE_OPENCV_APPS)
68- include (cmake/opencv_config.cmake )
69- endif ()
59+ include (cmake/opencv_config.cmake )
7060include (cmake/kokkos_config.cmake )
7161
72- include_directories (SYSTEM "${KOKKOS_INSTALL_DIR} /include" )
62+ include_directories ("${KOKKOS_INSTALL_DIR} /include" )
7363
7464add_library (Kokkos_imported INTERFACE )
7565add_dependencies (Kokkos_imported kokkos_external )
7666
77- target_include_directories (Kokkos_imported SYSTEM INTERFACE
67+ target_include_directories (Kokkos_imported INTERFACE
7868 "${KOKKOS_INSTALL_DIR} /include"
7969)
80- target_link_directories (Kokkos_imported INTERFACE
70+
71+ target_link_directories (Kokkos_imported INTERFACE
8172 "${KOKKOS_INSTALL_DIR} /lib"
8273)
74+
75+
8376target_link_libraries (Kokkos_imported INTERFACE kokkoscore kokkoscontainers )
8477
8578
8679if (MSVC )
8780 add_compile_options (/wd4267 /wd4244 /wd4127 /wd4324 )
8881endif ()
8982
90- get_filename_component (ITLABAI_C_COMPILER_NAME "${CMAKE_C_COMPILER } " NAME )
91- get_filename_component (ITLABAI_CXX_COMPILER_NAME "${CMAKE_CXX_COMPILER } " NAME )
92- string (TOLOWER "${ITLABAI_C_COMPILER_NAME} " ITLABAI_C_COMPILER_NAME_LOWER)
93- string (TOLOWER "${ITLABAI_CXX_COMPILER_NAME} " ITLABAI_CXX_COMPILER_NAME_LOWER)
94-
95- set (ITLABAI_WINDOWS_USES_MSVC_FRONTEND OFF )
96- if (WIN32 AND (
97- ITLABAI_C_COMPILER_NAME_LOWER MATCHES "(^|-)cl(\\ .exe)?$"
98- OR ITLABAI_C_COMPILER_NAME_LOWER MATCHES "clang-cl(\\ .exe)?$"
99- OR ITLABAI_C_COMPILER_NAME_LOWER MATCHES "icx-cl(\\ .exe)?$"
100- OR ITLABAI_CXX_COMPILER_NAME_LOWER MATCHES "(^|-)cl(\\ .exe)?$"
101- OR ITLABAI_CXX_COMPILER_NAME_LOWER MATCHES "clang-cl(\\ .exe)?$"
102- OR ITLABAI_CXX_COMPILER_NAME_LOWER MATCHES "icx-cl(\\ .exe)?$" ))
103- set (ITLABAI_WINDOWS_USES_MSVC_FRONTEND ON )
104- endif ()
105-
106- if (NOT WIN32 OR NOT ITLABAI_WINDOWS_USES_MSVC_FRONTEND)
83+ if (NOT WIN32 )
10784 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS } -Wall -Wextra -Werror" )
10885 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS } -Wall -Wextra -Werror" )
10986else ()
@@ -120,7 +97,4 @@ endforeach()
12097add_subdirectory (app )
12198add_subdirectory (include )
12299add_subdirectory (src )
123-
124- if (ITLABAI_BUILD_TESTS)
125- add_subdirectory (test )
126- endif ()
100+ add_subdirectory (test )
0 commit comments