Skip to content

Commit 2485925

Browse files
committed
Use nlohmann json as external dependency
1 parent a3ae5aa commit 2485925

File tree

9 files changed

+102
-24676
lines changed

9 files changed

+102
-24676
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
11
/deps/
22
/build/
3+
4+
#CLion-created directories.
5+
/cmake-build-debug/*
6+
/cmake-build-release/*
7+
/cmake-build-minsizerel*
8+
/cmake-build-relwithdebinfo*
9+
10+
/.idea/*

CMakeLists.txt

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1-
cmake_minimum_required(VERSION 3.0)
1+
cmake_minimum_required(VERSION 3.16)
22

33
project(sdptransform VERSION 1.2.10)
44

5-
# For CMake >= 3.1.
6-
set(CMAKE_CXX_STANDARD 14)
7-
set(CMAKE_CXX_STANDARD_REQUIRED ON)
8-
set(CMAKE_CXX_EXTENSIONS OFF)
9-
# For CMake < 3.1.
10-
add_compile_options(-std=c++14)
5+
set(CMAKE_CXX_STANDARD 17)
116

12-
add_subdirectory(test readme-helper)
7+
option(BUILD_TESTS "Build unit tests" OFF)
8+
option(BUILD_UTILS "Build utility applications" OFF)
9+
10+
find_package(nlohmann_json 3.11.3 REQUIRED)
11+
12+
if (${BUILD_TESTS})
13+
add_subdirectory(test)
14+
endif()
15+
16+
if (${BUILD_UTILS})
17+
add_subdirectory(utils)
18+
endif()
1319

1420
include_directories(${sdptransform_SOURCE_DIR}/include)
1521

@@ -24,10 +30,10 @@ set(
2430
set(
2531
HEADER_FILES
2632
include/sdptransform.hpp
27-
include/json.hpp
2833
)
2934

3035
add_library(sdptransform STATIC ${SOURCE_FILES})
36+
target_link_libraries(sdptransform PRIVATE nlohmann_json::nlohmann_json)
3137

3238
install(TARGETS sdptransform DESTINATION lib)
3339
install(FILES ${HEADER_FILES} DESTINATION include/sdptransform)

0 commit comments

Comments
 (0)