diff --git a/cmake/external/jsoncpp.cmake b/cmake/external/jsoncpp.cmake index 0f0136d606c0cdae344fa33705f5fd552b41e4a2..c993ca0f4a396eb1feb4f4da56048d898502f923 100644 --- a/cmake/external/jsoncpp.cmake +++ b/cmake/external/jsoncpp.cmake @@ -17,7 +17,7 @@ INCLUDE(ExternalProject) SET(JSONCPP_SOURCES_DIR ${THIRD_PARTY_PATH}/jsoncpp) SET(JSONCPP_INSTALL_DIR ${THIRD_PARTY_PATH}/install/jsoncpp) SET(JSONCPP_INCLUDE_DIR "${JSONCPP_INSTALL_DIR}/include" CACHE PATH "jsoncpp include directory." FORCE) -SET(JSONCPP_LIBRARIES "${JSONCPP_INSTALL_DIR}/lib" CACHE FILEPATH "jsoncpp library." FORCE) +SET(JSONCPP_LIBRARIES "${JSONCPP_INSTALL_DIR}/lib/libjsoncpp.a" CACHE FILEPATH "jsoncpp library." FORCE) INCLUDE_DIRECTORIES(${JSONCPP_INCLUDE_DIR}) ExternalProject_Add( @@ -36,10 +36,12 @@ ExternalProject_Add( -DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG} -DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE} -DCMAKE_INSTALL_PREFIX=${JSONCPP_INSTALL_DIR} + -DCMAKE_INSTALL_LIBDIR=${JSONCPP_INSTALL_DIR}/lib -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=${THIRD_PARTY_BUILD_TYPE} ${EXTERNAL_OPTIONAL_ARGS} CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${JSONCPP_INSTALL_DIR} + -DCMAKE_INSTALL_LIBDIR=:PATH=${JSONCPP_INSTALL_DIR}/lib -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON -DCMAKE_BUILD_TYPE:STRING=${THIRD_PARTY_BUILD_TYPE} ) diff --git a/cube/cube-builder/CMakeLists.txt b/cube/cube-builder/CMakeLists.txt index 84fe7674dffd168784655a87e1103095077331df..08a9206aaac9f3d4add4eaed17960475e35e2676 100755 --- a/cube/cube-builder/CMakeLists.txt +++ b/cube/cube-builder/CMakeLists.txt @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License -project(cube-builder) - set(CMAKE_CXX_STANDARD 11) add_compile_options(-std=c++11) @@ -22,12 +20,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) include_directories(SYSTEM ${CMAKE_CURRENT_LIST_DIR}/include) include_directories(SYSTEM ${CMAKE_CURRENT_BINARY_DIR}/../) -find_path(JSONCPP_INCLUDE_DIR json/json.h) -set(JSONCPP_LIBRARY ${JSONCPP_INCLUDE_DIR}/../lib/libjsoncpp.a) -message(STATUS "jsoncpp include: ${JSONCPP_INCLUDE_DIR}") -include_directories(${JSONCPP_INCLUDE_DIR}) - - find_library(CURL_LIB NAMES curl) if (NOT CURL_LIB) message(FATAL_ERROR "Fail to find curl") @@ -35,9 +27,11 @@ endif() add_executable(cube-builder src/main.cpp include/cube-builder/util.h src/util.cpp src/builder_job.cpp include/cube-builder/builder_job.h include/cube-builder/define.h src/seqfile_reader.cpp include/cube-builder/seqfile_reader.h include/cube-builder/raw_reader.h include/cube-builder/vtext.h src/crovl_builder_increment.cpp include/cube-builder/crovl_builder_increment.h src/curl_simple.cpp include/cube-builder/curl_simple.h) +add_dependencies(cube-builder jsoncpp) + set(DYNAMIC_LIB gflags - ${JSONCPP_LIBRARY} + jsoncpp -lssl -lcrypto ${CURL_LIB}