Skip to content

Commit fbd2b2a

Browse files
committed
[install] Add rapidjson header to be able to use the lower layers of the library
1 parent 0957954 commit fbd2b2a

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ set_target_properties(open-ocpp-dynamic PROPERTIES OUTPUT_NAME "open-ocpp")
102102
# Install commands
103103
include(GNUInstallDirs)
104104

105-
file(GLOB_RECURSE PUBLIC_HEADERS RELATIVE ${CMAKE_SOURCE_DIR} "src/*.h")
105+
file(GLOB_RECURSE PUBLIC_HEADERS
106+
LIST_DIRECTORIES false RELATIVE ${CMAKE_SOURCE_DIR} "${CMAKE_SOURCE_DIR}/src/*.h")
106107

107108
install(TARGETS open-ocpp-dynamic ${OPEN_OCPP_STATIC_TARGET}
108109
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
@@ -111,6 +112,16 @@ install(TARGETS open-ocpp-dynamic ${OPEN_OCPP_STATIC_TARGET}
111112
)
112113
install(FILES ${PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openocpp)
113114

115+
file(GLOB RAPIDJSON_HEADERS
116+
LIST_DIRECTORIES false RELATIVE ${CMAKE_SOURCE_DIR} "${CMAKE_SOURCE_DIR}/3rdparty/rapidjson/include/rapidjson/*.h")
117+
file(GLOB RAPIDJSON_INTERNAL_HEADERS
118+
LIST_DIRECTORIES false RELATIVE ${CMAKE_SOURCE_DIR} "${CMAKE_SOURCE_DIR}/3rdparty/rapidjson/include/rapidjson/internal/*.h")
119+
file(GLOB RAPIDJSON_ERROR_HEADERS
120+
LIST_DIRECTORIES false RELATIVE ${CMAKE_SOURCE_DIR} "${CMAKE_SOURCE_DIR}/3rdparty/rapidjson/include/rapidjson/error/*.h")
121+
install(FILES ${RAPIDJSON_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openocpp/rapidjson)
122+
install(FILES ${RAPIDJSON_INTERNAL_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openocpp/rapidjson/internal)
123+
install(FILES ${RAPIDJSON_ERROR_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openocpp/rapidjson/error)
124+
114125
# Generate pkgconfig files
115126
set(PKG_CONFIG_LIBDIR "\${prefix}/lib")
116127
set(PKG_CONFIG_INCLUDEDIR "\${prefix}/include/openocpp")

CMakeLists_Options.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,10 @@ endif()
99
add_compile_definitions(LOG_LEVEL=${LOG_LEVEL})
1010

1111
# Static library
12-
if(NOT DEFINED BUILD_STATIC_LIBRARY)
13-
set(BUILD_STATIC_LIBRARY OFF)
14-
endif()
12+
option(BUILD_STATIC_LIBRARY "Build Open OCPP as a static library" OFF)
1513

1614
# Unit tests
17-
if(NOT DEFINED BUILD_UNIT_TESTS)
18-
set(BUILD_UNIT_TESTS ON)
19-
endif()
15+
option(BUILD_UNIT_TESTS "Build unit tests" ON)
2016

2117
# Examples
22-
if(NOT DEFINED BUILD_EXAMPLES)
23-
set(BUILD_EXAMPLES ON)
24-
endif()
18+
option(BUILD_EXAMPLES "Build examples" ON)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ The build generates 2 flavors of the **Open OCPP** librairies depending on the n
329329
* Shared : libopen-ocpp.so
330330
* Static : libopen-ocpp_static.a
331331

332-
**Note**: When using **Open OCPP** in a non GNU LGPL project, the shared library must be used in order to not contaminate your project with the LGPL licence.
332+
**Note**: When using **Open OCPP** in a non GNU LGPL project, the shared library must be used in order to not contaminate your project with the LGPL licence (see [Wikipedia GNU LGPL article](https://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License#Differences_from_the_GPL))
333333

334334
## Install and use
335335
### Installation

tests/deploy/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ along with OpenOCPP. If not, see <http://www.gnu.org/licenses/>.
2020
#include "ICentralSystemEventsHandler.h"
2121
#include "IChargePoint.h"
2222
#include "IChargePointEventsHandler.h"
23+
#include "json.h"
2324

2425
using namespace ocpp;
2526
using namespace ocpp::config;

0 commit comments

Comments
 (0)