SINGA-229 Complete install targets Modify lib names.
Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/230230ce Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/230230ce Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/230230ce Branch: refs/heads/master Commit: 230230cea2d45cbb88a385ac6e84fe34959117e9 Parents: a0af465 Author: xiezl <[email protected]> Authored: Sat Aug 13 15:57:04 2016 +0800 Committer: xiezl <[email protected]> Committed: Sat Aug 13 15:57:04 2016 +0800 ---------------------------------------------------------------------- CMakeLists.txt | 3 ++- src/CMakeLists.txt | 10 +++++----- test/CMakeLists.txt | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/230230ce/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/CMakeLists.txt b/CMakeLists.txt index 32d3b8e..994bd51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,5 +53,6 @@ ADD_SUBDIRECTORY(examples) INSTALL(DIRECTORY include/singa DESTINATION ${CMAKE_INSTALL_PREFIX}/include) INSTALL(FILES ${CMAKE_BINARY_DIR}/include/singa/singa_config.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/singa) -INSTALL (DIRECTORY ${CMAKE_BINARY_DIR}/lib DESTINATION ${CMAKE_INSTALL_PREFIX}) +INSTALL (DIRECTORY ${CMAKE_BINARY_DIR}/lib DESTINATION ${CMAKE_INSTALL_PREFIX} + PATTERN "*libgtest.a" EXCLUDE ) #INSTALL (DIRECTORY ${CMAKE_BINARY_DIR}/bin DESTINATION ${CMAKE_INSTALL_PREFIX}) http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/230230ce/src/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 65a81fc..f6fa698 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,6 @@ -# generate protobuf sources +# generate protobuf sources -FILE(GLOB proto_files proto/*.proto) +FILE(GLOB proto_files proto/*.proto) protobuf_generate_cpp(proto_srcs proto_hdrs ${proto_files}) IF (USE_PYTHON) protobuf_generate_python(proto_pys ${proto_files}) @@ -10,16 +10,16 @@ INCLUDE_DIRECTORIES("${CMAKE_BINARY_DIR}/include") #message(STATUS "srcs: ${proto_srcs}") #message(STATUS "hdrs: ${proto_hdrs}") #message(STATUS "pys: ${proto_pys}") -ADD_LIBRARY(proto STATIC ${proto_hdrs} ${proto_srcs} ${proto_pys}) +ADD_LIBRARY(singa_proto STATIC ${proto_hdrs} ${proto_srcs} ${proto_pys}) FOREACH(fil ${proto_hdrs}) ADD_CUSTOM_COMMAND( - TARGET proto PRE_BUILD + TARGET singa_proto PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/include/singa/proto" COMMAND ${CMAKE_COMMAND} -E copy ${fil} "${CMAKE_BINARY_DIR}/include/singa/proto" #COMMAND ${CMAKE_COMMAND} -E echo "copy done" ) ENDFOREACH() -LIST(APPEND SINGA_LINKER_LIBS proto) +LIST(APPEND SINGA_LINKER_LIBS singa_proto) #FILE(GLOB_RECURSE utils_source ${CMAKE_CURRENT_SOURCE_DIR}/utils/ "*.cc") AUX_SOURCE_DIRECTORY(utils utils_source) http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/230230ce/test/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 044d65a..1c2550b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -13,5 +13,5 @@ ADD_EXECUTABLE(test_singa "gtest/gtest_main.cc" ${singa_test_source}) ADD_DEPENDENCIES(test_singa singa_core singa_utils) MESSAGE(STATUS "link libs" ${singa_linker_libs}) TARGET_LINK_LIBRARIES(test_singa gtest singa_core singa_utils singa_model - singa_io proto protobuf ${SINGA_LINKER_LIBS}) + singa_io singa_proto protobuf ${SINGA_LINKER_LIBS}) SET_TARGET_PROPERTIES(test_singa PROPERTIES LINK_FLAGS "${LINK_FLAGS} -pthread")
