diff --git a/CMakeLists.txt b/CMakeLists.txt index 5486b6f98df2ad32a75bece4eb49885c671fc9a7..3b21d33489dbce4894ae323fc62dafd5f59fdb31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,8 +65,8 @@ endif() if (NOT CLIENT_ONLY) include(external/jsoncpp) include(external/rocksdb) -include(external/gtest) endif() +#include(external/gtest) include(external/snappy) include(external/leveldb) diff --git a/cmake/external/gtest.cmake b/cmake/external/gtest.cmake index 82af574574dae191aedc785e7aa4cedcf4c88330..19616ce9488e712077200e9ba17bbac97eb8d6a9 100644 --- a/cmake/external/gtest.cmake +++ b/cmake/external/gtest.cmake @@ -28,7 +28,7 @@ ExternalProject_Add( GIT_TAG master UPDATE_COMMAND "" CONFIGURE_COMMAND "" - BUILD_COMMAND CXXFLAGS=-fPIC && mkdir build && cd build && cmake .. && make -j ${NUM_OF_PROCESSOR} gtest + BUILD_COMMAND CXXFLAGS=-fPIC && mkdir -p build && cd build && /home/users/dongdaxiang/software/cmake-3.15.2/bin/cmake .. && make -j ${NUM_OF_PROCESSOR} gtest INSTALL_COMMAND mkdir -p ${GTEST_INSTALL_DIR}/lib/ && cp ${GTEST_SOURCES_DIR}/src/extern_gtest/build/lib/libgtest.a ${GTEST_LIBRARIES} && cp -r ${GTEST_SOURCES_DIR}/src/extern_gtest/googletest/include ${GTEST_INSTALL_DIR}/ @@ -41,4 +41,3 @@ ADD_LIBRARY(gtest STATIC IMPORTED GLOBAL) SET_PROPERTY(TARGET gtest PROPERTY IMPORTED_LOCATION ${GTEST_LIBRARIES}) LIST(APPEND external_project_dependencies gtest) - diff --git a/core/cube/cube-server/CMakeLists.txt b/core/cube/cube-server/CMakeLists.txt index d9b4012409eefb9f2c1016536b09935e4a030ca7..e33b0b00de65738dbbf83c44a6af6508b96c5cb1 100644 --- a/core/cube/cube-server/CMakeLists.txt +++ b/core/cube/cube-server/CMakeLists.txt @@ -67,10 +67,10 @@ endif() target_link_libraries(cube brpc ${DYNAMIC_LIB} -lpthread -ldl -lz) -add_executable(cube_test ${SRC_LIST} test/cube_test.cpp - ${PROTO_SRC} ${PROTO_HEADER}) +#add_executable(cube_test ${SRC_LIST} test/cube_test.cpp +# ${PROTO_SRC} ${PROTO_HEADER}) -target_link_libraries(cube_test brpc ${DYNAMIC_LIB} gtest -lpthread -ldl -lz) +#target_link_libraries(cube_test brpc ${DYNAMIC_LIB} gtest -lpthread -ldl -lz) # install install(TARGETS cube diff --git a/core/kvdb/CMakeLists.txt b/core/kvdb/CMakeLists.txt index 8eb2ee42cdbe1ff3982af9d375de0d9d2434f15b..e81d32da4a54f98eeb10f2855336463c5d7e6b99 100644 --- a/core/kvdb/CMakeLists.txt +++ b/core/kvdb/CMakeLists.txt @@ -1,54 +1,21 @@ include_directories(SYSTEM ${CMAKE_CURRENT_LIST_DIR}/include) -set(SRC_LIST ${CMAKE_CURRENT_LIST_DIR}/src/test_rocksdb.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/rockskvdb_impl.cpp +set(SRC_LIST ${CMAKE_CURRENT_LIST_DIR}/src/rockskvdb_impl.cpp ${CMAKE_CURRENT_LIST_DIR}/src/param_dict_mgr_impl.cpp ${CMAKE_CURRENT_LIST_DIR}/src/mock_param_dict_impl.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/paddle_rocksdb.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/gtest_kvdb.cpp) + ${CMAKE_CURRENT_LIST_DIR}/src/paddle_rocksdb.cpp) add_library(kvdb ${SRC_LIST}) add_dependencies(kvdb rocksdb) install(TARGETS kvdb ARCHIVE DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/lib/) -add_executable(kvdb_test ${SRC_LIST}) -add_dependencies(kvdb_test rocksdb) -target_link_libraries(kvdb_test rocksdb bz2 snappy zlib gtest) -#target_include_directories(kvdb_test PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include/kvdb) -set(SRC_LIST2 ${CMAKE_CURRENT_LIST_DIR}/src/gtest_db_thread.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/rockskvdb_impl.cpp +set(SRC_LIST2 ${CMAKE_CURRENT_LIST_DIR}/src/rockskvdb_impl.cpp ${CMAKE_CURRENT_LIST_DIR}/src/param_dict_mgr_impl.cpp ${CMAKE_CURRENT_LIST_DIR}/src/mock_param_dict_impl.cpp ${CMAKE_CURRENT_LIST_DIR}/src/paddle_rocksdb.cpp) - -add_executable(db_thread ${SRC_LIST2}) -add_dependencies(db_thread rocksdb) -target_link_libraries(db_thread rocksdb bz2 snappy zlib gtest) -#target_include_directories(db_thread PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include/kvdb) - - -set(SRC_LIST3 ${CMAKE_CURRENT_LIST_DIR}/src/gtest_db_func.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/rockskvdb_impl.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/param_dict_mgr_impl.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/mock_param_dict_impl.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/paddle_rocksdb.cpp) - -add_executable(db_func ${SRC_LIST3}) -add_dependencies(db_func rocksdb) -target_link_libraries(db_func rocksdb bz2 snappy zlib gtest) -#target_include_directories(db_func PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include/kvdb) - -install(TARGETS kvdb_test - RUNTIME DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/demo/kvdb_test) -install(TARGETS db_thread - RUNTIME DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/demo/db_thread) -install(TARGETS db_func - RUNTIME DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/demo/db_func) - - file(GLOB kvdb_headers "${CMAKE_CURRENT_LIST_DIR}/include/kvdb/*.h") install(FILES ${kvdb_headers} DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/include/kvdb/) diff --git a/core/kvdb/src/gtest_db_func.cpp b/core/tests/gtest_db_func.cpp similarity index 100% rename from core/kvdb/src/gtest_db_func.cpp rename to core/tests/gtest_db_func.cpp diff --git a/core/kvdb/src/gtest_db_thread.cpp b/core/tests/gtest_db_thread.cpp similarity index 100% rename from core/kvdb/src/gtest_db_thread.cpp rename to core/tests/gtest_db_thread.cpp diff --git a/core/kvdb/src/gtest_kvdb.cpp b/core/tests/gtest_kvdb.cpp similarity index 100% rename from core/kvdb/src/gtest_kvdb.cpp rename to core/tests/gtest_kvdb.cpp diff --git a/core/kvdb/src/test_rocksdb.cpp b/core/tests/test_rocksdb.cpp similarity index 100% rename from core/kvdb/src/test_rocksdb.cpp rename to core/tests/test_rocksdb.cpp