This commit is contained in:
parent
a01ae2ecfb
commit
4519f062b2
@ -39,6 +39,7 @@ This base image is designed to create statically-linked C++ executables using:
|
|||||||
8. **fmt** (10.2.1) - Modern formatting library
|
8. **fmt** (10.2.1) - Modern formatting library
|
||||||
9. **spdlog** (1.13.0) - Fast C++ logging library
|
9. **spdlog** (1.13.0) - Fast C++ logging library
|
||||||
10. **Drogon** (latest from git) - C++ web framework
|
10. **Drogon** (latest from git) - C++ web framework
|
||||||
|
11. **nlohmann/json** (3.11.3) - Modern JSON library for C++
|
||||||
|
|
||||||
### Build Characteristics
|
### Build Characteristics
|
||||||
- All libraries installed in standard `/usr/local/` location
|
- All libraries installed in standard `/usr/local/` location
|
||||||
|
@ -228,3 +228,19 @@ RUN git clone --recurse-submodules https://github.com/drogonframework/drogon.git
|
|||||||
make -j$(nproc) && \
|
make -j$(nproc) && \
|
||||||
make install && \
|
make install && \
|
||||||
cd / && rm -rf /tmp/drogon
|
cd / && rm -rf /tmp/drogon
|
||||||
|
|
||||||
|
# Build nlohmann/json library (header-only, but we'll install it properly)
|
||||||
|
ARG NLOHMANN_JSON_VERSION=3.11.3
|
||||||
|
WORKDIR /tmp
|
||||||
|
RUN curl -LO https://github.com/nlohmann/json/archive/refs/tags/v${NLOHMANN_JSON_VERSION}.tar.gz && \
|
||||||
|
tar xzf v${NLOHMANN_JSON_VERSION}.tar.gz && \
|
||||||
|
cd json-${NLOHMANN_JSON_VERSION} && \
|
||||||
|
mkdir build && cd build && \
|
||||||
|
cmake .. \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
||||||
|
-DJSON_BuildTests=OFF \
|
||||||
|
-DJSON_Install=ON && \
|
||||||
|
make -j$(nproc) && \
|
||||||
|
make install && \
|
||||||
|
cd / && rm -rf /tmp/json-${NLOHMANN_JSON_VERSION} /tmp/v${NLOHMANN_JSON_VERSION}.tar.gz
|
||||||
|
@ -50,19 +50,11 @@ target_include_directories(${PROJECT_NAME} PRIVATE
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
)
|
)
|
||||||
|
|
||||||
# External dependencies
|
|
||||||
include(FetchContent)
|
|
||||||
FetchContent_Declare(
|
|
||||||
nlohmann_json
|
|
||||||
GIT_REPOSITORY https://github.com/nlohmann/json.git
|
|
||||||
GIT_TAG v3.12.0
|
|
||||||
)
|
|
||||||
FetchContent_MakeAvailable(nlohmann_json)
|
|
||||||
|
|
||||||
# Find packages
|
# Find packages
|
||||||
set(CMAKE_PREFIX_PATH /usr/local)
|
set(CMAKE_PREFIX_PATH /usr/local)
|
||||||
find_package(OpenSSL REQUIRED)
|
find_package(OpenSSL REQUIRED)
|
||||||
find_package(Drogon CONFIG REQUIRED)
|
find_package(Drogon CONFIG REQUIRED)
|
||||||
|
find_package(nlohmann_json REQUIRED)
|
||||||
|
|
||||||
# Link libraries
|
# Link libraries
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user