changed: cjson handling
- probe only for system lib (i.e. only probe in prefix paths) old code ended up not installing the json lib due to finding a copy in the build folder if a reconfiguration was performed. - build internal copy static and bundle in libopm-json.so no reason to install this as a shared library. if it is updated originating from opm, the entire parser library is updated anyways.
This commit is contained in:
parent
a42b503bac
commit
303b9bc885
@ -20,10 +20,8 @@ endif (CJSON_ROOT)
|
||||
find_path (CJSON_INCLUDE_DIR
|
||||
NAMES "cjson/cJSON.h"
|
||||
HINTS "${CJSON_ROOT}"
|
||||
PATHS "${PROJECT_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}/../opm-parser"
|
||||
PATH_SUFFIXES "include" "opm/json"
|
||||
DOC "Path to cjson library header files"
|
||||
${_no_default_path} )
|
||||
DOC "Path to cjson library header files")
|
||||
|
||||
# find out the size of a pointer. this is required to only search for
|
||||
# libraries in the directories relevant for the architecture
|
||||
@ -36,13 +34,9 @@ string(REGEX REPLACE "${PROJECT_SOURCE_DIR}/?(.*)" "\\1" BUILD_DIR_SUFFIX "${PR
|
||||
find_library (CJSON_LIBRARY
|
||||
NAMES "cjson"
|
||||
HINTS "${CJSON_ROOT}"
|
||||
PATHS "${PROJECT_BINARY_DIR}/../opm-parser"
|
||||
"${PROJECT_BINARY_DIR}/../opm-parser${BUILD_DIR_SUFFIX}"
|
||||
"${PROJECT_BINARY_DIR}/../../opm-parser/${BUILD_DIR_SUFFIX}"
|
||||
PATH_SUFFIXES "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||
"opm/json"
|
||||
DOC "Path to cjson library archive/shared object files"
|
||||
${_no_default_path} )
|
||||
DOC "Path to cjson library archive/shared object files")
|
||||
|
||||
# setup list of all required libraries to link with cjson
|
||||
set (CJSON_INCLUDE_DIRS ${CJSON_INCLUDE_DIR})
|
||||
|
@ -1,9 +1,7 @@
|
||||
if (NOT HAVE_CJSON)
|
||||
add_library( cjson cjson/cJSON.c )
|
||||
add_library( cjson STATIC cjson/cJSON.c )
|
||||
set_target_properties(cjson PROPERTIES COMPILE_FLAGS -fPIC)
|
||||
set( CJSON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
install( TARGETS cjson DESTINATION ${CMAKE_INSTALL_LIBDIR} )
|
||||
install( FILES cjson/cJSON.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/cjson )
|
||||
|
||||
set( CJSON_LIBRARY cjson )
|
||||
endif()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user