-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
89 lines (67 loc) · 1.96 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
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
87
88
89
cmake_minimum_required(VERSION 3.24 FATAL_ERROR)
project(vc-deps VERSION 1.9.2)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/)
include(ExternalProject)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#### Options ####
option(BUILD_SHARED_LIBS "Build libraries as shared" OFF)
if(APPLE)
option(BUILD_MACOS_MULTIARCH "Build macOS universal libraries (Intel and Apple Silicon)" OFF)
endif()
#### Setup output directory if not specified ####
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/deps" CACHE PATH "Default Install Path" FORCE )
endif()
#### Global CMake arguments ####
set(GLOBAL_CMAKE_ARGS
"-DBUILD_SHARED_LIBS:STRING=${BUILD_SHARED_LIBS}"
"-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}"
"-DCMAKE_INSTALL_RPATH:PATH=${CMAKE_INSTALL_PREFIX}/lib"
"-DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}"
"-DCMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD}"
"-DCMAKE_CXX_STANDARD_REQUIRED:BOOL=${CMAKE_CXX_STANDARD_REQUIRED}"
"-DCMAKE_INSTALL_MESSAGE:STRING=${CMAKE_INSTALL_MESSAGE}"
)
set(GLOBAL_DEPENDS "")
#### Build dependencies with same release type as root project ####
if(CMAKE_BUILD_TYPE)
list(APPEND GLOBAL_CMAKE_ARGS
"-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}"
)
endif()
if(CMAKE_POSITION_INDEPENDENT_CODE)
list(APPEND GLOBAL_CMAKE_ARGS
"-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=${CMAKE_POSITION_INDEPENDENT_CODE}"
)
endif()
if(BUILD_MACOS_MULTIARCH)
list(APPEND GLOBAL_CMAKE_ARGS
"-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64;arm64"
)
endif()
#### Setup a legacy macOS build using an SDK ####
# include(InstallSDK-macOS)
#### Required libs ####
# gsl
include(BuildGSL)
# zlib
include(BuildZLIB)
# libtiff
include(BuildTIFF)
# libpng
include(BuildPNG)
# Boost
include(BuildBoost)
# Eigen
include(BuildEigen)
# VTK
include(BuildVTK)
# OpenCV
include(BuildOpenCV)
# ITK
include(BuildITK)
# ACVD
include(BuildACVD)
# spdlog
include(BuildSpdlog)