|
1 | 1 | cmake_minimum_required(VERSION 3.19) |
2 | 2 | project(developer_joyofenergy_cpp) |
3 | 3 |
|
4 | | -list(APPEND CMAKE_MODULE_PATH |
5 | | - ${CMAKE_BINARY_DIR} |
6 | | - ${CMAKE_SOURCE_DIR}/cmake_module) |
7 | | -list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}) |
8 | | - |
9 | 4 | set(CMAKE_CXX_STANDARD 17) |
10 | 5 |
|
11 | | -include(conan) |
12 | | - |
13 | | -conan_cmake_configure(REQUIRES boost/1.76.0 |
14 | | - REQUIRES gtest/1.11.0 |
15 | | - REQUIRES nlohmann_json/3.9.1 |
16 | | - REQUIRES date/3.0.1 |
17 | | - OPTIONS boost:header_only=True |
18 | | - OPTIONS date:header_only=True |
19 | | - GENERATORS cmake_find_package) |
20 | | - |
21 | | -conan_cmake_autodetect(settings) |
22 | | - |
23 | | -conan_cmake_install(PATH_OR_REFERENCE . |
24 | | - BUILD missing |
25 | | - REMOTE conancenter |
26 | | - SETTINGS ${settings}) |
| 6 | +# Include CPM package manager |
| 7 | +include(cmake/CPM.cmake) |
| 8 | + |
| 9 | +# Boost (header-only libraries: Beast, Asio, System) |
| 10 | +CPMAddPackage( |
| 11 | + NAME Boost |
| 12 | + VERSION 1.84.0 |
| 13 | + URL https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.xz |
| 14 | + URL_HASH SHA256=2e64e5d79a738d0fa6fb546c6e5c2bd28f88d268a2a080546f74e5ff98f29d0e |
| 15 | + OPTIONS |
| 16 | + "BOOST_ENABLE_CMAKE ON" |
| 17 | + "BOOST_INCLUDE_LIBRARIES beast\;asio\;system" |
| 18 | +) |
| 19 | + |
| 20 | +CPMAddPackage( |
| 21 | + NAME googletest |
| 22 | + GITHUB_REPOSITORY google/googletest |
| 23 | + GIT_TAG v1.15.2 |
| 24 | + VERSION 1.15.2 |
| 25 | + OPTIONS |
| 26 | + "INSTALL_GTEST OFF" |
| 27 | + "gtest_force_shared_crt ON" |
| 28 | +) |
| 29 | + |
| 30 | +CPMAddPackage( |
| 31 | + NAME nlohmann_json |
| 32 | + GITHUB_REPOSITORY nlohmann/json |
| 33 | + VERSION 3.11.3 |
| 34 | +) |
| 35 | + |
| 36 | +CPMAddPackage( |
| 37 | + NAME date |
| 38 | + GITHUB_REPOSITORY HowardHinnant/date |
| 39 | + GIT_TAG v3.0.4 |
| 40 | + OPTIONS |
| 41 | + "USE_SYSTEM_TZ_DB ON" |
| 42 | + "BUILD_TZ_LIB OFF" |
| 43 | +) |
27 | 44 |
|
28 | 45 | add_subdirectory(rest) |
29 | 46 | add_executable(app main.cpp) |
|
0 commit comments