diff --git a/CMakeLists.txt b/CMakeLists.txt index 11c1329aa76c2e419ecfd94e12ea5d8db84c52a3..79b9c0522bd13ca55272fb3a872abf2ef72b876a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,8 +47,12 @@ endif() find_package(Boost COMPONENTS program_options date_time system filesystem regex signals REQUIRED) message( STATUS "Found Boost: ${Boost_LIBRARIES}, ${Boost_INCLUDE_DIR}") +if (NOT WIN32) set(Protobuf_DIR "${CMAKE_SOURCE_DIR}/cmake_modules") find_package(Protobuf REQUIRED) +else() +set(PROTOBUF_FOUND TRUE) +endif() set(Communi_DIR "${CMAKE_SOURCE_DIR}/cmake_modules") find_package(Communi) diff --git a/backends/libpurple/CMakeLists.txt b/backends/libpurple/CMakeLists.txt index a53ef6d38af978a33dc91f215211ec692093447a..a01f1ab929ace51f8cf3b2325357352c545fa3db 100644 --- a/backends/libpurple/CMakeLists.txt +++ b/backends/libpurple/CMakeLists.txt @@ -6,7 +6,8 @@ ADD_EXECUTABLE(spectrum2_libpurple_backend ${SRC}) if(NOT WIN32) target_link_libraries(spectrum2_libpurple_backend ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin pthread) else() -target_link_libraries(spectrum2_libpurple_backend ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin) +include_directories("${CMAKE_SOURCE_DIR}/msvc-deps/protobuf/libprotobuf") +target_link_libraries(spectrum2_libpurple_backend ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin libprotobuf) endif() INSTALL(TARGETS spectrum2_libpurple_backend RUNTIME DESTINATION bin) diff --git a/backends/template/CMakeLists.txt b/backends/template/CMakeLists.txt index bee84e3466fa2803be46b86f6a1b710c15e7a0cb..52fd6feeebd2e2bdf529aff6ab22f8842bf60a5c 100644 --- a/backends/template/CMakeLists.txt +++ b/backends/template/CMakeLists.txt @@ -7,7 +7,8 @@ ADD_EXECUTABLE(spectrum2_template_backend ${SRC}) if (NOT WIN32) target_link_libraries(spectrum2_template_backend transport pthread ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES}) else() -target_link_libraries(spectrum2_template_backend transport ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES}) +include_directories("${CMAKE_SOURCE_DIR}/msvc-deps/protobuf/libprotobuf") +target_link_libraries(spectrum2_template_backend transport libprotobuf ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES}) endif() #INSTALL(TARGETS spectrum2_template_backend RUNTIME DESTINATION bin) diff --git a/include/transport/CMakeLists.txt b/include/transport/CMakeLists.txt index 2868190dfb6ab93daa023eb0ef48e6c0661cfada..1104bc8f4cfe54ef82bef1e5445810a4cde368a8 100644 --- a/include/transport/CMakeLists.txt +++ b/include/transport/CMakeLists.txt @@ -1,4 +1,7 @@ if (PROTOBUF_FOUND) + if (WIN32) + set (PROTOBUF_PROTOC_EXECUTABLE protoc) + endif() ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/protocol.pb.cc ${CMAKE_CURRENT_BINARY_DIR}/protocol.pb.h COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} --cpp_out ${CMAKE_CURRENT_BINARY_DIR} --proto_path ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/protocol.proto diff --git a/plugin/cpp/CMakeLists.txt b/plugin/cpp/CMakeLists.txt index 544e2ec2d07a3b29356597ca969f99d1e43d0b06..9ece0f660264876551160babe5badc9f0481c3be 100644 --- a/plugin/cpp/CMakeLists.txt +++ b/plugin/cpp/CMakeLists.txt @@ -8,7 +8,9 @@ set(EXTRA_SOURCES ${EXTRA_SOURCES} ${CMAKE_CURRENT_BINARY_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} ${PROTOBUF_SRC} ${PROTOBUF_HDRS} ${EXTRA_SOURCES}) + ADD_LIBRARY(transport-plugin STATIC ${HEADERS} ${SRC} ${EXTRA_SOURCES}) + include_directories("${CMAKE_SOURCE_DIR}/msvc-deps/protobuf/libprotobuf") + ADD_DEPENDENCIES(transport-plugin libprotobuf) endif() ADD_DEPENDENCIES(transport-plugin pb) SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/../../include/transport/protocol.pb.cc PROPERTIES GENERATED 1) diff --git a/spectrum/src/CMakeLists.txt b/spectrum/src/CMakeLists.txt index e84cbbb1ff591a5d3aac28a8b6172b6fa0656bf7..2981011c769bb481579b13170b361977e068984c 100644 --- a/spectrum/src/CMakeLists.txt +++ b/spectrum/src/CMakeLists.txt @@ -7,6 +7,9 @@ ADD_DEPENDENCIES(spectrum2 spectrum2_libpurple_backend) ADD_DEPENDENCIES(spectrum2 spectrum2_libircclient-qt_backend) target_link_libraries(spectrum2 transport ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES}) +if (WIN32) + target_link_libraries(spectrum2 libprotobuf) +endif() INSTALL(TARGETS spectrum2 RUNTIME DESTINATION bin) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 925ce5f4c4c7b5cf519b251fb0ca7f329b7c17f6..75ecf4944f39ed8e33312ff9134a6409a69ac042 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -41,6 +41,7 @@ if (CMAKE_COMPILER_IS_GNUCXX) endif() if (WIN32) + include_directories("${CMAKE_SOURCE_DIR}/msvc-deps/protobuf/libprotobuf") TARGET_LINK_LIBRARIES(transport transport-plugin ${PQXX_LIBRARY} ${PQ_LIBRARY} ${SQLITE3_LIBRARIES} ${MYSQL_LIBRARIES} ${SWIFTEN_LIBRARY} ${PROTOBUF_LIBRARIES} ${LOG4CXX_LIBRARIES}) else (WIN32) TARGET_LINK_LIBRARIES(transport transport-plugin ${PQXX_LIBRARY} ${PQ_LIBRARY} ${SQLITE3_LIBRARIES} ${MYSQL_LIBRARIES} ${SWIFTEN_LIBRARY} ${PROTOBUF_LIBRARIES} ${LOG4CXX_LIBRARIES} ${POPT_LIBRARY})