use bundled protobuf for windows builds
This commit is contained in:
parent
c47ff469f5
commit
bda35a459e
7 changed files with 18 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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})
|
||||
|
|
Loading…
Add table
Reference in a new issue