diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ae75e7da435d3b4b4d07b4a40586c977f95f2bc..6015a7d812b885f40dbfda43c9126feceb1460d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,10 @@ find_package(event) set(Swiften_DIR "${CMAKE_SOURCE_DIR}/cmake_modules") find_package(Swiften) +if (WIN32) +add_definitions(-DSWIFTEN_STATIC=1) +endif() + if (CMAKE_COMPILER_IS_GNUCXX) set(openssl_DIR "${CMAKE_SOURCE_DIR}/cmake_modules") find_package(openssl) @@ -52,15 +56,29 @@ endif() set(Boost_DIR "${CMAKE_SOURCE_DIR}/cmake_modules") if (WIN32) -set(Boost_USE_STATIC_LIBS ON) -set(Boost_USE_MULTITHREADED ON) -set(Boost_USE_STATIC_RUNTIME OFF) +if (BOOST_VERSION) + set(Boost_USE_STATIC_LIBS ON) + set(Boost_USE_MULTITHREADED ON) + set(Boost_USE_STATIC_RUNTIME OFF) + find_package(Boost ${BOOST_VERSION} COMPONENTS program_options date_time system filesystem regex signals REQUIRED) +else() + message(FATAL_ERROR "Set BOOST_VERSION using for example cmake . -DBOOST_VERSION=1.49.0") endif() +else() find_package(Boost COMPONENTS program_options date_time system filesystem regex signals REQUIRED) +endif() + message( STATUS "Found Boost: ${Boost_LIBRARIES}, ${Boost_INCLUDE_DIR}") +if (WIN32) +#TODO: Use bundled protobuf here...? +set(PROTOBUF_FOUND 1) +set(PROTOBUF_INCLUDE_DIRS "../include") +set(PROTOBUF_LIBRARY "../lib/libprotobuf.lib") +else() set(Protobuf_DIR "${CMAKE_SOURCE_DIR}/cmake_modules") find_package(Protobuf REQUIRED) +endif() set(Communi_DIR "${CMAKE_SOURCE_DIR}/cmake_modules") find_package(Communi)