-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
46 lines (36 loc) · 1.37 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
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the
# MIT License.
# --------------------------------------------------------------------------
# CMake 3.25 is required for CUDA 20.
cmake_minimum_required(VERSION 3.25 FATAL_ERROR)
project(tilefusion 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}/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)
# FIXME(ying): temporarily disable the test to refactor the copy. Make sure all
# the unit tests pass after the refactor.
option(BUILD_EXAMPLES "Build TileFusion with examples" OFF)
if(BUILD_EXAMPLES)
set(EXAMPLES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/examples/cpp")
file(GLOB SUBDIRS "${EXAMPLES_DIR}/*")
foreach(SUBDIR ${SUBDIRS})
if(IS_DIRECTORY ${SUBDIR})
add_subdirectory(${SUBDIR})
endif()
endforeach()
endif()