-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
68 lines (54 loc) · 2.21 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
# SPDX-FileCopyrightText: Copyright (c) 2022 The ObjCrypto Project Authors
# SPDX-License-Identifier: BSD-2-Clause
cmake_minimum_required(VERSION 3.21)
project( objCrypto
VERSION 0.1.2
DESCRIPTION "C++ Library to encrypt and decrypt objects"
HOMEPAGE_URL "https://github.com/Quicr/objCrypto"
LANGUAGES C CXX)
set( CMAKE_CXX_STANDARD 20 )
set( CMAKE_C_STANDARD 17 )
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD_REQUIRED ON)
if ( ${APPLE} )
set( OBJ_CRYPTO_USE_BORINGSSL False CACHE BOOL "use BoringSSL SSL crypto" )
else ()
set( OBJ_CRYPTO_USE_BORINGSSL True CACHE BOOL "use BoringSSL for crypto" )
endif ()
# ObjCrypto compiler options
option( OBJ_CRYPTO_USE_BORINGSSL "Use BoringSSL for crypto" )
option( OBJ_CRYPTO_BUILD_TESTS "Build test programs" ON )
option( OBJ_CRYPTO_BUILD_SHARED "Build as dynamic library" ON )
option( OBJ_CRYPTO_INSTALL "Install library to system" ON )
message( "OBJ_CRYPTO_USE_BORINGSSL is set to ${OBJ_CRYPTO_USE_BORINGSSL}" )
message( "OBJ_CRYPTO_BUILD_TESTS is set to ${OBJ_CRYPTO_BUILD_TESTS}" )
message( "OBJ_CRYPTO_BUILD_SHARED is set to ${OBJ_CRYPTO_BUILD_SHARED}" )
message( "OBJ_CRYPTO_INSTALL is set to ${OBJ_CRYPTO_INSTALL}" )
set(BUILD_SHARED_LIBS ${OBJ_CRYPTO_BUILD_SHARED})
#find_package(Git QUIET)
#
#if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
# execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
# RESULT_VARIABLE GIT_SUBMOD_RESULT)
# if(NOT GIT_SUBMOD_RESULT EQUAL "0")
# message(FATAL_ERROR "git submodule update --init --recursive failed with ${GIT_SUBMOD_RESULT}, please checkout submodules")
# endif()
#endif()
configure_file(objCrypto.pc.in objCrypto.pc @ONLY)
# Build directories
include_directories( include )
add_subdirectory( contrib )
add_subdirectory( src )
# Test directories
if ( OBJ_CRYPTO_BUILD_TESTS )
include(CTest)
add_subdirectory( test )
add_subdirectory( example )
endif()
# Install
if ( OBJ_CRYPTO_INSTALL )
include(GNUInstallDirs)
install(FILES ${CMAKE_BINARY_DIR}/objCrypto.pc
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig)
endif()