This repository has been archived by the owner on Nov 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
CMakeLists.txt
485 lines (404 loc) · 16.7 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
#
# Rhonabwy library
#
# CMake file used to build all programs
#
# Copyright 2018 Silvio Clecio <[email protected]>
# Copyright 2021-2023 Nicolas Mora <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the MIT License
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
cmake_minimum_required(VERSION 3.5)
project(rhonabwy C)
set(CMAKE_C_STANDARD 99)
if (NOT MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror")
endif()
# library info
set(RHONABWY_LIBS )
set(PROJECT_DESCRIPTION "Javascript Object Signing and Encryption (JOSE) library - JWK, JWKS, JWS, JWE and JWT")
set(PROJECT_HOMEPAGE_URL "https://github.com/babelouest/rhonabwy/")
set(PROJECT_BUGREPORT_PATH "https://github.com/babelouest/rhonabwy/issues")
set(LIBRARY_VERSION_MAJOR "1")
set(LIBRARY_VERSION_MINOR "1")
set(LIBRARY_VERSION_PATCH "14")
set(ORCANIA_VERSION_REQUIRED "2.3.4")
set(YDER_VERSION_REQUIRED "1.4.21")
set(ULFIUS_VERSION_REQUIRED "2.7.16")
set(PROJECT_VERSION "${LIBRARY_VERSION_MAJOR}.${LIBRARY_VERSION_MINOR}.${LIBRARY_VERSION_PATCH}")
set(PROJECT_VERSION_MAJOR ${LIBRARY_VERSION_MAJOR})
set(PROJECT_VERSION_MINOR ${LIBRARY_VERSION_MINOR})
set(PROJECT_VERSION_PATCH ${LIBRARY_VERSION_PATCH})
if (${LIBRARY_VERSION_MAJOR} VERSION_LESS 10)
set (LIBRARY_VERSION_MAJOR_PAD "0${LIBRARY_VERSION_MAJOR}")
else ()
set (LIBRARY_VERSION_MAJOR_PAD "${LIBRARY_VERSION_MAJOR}")
endif ()
if (${LIBRARY_VERSION_MINOR} VERSION_LESS 10)
set (LIBRARY_VERSION_MINOR_PAD "0${LIBRARY_VERSION_MINOR}")
else ()
set (LIBRARY_VERSION_MINOR_PAD "${LIBRARY_VERSION_MINOR}")
endif ()
if (${LIBRARY_VERSION_PATCH} VERSION_LESS 10)
set (LIBRARY_VERSION_PATCH_PAD "0${LIBRARY_VERSION_PATCH}")
else ()
set (LIBRARY_VERSION_PATCH_PAD "${LIBRARY_VERSION_PATCH}")
endif ()
set(PROJECT_VERSION_NUMBER "${LIBRARY_VERSION_MAJOR_PAD}${LIBRARY_VERSION_MINOR_PAD}${LIBRARY_VERSION_PATCH_PAD}")
set(LIBRARY_VERSION "${LIBRARY_VERSION_MAJOR}.${LIBRARY_VERSION_MINOR}.${LIBRARY_VERSION_PATCH}")
set(LIBRARY_SOVERSION "${LIBRARY_VERSION_MAJOR}.${LIBRARY_VERSION_MINOR}")
# cmake modules
set(R_CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules)
list(APPEND CMAKE_MODULE_PATH "${R_CMAKE_MODULE_PATH}")
include(GNUInstallDirs)
include(CheckSymbolExists)
include(CMakeDependentOption)
include(CMakePackageConfigHelpers)
# check if _GNU_SOURCE is available
if (NOT _GNU_SOURCE)
check_symbol_exists(__GNU_LIBRARY__ "features.h" _GNU_SOURCE)
if (NOT _GNU_SOURCE)
unset(_GNU_SOURCE CACHE)
check_symbol_exists(_GNU_SOURCE "features.h" _GNU_SOURCE)
endif ()
endif ()
if (_GNU_SOURCE)
add_definitions(-D_GNU_SOURCE)
endif ()
include(FindJansson)
set(JANSSON_MIN_VERSION 2.4)
find_package(Jansson ${JANSSON_MIN_VERSION} REQUIRED)
list(APPEND RHONABWY_LIBS Jansson::Jansson)
include(FindNettle)
find_package(Nettle REQUIRED)
list(APPEND RHONABWY_LIBS Nettle::Nettle)
find_package(GnuTLS REQUIRED)
list(APPEND RHONABWY_LIBS GnuTLS::GnuTLS)
find_package(ZLIB REQUIRED)
list(APPEND RHONABWY_LIBS ZLIB::ZLIB)
option(WITH_ULFIUS "Use Ulfius library to get HTTP remote content - deprecated, use WITH_CURL instead" ON)
option(WITH_CURL "Use curl library to get HTTP remote content" ON)
if (NOT WITH_ULFIUS)
message(WARNING "Option WITH_ULFIUS is deprecated, use WITH_CURL instead")
set(WITH_CURL OFF)
endif ()
if (WITH_CURL)
find_package(CURL REQUIRED)
if (NOT TARGET CURL::libcurl)
add_library(CURL::libcurl INTERFACE IMPORTED)
set_target_properties(CURL::libcurl PROPERTIES
INTERFACE_LINK_LIBRARIES "${CURL_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}")
endif ()
list(APPEND RHONABWY_LIBS CURL::libcurl)
set(R_WITH_CURL ON)
else ()
set(R_WITH_CURL OFF)
endif ()
# directories and source
set(INC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(RNBYC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tools/rnbyc)
include_directories(${INC_DIR})
set(LIB_SRC
${INC_DIR}/rhonabwy.h
${SRC_DIR}/misc.c
${SRC_DIR}/jwk.c
${SRC_DIR}/jwks.c
${SRC_DIR}/jws.c
${SRC_DIR}/jwe.c
${SRC_DIR}/jwt.c)
set(PKGCONF_REQ "")
set(PKGCONF_REQ_PRIVATE "")
# static library
option(BUILD_STATIC "Build static library." OFF)
if (BUILD_STATIC)
add_library(rhonabwy_static STATIC ${LIB_SRC})
add_library(Rhonabwy::Rhonabwy-static ALIAS rhonabwy_static)
target_include_directories(rhonabwy_static
PUBLIC "$<BUILD_INTERFACE:${INC_DIR}>"
PUBLIC "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>"
PUBLIC "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
target_link_libraries(rhonabwy_static PUBLIC ${RHONABWY_LIBS})
target_compile_definitions(rhonabwy_static PUBLIC O_STATIC_LIBRARY)
set_target_properties(rhonabwy_static PROPERTIES
PUBLIC_HEADER "${INC_DIR}/rhonabwy.h;${PROJECT_BINARY_DIR}/rhonabwy-cfg.h"
OUTPUT_NAME rhonabwy
EXPORT_NAME Rhonabwy-static)
if (MSVC)
set_target_properties(rhonabwy_static PROPERTIES
OUTPUT_NAME rhonabwy-static)
endif ()
if (NOT MSVC)
target_compile_options(rhonabwy_static PRIVATE -Wextra -Wconversion -Wpedantic)
endif ()
set(rhonabwy_lib rhonabwy_static)
endif ()
# shared library
add_library(rhonabwy SHARED ${LIB_SRC})
add_library(Rhonabwy::Rhonabwy ALIAS rhonabwy)
target_include_directories(rhonabwy
PUBLIC "$<BUILD_INTERFACE:${INC_DIR}>"
PUBLIC "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>"
PUBLIC "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
target_link_libraries(rhonabwy PUBLIC ${RHONABWY_LIBS})
set_target_properties(rhonabwy PROPERTIES
PUBLIC_HEADER "${INC_DIR}/rhonabwy.h;${PROJECT_BINARY_DIR}/rhonabwy-cfg.h"
VERSION "${LIBRARY_VERSION}"
SOVERSION "${LIBRARY_SOVERSION}"
WINDOWS_EXPORT_ALL_SYMBOLS TRUE
EXPORT_NAME Rhonabwy)
if (WIN32)
set_target_properties(rhonabwy PROPERTIES SUFFIX "-${LIBRARY_VERSION_MAJOR}.dll")
endif ()
if (NOT MSVC)
target_compile_options(rhonabwy PRIVATE -Wextra -Wconversion -Wpedantic)
endif()
set(rhonabwy_lib rhonabwy)
find_package(Orcania ${ORCANIA_VERSION_REQUIRED} REQUIRED)
if ("${ORCANIA_VERSION_STRING}" VERSION_GREATER_EQUAL "${ORCANIA_VERSION_REQUIRED}")
message(STATUS "Orcania found: ${ORCANIA_VERSION_STRING}")
else ()
message( FATAL_ERROR "Orcania version required: ${ORCANIA_VERSION_REQUIRED} - version installed: ${ORCANIA_VERSION_STRING}")
endif ()
target_link_libraries(rhonabwy PUBLIC $<TARGET_NAME:Orcania::Orcania>)
if (BUILD_STATIC)
if(TARGET Orcania::Orcania-static)
target_link_libraries(rhonabwy_static PUBLIC $<TARGET_NAME:Orcania::Orcania-static>)
else()
target_link_libraries(rhonabwy_static PUBLIC $<TARGET_NAME:Orcania::Orcania>)
endif()
endif ()
find_package(Yder ${YDER_VERSION_REQUIRED} REQUIRED)
if ("${YDER_VERSION_STRING}" VERSION_GREATER_EQUAL "${YDER_VERSION_REQUIRED}")
message(STATUS "Yder found: ${YDER_VERSION_STRING}")
else ()
message( FATAL_ERROR "Yder version required: ${YDER_VERSION_REQUIRED} - version installed: ${YDER_VERSION_STRING}")
endif ()
target_link_libraries(rhonabwy PUBLIC $<TARGET_NAME:Yder::Yder>)
if (BUILD_STATIC)
if(TARGET Yder::Yder-static)
target_link_libraries(rhonabwy_static PUBLIC $<TARGET_NAME:Yder::Yder-static>)
else()
target_link_libraries(rhonabwy_static PUBLIC $<TARGET_NAME:Yder::Yder>)
endif()
endif ()
# build rnbyc
option(BUILD_RNBYC "Build rnbyc application." ON)
if (BUILD_RNBYC)
add_executable(rnbyc ${RNBYC_DIR}/rnbyc.c ${INC_DIR}/rhonabwy.h ${PROJECT_BINARY_DIR}/rhonabwy-cfg.h)
set_target_properties(rnbyc PROPERTIES SKIP_BUILD_RPATH TRUE COMPILE_OPTIONS "-Wextra;-Wconversion;-Wpedantic")
add_dependencies(rnbyc rhonabwy)
target_link_libraries(rnbyc rhonabwy ${RHONABWY_LIBS} Yder::Yder Orcania::Orcania)
install(TARGETS rnbyc RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${RNBYC_DIR}/rnbyc.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT runtime)
endif ()
# documentation
option(BUILD_RHONABWY_DOCUMENTATION "Build the documentation." OFF)
if (BUILD_RHONABWY_DOCUMENTATION)
find_package(Doxygen)
if (DOXYGEN_FOUND)
set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen.cfg)
set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/doxyfile)
configure_file(${doxyfile_in} ${doxyfile} @ONLY)
add_custom_target(doc
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile_in}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating documentation with Doxygen"
VERBATIM)
else ()
message(FATAL_ERROR "Doxygen is needed to build the documentation.")
endif ()
endif ()
# build rhonabwy-cfg.h file
configure_file(${INC_DIR}/rhonabwy-cfg.h.in ${PROJECT_BINARY_DIR}/rhonabwy-cfg.h)
set (CMAKE_EXTRA_INCLUDE_FILES ${PROJECT_BINARY_DIR})
include_directories(${PROJECT_BINARY_DIR})
# tests
option(BUILD_RHONABWY_TESTING "Build the testing tree." OFF) # because we do not use include(CTest)
if (BUILD_RHONABWY_TESTING)
find_package(Check REQUIRED)
if (CHECK_FOUND)
if (NOT WIN32 AND NOT APPLE)
include(FindSubunit)
find_package(Subunit REQUIRED)
endif ()
enable_testing()
set(CMAKE_CTEST_COMMAND ctest -V)
set(TEST_LIBS )
set(TST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/test)
list(APPEND TEST_LIBS Rhonabwy::Rhonabwy)
list(APPEND TEST_LIBS Check::Check)
if (NOT WIN32)
find_package(Threads REQUIRED)
list(APPEND TEST_LIBS ${CMAKE_THREAD_LIBS_INIT} m)
endif ()
if (NOT APPLE AND NOT WIN32)
list(APPEND TEST_LIBS rt)
endif ()
if (NOT WIN32 AND NOT APPLE)
list(APPEND TEST_LIBS Subunit::Subunit)
endif ()
set(TESTS
misc
cookbook
jwk_core
jwk_export
jwk_import
jwks_core
jws_core
jws_hmac
jws_ecdsa
jws_rsa
jws_rsapss
jws_json
jwe_core
jwe_rsa
jwe_aesgcm
jwe_dir
jwe_kw
jwe_rsa_oaep
jwe_ecdh
jwe_pbes2
jwe_json
jwt_core
jwt_encrypt
jwt_sign
jwt_nested
)
find_package(Ulfius ${ULFIUS_VERSION_REQUIRED} REQUIRED)
if ("${ULFIUS_VERSION_STRING}" VERSION_GREATER_EQUAL "${ULFIUS_VERSION_REQUIRED}")
message(STATUS "Ulfius found: ${ULFIUS_VERSION_STRING}")
else ()
message( FATAL_ERROR "Ulfius version required: ${ULFIUS_VERSION_REQUIRED} - version installed: ${ULFIUS_VERSION_STRING}")
endif ()
list(APPEND TEST_LIBS Ulfius::Ulfius)
configure_file(
"${R_CMAKE_MODULE_PATH}/CTestCustom.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake"
@ONLY)
foreach (t ${TESTS})
add_executable(${t} EXCLUDE_FROM_ALL ${TST_DIR}/${t}.c)
target_include_directories(${t} PRIVATE ${TST_DIR})
target_link_libraries(${t} PRIVATE ${TEST_LIBS})
add_test(NAME ${t}
WORKING_DIRECTORY ${TST_DIR}
COMMAND ${t})
endforeach ()
endif ()
endif ()
# install target
option(INSTALL_HEADER "Install the header files" ON) # Install rhonabwy.h or not
if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}")
set(PKGCONFIG_TARGET_INCLUDES "${CMAKE_INSTALL_INCLUDEDIR}")
else()
set(PKGCONFIG_TARGET_INCLUDES "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
endif()
if(IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}")
set(PKGCONFIG_TARGET_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
else()
set(PKGCONFIG_TARGET_LIBDIR "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
endif()
configure_file(librhonabwy.pc.in librhonabwy.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/librhonabwy.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
set(TARGETS rhonabwy)
if (INSTALL_HEADER)
install(TARGETS ${TARGETS} EXPORT RhonabwyExports
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
else ()
install(TARGETS ${TARGETS} EXPORT RhonabwyExports
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif ()
if (INSTALL_HEADER)
set(RHONABWY_INSTALL_CMAKEDIR_DEFAULT "${CMAKE_INSTALL_LIBDIR}/cmake/Rhonabwy")
if (WIN32 AND NOT MINGW)
set(RHONABWY_INSTALL_CMAKEDIR_DEFAULT "cmake")
endif ()
set(RHONABWY_INSTALL_CMAKEDIR ${RHONABWY_INSTALL_CMAKEDIR_DEFAULT} CACHE STRING "Location where to install the cmake config files")
install(EXPORT RhonabwyExports DESTINATION "${RHONABWY_INSTALL_CMAKEDIR}"
NAMESPACE "Rhonabwy::"
FILE "RhonabwyTargets.cmake")
configure_package_config_file(cmake-modules/RhonabwyConfig.cmake.in RhonabwyConfig.cmake
INSTALL_DESTINATION "${RHONABWY_INSTALL_CMAKEDIR}")
write_basic_package_version_file(RhonabwyConfigVersion.cmake
COMPATIBILITY AnyNewerVersion)
install(FILES
cmake-modules/FindGnuTLS.cmake
cmake-modules/FindNettle.cmake
cmake-modules/FindJansson.cmake
cmake-modules/FindMHD.cmake
"${PROJECT_BINARY_DIR}/RhonabwyConfig.cmake"
"${PROJECT_BINARY_DIR}/RhonabwyConfigVersion.cmake"
DESTINATION "${RHONABWY_INSTALL_CMAKEDIR}")
endif ()
# uninstall target
if (NOT TARGET uninstall)
configure_file(
"${R_CMAKE_MODULE_PATH}/CMakeUninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif ()
# packaging
set(CPACK_PACKAGE_VERSION_MAJOR ${LIBRARY_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${LIBRARY_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${LIBRARY_VERSION_PATCH})
if (INSTALL_HEADER)
set(PACKAGE_FILE_NAME
"lib${CMAKE_PROJECT_NAME}-dev_${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
else ()
set(PACKAGE_FILE_NAME
"lib${CMAKE_PROJECT_NAME}_${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
endif ()
set(PACKAGE_IGNORED_FILES
"${CMAKE_CURRENT_BINARY_DIR}/;/.git/;.gitignore;~$;${CPACK_SOURCE_IGNORE_FILES}")
set(CPACK_GENERATOR )
set(CPACK_PACKAGE_NAME "librhonabwy")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Handle the flow of OAuth2 and OpenID Connect authentication process from the client side")
set(CPACK_PACKAGE_VERSION_MAJOR ${LIBRARY_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${LIBRARY_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${LIBRARY_VERSION_PATCH})
set(CPACK_PACKAGE_FILE_NAME ${PACKAGE_FILE_NAME})
option(BUILD_TGZ "Build a TAR.GZ for your system" OFF)
if (BUILD_TGZ)
list(APPEND CPACK_GENERATOR TGZ)
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_PACKAGE_FILE_NAME ${PACKAGE_FILE_NAME})
set(CPACK_SOURCE_IGNORE_FILES ${PACKAGE_IGNORED_FILES})
endif ()
option(BUILD_DEB "Build a DEB for your system" OFF)
if (BUILD_DEB)
list(APPEND CPACK_GENERATOR DEB)
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "[email protected]")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION})
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/babelouest/rhonabwy")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.4), liborcania|liborcania-dev (>= ${ORCANIA_VERSION_REQUIRED}), libyder|libyder-dev (>= ${YDER_VERSION_REQUIRED})")
endif ()
option(BUILD_RPM "Build a RPM for your system" OFF)
if (BUILD_RPM)
list(APPEND CPACK_GENERATOR RPM)
set(CPACK_RPM_PACKAGE_LICENSE "LGPL")
set(CPACK_RPM_PACKAGE_URL "http://babelouest.github.io/rhonabwy/")
endif ()
include(CPack)
message(STATUS "Build testing tree: ${BUILD_RHONABWY_TESTING}")
message(STATUS "Install the header files: ${INSTALL_HEADER}")
message(STATUS "Build CLI rnbyc: ${BUILD_RNBYC}")
message(STATUS "Build Static library: ${BUILD_STATIC}")
message(STATUS "Build TAR.GZ package: ${BUILD_TGZ}")
message(STATUS "Build DEB package: ${BUILD_DEB}")
message(STATUS "Build RPM package: ${BUILD_RPM}")
message(STATUS "Build documentation: ${BUILD_RHONABWY_DOCUMENTATION}")
message(STATUS "Use libcurl for remote content: ${WITH_CURL}")