forked from TiledTensor/TiledCUDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
42 lines (33 loc) · 1.13 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
# CMake 3.25 is required for CUDA 20.
cmake_minimum_required(VERSION 3.25 FATAL_ERROR)
project(tiledcuda LANGUAGES C CXX CUDA)
# Prohibit in-source builds
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "In-source build are not supported")
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
"${PROJECT_SOURCE_DIR}/scripts/cmake")
option(WITH_TESTING "Build with CTests" ON)
if(WITH_TESTING)
enable_testing()
endif()
option(ENABLE_DEBUG "Enable debug mode" OFF)
# this is to be compatible with the latest glog. DO NOT remove it.
add_compile_definitions(GLOG_USE_GLOG_EXPORT)
include(generic)
include(dependencies)
include_directories(include)
add_subdirectory(src)
add_subdirectory(tests/cpp)
option(BUILD_EXAMPLES "Build TiledCUDA with examples" ON)
if(BUILD_EXAMPLES)
set(EXAMPLES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/examples/cpp")
file(GLOB SUBDIRS "${EXAMPLES_DIR}/*")
foreach(SUBDIR ${SUBDIRS})
message(STATUS "Add Example: ${SUBDIR}")
if(IS_DIRECTORY ${SUBDIR})
message(STATUS "Adding example: ${EXAMPLE_DIR}")
add_subdirectory(${SUBDIR})
endif()
endforeach()
endif()