forked from RTKConsortium/ITKCudaCommon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
40 lines (32 loc) · 1.12 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
# Require a CMake version providing FindCUDAToolkit
cmake_minimum_required(VERSION 3.17 FATAL_ERROR)
## Only policies introduced after the cmake_minimum_required
## version need to explicitly be set to NEW.
## Refer to https://cmake.org/cmake/help/v3.11/manual/cmake-policies.7.html
set(CMAKE_POLICIES CMP0135)
foreach(p ${CMAKE_POLICIES})
if(POLICY ${p})
cmake_policy(SET ${p} NEW)
endif()
endforeach()
project(CudaCommon)
if(NOT ITK_SOURCE_DIR)
include(itk-module-init.cmake)
endif()
set(CudaCommon_LIBRARIES CudaCommon)
set(CudaCommon_INCLUDE_DIRS ${CudaCommon_SOURCE_DIR}/include ${CUDAToolkit_INCLUDE_DIRS})
# --------------------------------------------------------
# Find ITK (required)
if(NOT ITK_SOURCE_DIR)
find_package(ITK 5.2 REQUIRED)
endif()
if(NOT ITK_SOURCE_DIR)
if(NOT EXISTS ${ITK_CMAKE_DIR}/ITKModuleMacros.cmake)
message(FATAL_ERROR "Modules can only be built against an ITK build tree; they cannot be built against an ITK install tree.")
endif()
list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR})
include(ITKModuleExternal)
else()
set(ITK_DIR ${CMAKE_BINARY_DIR})
itk_module_impl()
endif()