Skip to content

Commit

Permalink
add RapidJSON as a third_party lib
Browse files Browse the repository at this point in the history
  • Loading branch information
vigsterkr committed Apr 17, 2018
1 parent d71bda8 commit a6ed4bd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
7 changes: 6 additions & 1 deletion cmake/external/RapidJSON.cmake
Expand Up @@ -5,8 +5,13 @@ ExternalProject_Add(
PREFIX ${CMAKE_BINARY_DIR}/RapidJSON
DOWNLOAD_DIR ${THIRD_PARTY_DIR}/RapidJSON
URL https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz
URL_MD5 9665844f1fa86b3c6918a743a96b56d9
URL_MD5 badd12c511e081fec6c89c43a7027bce
CMAKE_ARGS -DINCLUDE_INSTALL_DIR:PATH=${RAPIDJSON_INCLUDE_DIR}
-DDOC_INSTALL_DIR:PATH=${THIRD_PARTY_INCLUDE_DIR}
-DLIB_INSTALL_DIR:PATH=${THIRD_PARTY_INCLUDE_DIR}
-DRAPIDJSON_BUILD_DOC:BOOL=OFF
-DRAPIDJSON_BUILD_EXAMPLES:BOOL=OFF
-DRAPIDJSON_BUILD_TESTS:BOOL=OFF
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}${CMAKE_DEFINITIONS}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}${CMAKE_DEFINITIONS}
-DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
Expand Down
11 changes: 5 additions & 6 deletions src/shogun/CMakeLists.txt
Expand Up @@ -136,11 +136,6 @@ IF (${USE_GPL_SHOGUN})
target_include_directories(shogun_deps INTERFACE $<BUILD_INTERFACE:${SHOGUN_GPL_INCLUDE_DIR}>)
ENDIF()

# add bundled libraries to dependency
if(SHOGUN_DEPENDS)
add_dependencies(libshogun ${SHOGUN_DEPENDS})
endif()

# add target for static library if enabled
if (LIBSHOGUN_BUILD_STATIC)
add_library(shogun-static STATIC $<TARGET_OBJECTS:libshogun> ${CMAKE_CURRENT_BINARY_DIR}/lib/config.h)
Expand Down Expand Up @@ -332,7 +327,7 @@ ENDIF()
include(external/RapidJSON)
SHOGUN_INCLUDE_DIRS(SCOPE PUBLIC SYSTEM
$<BUILD_INTERFACE:${RAPIDJSON_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include/shogun/lib/external/eigen>
$<INSTALL_INTERFACE:include/shogun/third_party/rapidjson>
)

SHOGUN_DEPENDENCIES(
Expand Down Expand Up @@ -436,6 +431,10 @@ IF(NOT HAVE_ARC4RANDOM)
endif()
ENDIF()

# add bundled libraries to dependency
if(SHOGUN_DEPENDS)
add_dependencies(libshogun ${SHOGUN_DEPENDS})
endif()

################## linker optimisations
OPTION(INCREMENTAL_LINKING "Enable incremantal linking")
Expand Down

0 comments on commit a6ed4bd

Please sign in to comment.