File tree Expand file tree Collapse file tree 4 files changed +1277
-17
lines changed
Expand file tree Collapse file tree 4 files changed +1277
-17
lines changed Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.28)
22project (ncrypto)
33
4- set (CMAKE_CXX_STANDARD 20)
5- set (CMAKE_CXX_STANDARD_REQUIRED True )
4+ include (CTest)
5+ include (GNUInstallDirs)
6+ include (FetchContent)
7+ include (cmake/ncrypto-flags .cmake)
8+
69if (NOT CMAKE_BUILD_TYPE )
710 message (STATUS "No build type selected, default to Release" )
811 set (CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
912endif ()
1013
11- option (NCRYPTO_DEVELOPMENT_CHECKS "Enable development checks" OFF )
12-
13- include (GNUInstallDirs)
14- include (FetchContent)
14+ include (cmake/CPM.cmake)
1515
16- FetchContent_Declare(
17- googletest
18- URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
16+ CPMAddPackage(
17+ NAME boringssl
18+ VERSION 0.20250114.0
19+ GITHUB_REPOSITORY google/boringssl
20+ GIT_TAG 0.20250114.0
21+ OPTIONS "BUILD_SHARED_LIBS OFF"
1922)
20- # For Windows: Prevent overriding the parent project's compiler/linker settings
21- set (gtest_force_shared_crt ON CACHE BOOL "" FORCE)
22- FetchContent_MakeAvailable(googletest)
23+ message (STATUS "BoringSSL source dir: ${boringssl_SOURCE_DIR} " )
24+ include_directories (${boringssl_SOURCE_DIR} /include )
25+
26+ if (NCRYPTO_TESTING)
27+ CPMAddPackage(
28+ NAME GTest
29+ GITHUB_REPOSITORY google/googletest
30+ VERSION 1.15.2
31+ OPTIONS "BUILD_GMOCK OFF" "INSTALL_GTEST OFF"
32+ )
33+ # For Windows: Prevent overriding the parent project's compiler/linker settings
34+ set (gtest_force_shared_crt ON CACHE BOOL "" FORCE)
35+ enable_testing ()
36+ add_subdirectory (tests)
37+ endif ()
2338
2439add_subdirectory (src)
25- enable_testing ()
26- add_subdirectory (tests)
40+ add_library (ncrypto::ncrypto ALIAS ncrypto)
2741
2842install (
2943 FILES include /ncrypto.h
You can’t perform that action at this time.
0 commit comments