-
-
Notifications
You must be signed in to change notification settings - Fork 166
/
Copy pathCMakeLists.txt
175 lines (156 loc) · 4.33 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
cmake_minimum_required(VERSION 3.22)
include("${PROJECT_SOURCE_DIR}/cmake/CompilerWarnings.cmake")
set(FAKER_SOURCES
modules/airline.cpp
modules/animal.cpp
modules/book.cpp
modules/color.cpp
modules/commerce.cpp
modules/company.cpp
modules/computer.cpp
modules/crypto.cpp
modules/database.cpp
modules/datatype.cpp
modules/date.cpp
modules/esport.cpp
modules/finance.cpp
modules/food.cpp
modules/git.cpp
modules/hacker.cpp
modules/helper.cpp
modules/image.cpp
modules/internet.cpp
modules/location.cpp
modules/lorem.cpp
modules/medicine.cpp
modules/movie.cpp
modules/music.cpp
modules/number.cpp
modules/person.cpp
modules/phone.cpp
modules/plant.cpp
modules/science.cpp
modules/sport.cpp
modules/string.cpp
modules/system.cpp
modules/vehicle.cpp
modules/video_game.cpp
modules/video.cpp
modules/weather.cpp
modules/word.cpp
common/format_helper.cpp
common/luhn_check.cpp
common/string_helper.cpp
)
set(FAKER_HEADERS
common/luhn_check.h
common/format_helper.h
common/algo_helper.h
common/string_helper.h
modules/plant_data.h
modules/person_data.h
modules/internet_data.h
modules/sport_data.h
modules/airline_data.h
modules/location_data.h
modules/book_data.h
modules/string_data.h
modules/video_game_data.h
modules/video_data.h
modules/medicine_data.h
modules/vehicle_data.h
modules/hacker_data.h
modules/science_data.h
modules/date_data.h
modules/system_data.h
modules/commerce_data.h
modules/computer_data.h
modules/weather_data.h
modules/music_data.h
modules/database_data.h
modules/movie_data.h
modules/food_data.h
modules/word_data.h
modules/word_store.h
modules/animal_data.h
modules/company_data.h
modules/finance_data.h
modules/phone_data.h
modules/color_data.h
modules/lorem_data.h
modules/esport_data.h
)
target_sources(${PROJECT_NAME} PRIVATE ${FAKER_SOURCES} ${FAKER_HEADERS})
target_include_directories(
${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_include_directories(
${PROJECT_NAME} PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20)
configure_compiler_warnings(${PROJECT_NAME}
"${WARNINGS_AS_ERRORS}"
"${MSVC_WARNINGS}"
"${CLANG_WARNINGS}"
"${GCC_WARNINGS}")
configure_file(
"${PROJECT_SOURCE_DIR}/cmake/Version.h.in"
"${CMAKE_BINARY_DIR}/include/faker-cxx/version.h"
@ONLY
)
include(GenerateExportHeader)
generate_export_header(${PROJECT_NAME}
BASE_NAME FAKER_CXX
EXPORT_FILE_NAME ${CMAKE_BINARY_DIR}/include/faker-cxx/export.h
)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_VISIBILITY_PRESET hidden
CMAKE_VISIBILITY_INLINES_HIDDEN 1
VERSION ${CMAKE_PROJECT_VERSION}
SOVERSION ${CMAKE_PROJECT_VERSION_MAJOR}
)
target_include_directories(
${PROJECT_NAME}
PUBLIC $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
PRIVATE ${CMAKE_BINARY_DIR}/include
)
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
configure_file(
"${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}.pc.in"
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc"
@ONLY
)
write_basic_package_version_file(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${CMAKE_PROJECT_VERSION}
COMPATIBILITY SameMajorVersion)
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}-targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/faker-cxx
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING
PATTERN "*.h"
)
install(DIRECTORY ${CMAKE_BINARY_DIR}/include/faker-cxx
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING
PATTERN "*.h"
)
install(FILES "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
install(FILES
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake
)
install(EXPORT ${PROJECT_NAME}-targets
NAMESPACE ${PROJECT_NAME}::
FILE ${PROJECT_NAME}-config.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake
)