forked from janelia-flyem/buildem
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjsoncpp.cmake
46 lines (35 loc) · 1.38 KB
/
jsoncpp.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#
# Install the JsonCpp program into an OS-specific build directory
#
if (NOT jsoncpp_NAME)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
include (ExternalProject)
include (ExternalSource)
include (BuildSupport)
SET(JSONCPP_VERSION "cbe7e7c9cbd39d864588c5cf2436690634562d3f")
external_git_repo (jsoncpp
${JSONCPP_VERSION}
http://github.com/open-source-parsers/jsoncpp)
# Download jsoncpp and build it.
message ("Installing ${jsoncpp_NAME} ...")
ExternalProject_Add(${jsoncpp_NAME}
PREFIX ${BUILDEM_DIR}
GIT_REPOSITORY ${jsoncpp_URL}
GIT_TAG ${jsoncpp_TAG}
UPDATE_COMMAND ""
PATCH_COMMAND ""
CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND} ${jsoncpp_SRC_DIR}
-DCMAKE_INSTALL_PREFIX=${BUILDEM_DIR}
-DCMAKE_PREFIX_PATH=${BUILDEM_DIR}
-DCMAKE_EXE_LINKER_FLAGS=${BUILDEM_LDFLAGS}
-DDEPENDENCY_SEARCH_PREFIX=${BUILDEM_DIR}
-DJSONCPP_LIB_BUILD_SHARED=ON
-DCMAKE_CXX_FLAGS_DEBUG="${CMAKE_CXX_FLAGS_DEBUG}"
BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE)
INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install
)
set_target_properties(${jsoncpp_NAME} PROPERTIES EXCLUDE_FROM_ALL ON)
set (json_LIB ${BUILDEM_DIR}/lib/libjsoncpp.so)
set (json_INCLUDES ${BUILDEM_DIR}/include)
message ("Including JSON include files from here: ${json_INCLUDES}")
endif (NOT jsoncpp_NAME)