From 749dfc6af2b2a81c5331f9eb6189980f44184861 2012-09-04 17:54:21 From: HanzZ Date: 2012-09-04 17:54:21 Subject: [PATCH] Use PROTOBUF_LIBRARY instead of blind libprotobuf --- diff --git a/backends/libpurple/CMakeLists.txt b/backends/libpurple/CMakeLists.txt index ad53b62b4c44b970567a0a059d6409210fd2a3fa..c40e6f124db6ece07cfdd9fcefee176aac23e8c8 100644 --- a/backends/libpurple/CMakeLists.txt +++ b/backends/libpurple/CMakeLists.txt @@ -10,8 +10,7 @@ if(CMAKE_COMPILER_IS_GNUCXX) target_link_libraries(spectrum2_libpurple_backend ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin) endif() else() -include_directories("${CMAKE_SOURCE_DIR}/msvc-deps/protobuf/libprotobuf") -target_link_libraries(spectrum2_libpurple_backend ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${LIBXML2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin libprotobuf) +target_link_libraries(spectrum2_libpurple_backend ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${LIBXML2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin ${PROTOBUF_LIBRARY}) endif() INSTALL(TARGETS spectrum2_libpurple_backend RUNTIME DESTINATION bin) diff --git a/backends/template/CMakeLists.txt b/backends/template/CMakeLists.txt index d0878729bb16d64384f49a4d6a99f062c7cabe07..d0be90ca48f6a0b1e215420c16a0145ecb4c3288 100644 --- a/backends/template/CMakeLists.txt +++ b/backends/template/CMakeLists.txt @@ -11,8 +11,7 @@ else() target_link_libraries(spectrum2_template_backend transport ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES}) endif() else() -include_directories("${CMAKE_SOURCE_DIR}/msvc-deps/protobuf/libprotobuf") -target_link_libraries(spectrum2_template_backend transport libprotobuf ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES}) +target_link_libraries(spectrum2_template_backend transport ${PROTOBUF_LIBRARY} ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES}) endif() #INSTALL(TARGETS spectrum2_template_backend RUNTIME DESTINATION bin) diff --git a/plugin/cpp/CMakeLists.txt b/plugin/cpp/CMakeLists.txt index 392008da2a09b7f7e372b47c94b89900e725842e..d80b8f599d094d8d2c4614299dfe7eb45a10a44b 100644 --- a/plugin/cpp/CMakeLists.txt +++ b/plugin/cpp/CMakeLists.txt @@ -10,9 +10,7 @@ set(EXTRA_SOURCES ${EXTRA_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/../../include/tra if (NOT WIN32) ADD_LIBRARY(transport-plugin SHARED ${HEADERS} ${SRC} ${PROTOBUF_SRC} ${PROTOBUF_HDRS} ${EXTRA_SOURCES}) else() - ADD_LIBRARY(transport-plugin STATIC ${HEADERS} ${SRC} ${EXTRA_SOURCES}) - include_directories("${CMAKE_SOURCE_DIR}/msvc-deps/protobuf/libprotobuf") - ADD_DEPENDENCIES(transport-plugin libprotobuf) + ADD_LIBRARY(transport-plugin STATIC ${HEADERS} ${SRC} ${EXTRA_SOURCES} ) endif() ADD_DEPENDENCIES(transport-plugin pb) SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/../../include/transport/protocol.pb.cc PROPERTIES GENERATED 1) @@ -24,9 +22,9 @@ if (CMAKE_COMPILER_IS_GNUCXX) endif() if (NOT WIN32) - TARGET_LINK_LIBRARIES(transport-plugin ${PROTOBUF_LIBRARIES} ${LOG4CXX_LIBRARIES} ${Boost_LIBRARIES}) + TARGET_LINK_LIBRARIES(transport-plugin ${PROTOBUF_LIBRARY} ${LOG4CXX_LIBRARIES} ${Boost_LIBRARIES}) else() - TARGET_LINK_LIBRARIES(transport-plugin ${PROTOBUF_LIBRARIES} ${LOG4CXX_LIBRARIES} ${Boost_LIBRARIES} ws2_32.lib) + TARGET_LINK_LIBRARIES(transport-plugin ${PROTOBUF_LIBRARY} ${LOG4CXX_LIBRARIES} ${Boost_LIBRARIES} ws2_32.lib) endif() SET_TARGET_PROPERTIES(transport-plugin PROPERTIES diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c3e301da2b07b2ab87eafa2835ec948073b7adf6..e46d7fc6f182bab3771409228d75134d2dc54e10 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -44,15 +44,10 @@ if (CMAKE_COMPILER_IS_GNUCXX) endif() endif() -if (NOT CMAKE_COMPILER_IS_GNUCXX) - include_directories("${CMAKE_SOURCE_DIR}/msvc-deps/protobuf/libprotobuf") - TARGET_LINK_LIBRARIES(transport transport-plugin sqlite3 libprotobuf ${PQXX_LIBRARY} ${PQ_LIBRARY} ${MYSQL_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES}) -else () - if (WIN32) - TARGET_LINK_LIBRARIES(transport transport-plugin sqlite3 ${PQXX_LIBRARY} ${PQ_LIBRARY} ${MYSQL_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES} ${PROTOBUF_LIBRARIES}) - else() - TARGET_LINK_LIBRARIES(transport transport-plugin ${PQXX_LIBRARY} ${PQ_LIBRARY} ${SQLITE3_LIBRARIES} ${MYSQL_LIBRARIES} ${SWIFTEN_LIBRARY} ${PROTOBUF_LIBRARIES} ${LOG4CXX_LIBRARIES} ${POPT_LIBRARY}) - endif() +if (WIN32) + TARGET_LINK_LIBRARIES(transport transport-plugin sqlite3 ${PQXX_LIBRARY} ${PQ_LIBRARY} ${MYSQL_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES} ${PROTOBUF_LIBRARIES} ${PROTOBUF_LIBRARY}) +else() + TARGET_LINK_LIBRARIES(transport transport-plugin ${PQXX_LIBRARY} ${PQ_LIBRARY} ${SQLITE3_LIBRARIES} ${MYSQL_LIBRARIES} ${SWIFTEN_LIBRARY} ${PROTOBUF_LIBRARIES} ${LOG4CXX_LIBRARIES} ${POPT_LIBRARY}) endif() SET_TARGET_PROPERTIES(transport PROPERTIES