-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
70 lines (54 loc) · 2.39 KB
/
CMakeLists.txt
File metadata and controls
70 lines (54 loc) · 2.39 KB
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
# This file is part of https://github.com/PalamaraLab/PrepareDecoding which is released under the GPL-3.0 license.
# See accompanying LICENSE and COPYING for copyright notice and full details.
cmake_minimum_required(VERSION 3.16)
message(STATUS "Using CMake version ${CMAKE_VERSION}")
include(cmake/AutodetectVcpkgToolchainFile.cmake)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
project(PrepareDecoding LANGUAGES CXX VERSION 2.2.5)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Link this 'library' to set the C++ standard / compile-time options requested
include(cmake/ProjectSettings.cmake)
add_library(project_settings INTERFACE)
target_compile_features(project_settings INTERFACE cxx_std_17)
# Link this 'library' to use the warnings specified in CompilerWarnings.cmake
add_library(project_warnings INTERFACE)
include(cmake/CompilerWarnings.cmake)
set_project_warnings(project_warnings)
# Sanitiser options if supported by compiler
include(cmake/Sanitisers.cmake)
enable_sanitisers(project_settings)
# allow for static analysis options
include(cmake/StaticAnalysers.cmake)
option(BUILD_SHARED_LIBS "Enable compilation of shared libraries" OFF)
option(ENABLE_TESTING "Enable Test Builds" ON)
add_subdirectory(src)
add_subdirectory(exe)
if(ENABLE_TESTING)
enable_testing()
add_subdirectory(test)
endif()
option(ENABLE_UNITY "Enable Unity builds of projects" OFF)
if(ENABLE_UNITY)
# Add for any project you want to apply unity builds for
set_target_properties(intro PROPERTIES UNITY_BUILD ON)
endif()
add_library(asmc::prepare_decoding ALIAS prepare_decoding_lib)
add_library(asmc::project_warnings ALIAS project_warnings)
add_library(asmc::project_settings ALIAS project_settings)
add_library(asmc::smcpp_lib ALIAS smcpp_lib)
add_executable(asmc::prepare_decoding_exe ALIAS prepare_decoding_exe)
include(GNUInstallDirs)
install(TARGETS prepare_decoding_lib project_warnings project_settings smcpp_lib EXPORT AsmcPrepareDecoding_runtime)
install(
EXPORT AsmcPrepareDecoding_runtime
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/AsmcPrepareDecoding
NAMESPACE AsmcPrepareDecoding::
FILE AsmcPrepareDecoding_Runtime.cmake
COMPONENT AsmcPrepareDecoding_Runtime
)
install(
FILES cmake/AsmcPrepareDecodingConfig.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/AsmcPrepareDecoding
)