-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathCMakeLists.txt
49 lines (38 loc) · 1.54 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
# - CODA-OSS CMake Build script.
#
# Author: Scott A. Colcord
cmake_minimum_required(VERSION 3.14)
project(coda-oss)
set(CMAKE_CXX_STANDARD 14)
set(CXX_STANDARD_REQUIRED true)
if (EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
# build and package with conan
include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
conan_basic_setup()
include("${CMAKE_BINARY_DIR}/conan_paths.cmake")
endif()
if (${CMAKE_PROJECT_NAME} STREQUAL coda-oss)
# this is the top level project
# Always turn on "warnings as errors" to avoid lots of (meaningless?) build output;
# we'll dial-back warnings as necessary.
if (MSVC)
add_compile_options(/WX) # warnings as errors
add_compile_options(/MP) # multi-processor compile
elseif (UNIX)
add_compile_options(-Werror) # warnings as errors
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(CodaBuild)
coda_initialize_build()
# install our cmake build modules for downstream use
install(DIRECTORY "cmake/"
DESTINATION "${CODA_STD_PROJECT_LIB_DIR}/cmake/"
FILES_MATCHING PATTERN "*.cmake")
endif()
add_subdirectory("modules")
# generate package config, with the following paths exported
set(JARS_DIR ${CODA_STD_PROJECT_LIB_DIR} CACHE INTERNAL
"path to installed jars, needed by downstream projects")
set(SWIG_INCLUDE_DIR "${CODA_STD_PROJECT_INCLUDE_DIR}/swig" CACHE INTERNAL
"path to installed SWIG includes, needed by downstream projects")
coda_generate_package_config(JARS_DIR SWIG_INCLUDE_DIR)