-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
93 lines (73 loc) · 2.65 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
90
91
92
93
add_static_library(
src/coresult_with_using.cpp
include/result/coresult_with_using.h
src/coresult.cpp
include/result/coresult.h
src/result.cpp
include/result/result.h
src/result_with_using.cpp
include/result/result_with_using.h
)
#cmake_minimum_required(VERSION 3.12)
#project(dimanne_result VERSION 0.0.1 LANGUAGES CXX)
## ---- Warning guard ----
## Protect dependents from this project's warnings if the guard isn't disabled
#set(result_warning_guard "SYSTEM")
#if(result_INCLUDE_WITHOUT_SYSTEM)
#set(result_warning_guard "")
#endif()
## ---- Define library ----
#add_library(result STATIC
#src/coresult_with_using.cpp
#include/result/coresult_with_using.h
#src/coresult.cpp
#include/result/coresult.h
#src/result.cpp
#include/result/result.h
#src/result_with_using.cpp
#include/result/result_with_using.h
#)
#add_library(DimanNe::result ALIAS result)
#target_compile_features(result PUBLIC cxx_std_20)
#target_compile_options(result
#PUBLIC
#"$<$<CXX_COMPILER_ID:MSVC>:/await /permissive->")
#target_include_directories(result
#${result_warning_guard}
#INTERFACE
#"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>")
#option(RESULT_IS_BUILT_AS_A_PART_OF_MONOREPO "When ON, disables INSTALLS and omits -stdlib=libc++ flags" ON)
#if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
#if(NOT RESULT_IS_BUILT_AS_A_PART_OF_MONOREPO)
#target_compile_options(result PUBLIC -stdlib=libc++)
#target_link_options(result PUBLIC -stdlib=libc++)
#endif()
#elseif(NOT MSVC)
#message(FATAL_ERROR "Compiler not supported: ${CMAKE_CXX_COMPILER_ID}")
#endif()
## ---- Install ----
#if(NOT RESULT_IS_BUILT_AS_A_PART_OF_MONOREPO)
#include(CMakePackageConfigHelpers)
#include(GNUInstallDirs)
#set(result_directory "result-${PROJECT_VERSION}")
#set(result_include_directory "${CMAKE_INSTALL_INCLUDEDIR}/${result_directory}")
#install(TARGETS result
#EXPORT resultTargets
#INCLUDES DESTINATION "${result_include_directory}")
#set(result_install_cmakedir
#"${CMAKE_INSTALL_LIBDIR}/cmake/${result_directory}")
#write_basic_package_version_file(
#resultConfigVersion.cmake
#VERSION ${PROJECT_VERSION}
#COMPATIBILITY SameMinorVersion
#ARCH_INDEPENDENT)
#install(EXPORT resultTargets
#FILE resultConfig.cmake # Install targets directly as the config
#NAMESPACE DimanNe::
#DESTINATION "${result_install_cmakedir}")
#install(FILES
#"${PROJECT_BINARY_DIR}/resultConfigVersion.cmake"
#DESTINATION "${result_install_cmakedir}")
#install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/"
#DESTINATION "${result_include_directory}")
#endif()