Skip to content

Commit a73e7d5

Browse files
committed
Added rapidjson as dependency
1 parent 70de6dd commit a73e7d5

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ if (PROFILING_MODE)
4646
else()
4747
target_link_libraries(crowdsim PUBLIC ${SDL2_LIBRARIES} external)
4848
endif()
49-
target_include_directories(crowdsim PUBLIC "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/external")
49+
target_include_directories(crowdsim PUBLIC ${PROJECT_BINARY_DIR} "${PROJECT_SOURCE_DIR}/external")

external/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Copyright (C) 2022 Codeplay Software Ltd.
22

3+
include("${CMAKE_SOURCE_DIR}/vendor/rapidjson.cmake")
4+
35
add_library(external Actor.cpp
46
Room.cpp
57
Path.cpp
@@ -10,3 +12,7 @@ add_library(external Actor.cpp
1012
RandomNumber.cpp
1113
Stats.cpp
1214
)
15+
16+
target_include_directories(external PUBLIC ${PROJECT_BINARY_DIR} ${RAPIDJSON_INCLUDE_DIR})
17+
18+
add_dependencies(external rapidjson)

external/ParseInputFile.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
#include "Actor.hpp"
3030
#include "Path.hpp"
3131
#include "Room.hpp"
32+
#include "rapidjson/document.h"
3233
#include <array>
3334
#include <fstream>
3435
#include <iostream>
35-
#include <rapidjson/document.h>
3636
#include <sstream>
3737
#include <string>
3838
#include <sycl/sycl.hpp>

vendor/rapidjson.cmake

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# (C) Andreas Zimmerer https://www.jibbow.com/posts/rapidjson-cmake/
2+
3+
include(ExternalProject)
4+
ExternalProject_Add(
5+
rapidjson
6+
PREFIX "vendor/rapidjson"
7+
GIT_REPOSITORY "https://github.com/Tencent/rapidjson.git"
8+
GIT_TAG f54b0e47a08782a6131cc3d60f94d038fa6e0a51
9+
TIMEOUT 10
10+
CMAKE_ARGS
11+
-DRAPIDJSON_BUILD_TESTS=OFF
12+
-DRAPIDJSON_BUILD_DOC=OFF
13+
-DRAPIDJSON_BUILD_EXAMPLES=OFF
14+
CONFIGURE_COMMAND ""
15+
BUILD_COMMAND ""
16+
INSTALL_COMMAND ""
17+
UPDATE_COMMAND ""
18+
)
19+
20+
ExternalProject_Get_Property(rapidjson source_dir)
21+
set(RAPIDJSON_INCLUDE_DIR ${source_dir}/include)

0 commit comments

Comments
 (0)