diff options
author | Mark Janes <mark.a.janes@intel.com> | 2016-10-14 17:37:58 -0700 |
---|---|---|
committer | Mark Janes <mark.a.janes@intel.com> | 2017-06-19 14:04:49 -0700 |
commit | ec66aea1749a84385bb0aa5b2dd5ee2b8ab3d366 (patch) | |
tree | ec51bd8913ee84e7ba4a6a1638a63d50e3e413a7 | |
parent | 06941c6dcdf0d9da80e3e31ba6708054583f9bfc (diff) |
Build and link against internal protocol buffers sources
-rw-r--r-- | CMakeLists.txt | 7 | ||||
-rw-r--r-- | retrace/daemon/CMakeLists.txt | 10 | ||||
-rw-r--r-- | retrace/daemon/bargraph/test/CMakeLists.txt | 1 | ||||
-rw-r--r-- | retrace/daemon/server/CMakeLists.txt | 6 | ||||
-rw-r--r-- | retrace/daemon/test/CMakeLists.txt | 2 | ||||
-rw-r--r-- | retrace/daemon/ui/CMakeLists.txt | 2 | ||||
-rw-r--r-- | thirdparty/protobuf/cmake/CMakeLists.txt | 2 |
7 files changed, 17 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c7bac2f..d50693a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -179,7 +179,7 @@ include (CheckIncludeFileCXX) macro (add_compiler_flags) string (REPLACE ";" " " _FLAGS "${ARGV}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_FLAGS} -DGOOGLE_PROTOBUF_NO_RTTI") endmacro () macro (add_linker_flags) @@ -522,6 +522,11 @@ macro (add_gtest) add_test (NAME ${ARGV0} COMMAND $<TARGET_FILE:${ARGV0}>) endmacro () +set(protobuf_BUILD_TESTS OFF) +set(protobuf_BUILD_EXAMPLES OFF) +add_subdirectory (thirdparty/protobuf/cmake) + +enable_testing () ############################################################################## # Common libraries / utilities diff --git a/retrace/daemon/CMakeLists.txt b/retrace/daemon/CMakeLists.txt index d802106b..9adb35fb 100644 --- a/retrace/daemon/CMakeLists.txt +++ b/retrace/daemon/CMakeLists.txt @@ -1,13 +1,13 @@ include(Lint.cmake) -find_package(Protobuf REQUIRED) +include(FindProtobuf) +set (Protobuf_PROTOC_EXECUTABLE ${CMAKE_BINARY_DIR}/protoc) +set (PROTOBUF_PROTOC_EXECUTABLE ${CMAKE_BINARY_DIR}/protoc) PROTOBUF_GENERATE_CPP(ProtoSources ProtoHeaders playback.proto ) -set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGOOGLE_PROTOBUF_NO_RTTI") - include_directories ( ${CMAKE_SOURCE_DIR}/retrace ${CMAKE_SOURCE_DIR}/lib/image @@ -17,7 +17,6 @@ include_directories ( ${CMAKE_SOURCE_DIR}/helpers ${CMAKE_BINARY_DIR}/retrace/daemon ${CMAKE_SOURCE_DIR}/retrace/daemon/gldispatch - ${PROTOBUF_INCLUDE_DIR} ) set (RETRACE_LINUX_SOURCE @@ -72,8 +71,11 @@ add_library(retrace_daemon STATIC target_link_libraries(retrace_daemon glretrace_common retrace_gldispatch + libprotobuf ) +add_dependencies(retrace_daemon protoc) + if (NOT WIN32) Lint( RETRACE_SOURCES ) endif() diff --git a/retrace/daemon/bargraph/test/CMakeLists.txt b/retrace/daemon/bargraph/test/CMakeLists.txt index 46f1fc0e..94e1165a 100644 --- a/retrace/daemon/bargraph/test/CMakeLists.txt +++ b/retrace/daemon/bargraph/test/CMakeLists.txt @@ -34,6 +34,7 @@ target_link_libraries(retrace_bargraph_test retrace_ui_test_utilities retrace_bargraph retrace_gldispatch + libprotobuf gtest waffle-1 GL diff --git a/retrace/daemon/server/CMakeLists.txt b/retrace/daemon/server/CMakeLists.txt index 73a0cd74..80ffb893 100644 --- a/retrace/daemon/server/CMakeLists.txt +++ b/retrace/daemon/server/CMakeLists.txt @@ -1,8 +1,5 @@ cmake_minimum_required(VERSION 2.8) -include(FindProtobuf) -find_package(Protobuf REQUIRED) - include_directories ( ${CMAKE_SOURCE_DIR}/retrace/daemon ) @@ -26,13 +23,12 @@ else() set (THREAD_LIB pthread dl) endif() -MESSAGE (STATUS "PROTOBUF_LIBRARY: " ${PROTOBUF_LIBRARY}) target_link_libraries(frame_retrace_server retrace_daemon glretrace_common glhelpers glproc_gl - ${PROTOBUF_LIBRARY} + libprotobuf ${GL_LIB} ${X11_X11_LIB} ${THREAD_LIB} diff --git a/retrace/daemon/test/CMakeLists.txt b/retrace/daemon/test/CMakeLists.txt index 08158c61..7f653f5a 100644 --- a/retrace/daemon/test/CMakeLists.txt +++ b/retrace/daemon/test/CMakeLists.txt @@ -50,7 +50,7 @@ target_link_libraries(retrace_daemon_test retrace_gldispatch glhelpers glproc_gl - ${PROTOBUF_LIBRARY} + libprotobuf gtest ${DAEMON_TEST_OS_LIBS} ) diff --git a/retrace/daemon/ui/CMakeLists.txt b/retrace/daemon/ui/CMakeLists.txt index f8efa3b0..ac60d973 100644 --- a/retrace/daemon/ui/CMakeLists.txt +++ b/retrace/daemon/ui/CMakeLists.txt @@ -51,7 +51,7 @@ target_link_libraries(frame_retrace glretrace_common glhelpers glproc_gl - ${PROTOBUF_LIBRARY} + libprotobuf ${GL_LIB} ${X11_X11_LIB} ${THREAD_LIB} diff --git a/thirdparty/protobuf/cmake/CMakeLists.txt b/thirdparty/protobuf/cmake/CMakeLists.txt index be984bd3..06b47f77 100644 --- a/thirdparty/protobuf/cmake/CMakeLists.txt +++ b/thirdparty/protobuf/cmake/CMakeLists.txt @@ -12,7 +12,7 @@ cmake_policy(SET CMP0022 NEW) project(protobuf C CXX) # Options -option(protobuf_BUILD_TESTS "Build tests" ON) +option(protobuf_BUILD_TESTS "Build tests" OFF) option(protobuf_BUILD_EXAMPLES "Build examples" OFF) if (BUILD_SHARED_LIBS) set(protobuf_BUILD_SHARED_LIBS_DEFAULT ON) |