diff --git a/CMakeLists.txt b/CMakeLists.txt index e798a84264ae0dd761e0a4100e69b7134b647584..ee8e8623b708d83c85bff433fca7990fb377d9ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,12 @@ set(CMAKE_MODULE_PATH "cmake_modules") set(cppunit_DIR "${CMAKE_SOURCE_DIR}/cmake_modules") find_package(cppunit) +if (WIN32) +ADD_SUBDIRECTORY(msvc-deps) +else() set(sqlite3_DIR "${CMAKE_SOURCE_DIR}/cmake_modules") find_package(sqlite3) +endif() set(mysql_DIR "${CMAKE_SOURCE_DIR}/cmake_modules") find_package(mysql) @@ -29,12 +33,14 @@ find_package(event) set(Swiften_DIR "${CMAKE_SOURCE_DIR}/cmake_modules") find_package(Swiften REQUIRED) +if (NOT WIN32) set(openssl_DIR "${CMAKE_SOURCE_DIR}/cmake_modules") find_package(openssl REQUIRED) +endif() set(Boost_DIR "${CMAKE_SOURCE_DIR}/cmake_modules") if (WIN32) -set(Boost_USE_STATIC_LIBS ON) +set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME OFF) endif() @@ -56,8 +62,10 @@ find_package(event) set(pqxx_DIR "${CMAKE_SOURCE_DIR}/cmake_modules") find_package(pqxx) +if (NOT WIN32) set(dbus_DIR "${CMAKE_SOURCE_DIR}/cmake_modules") find_package(dbus) +endif() find_package(Doxygen) @@ -75,7 +83,10 @@ if (SPECTRUM_VERSION) ADD_DEFINITIONS(-DSPECTRUM_VERSION="${SPECTRUM_VERSION}") else (SPECTRUM_VERSION) if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) - execute_process(COMMAND git "--git-dir=${CMAKE_CURRENT_SOURCE_DIR}/.git" rev-parse --short HEAD + if (NOT GIT_EXECUTABLE) + set (GIT_EXECUTABLE git) + endif() + execute_process(COMMAND ${GIT_EXECUTABLE} "--git-dir=${CMAKE_CURRENT_SOURCE_DIR}/.git" rev-parse --short HEAD OUTPUT_VARIABLE GIT_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE ) @@ -94,8 +105,15 @@ if (SQLITE3_FOUND) include_directories(${SQLITE3_INCLUDE_DIR}) message("SQLite3 : yes") else (SQLITE3_FOUND) +if (WIN32) + ADD_DEFINITIONS(-DWITH_SQLITE) + include_directories(msvc-deps/sqlite3) + set (SQLITE3_LIBRARIES "${CMAKE_SOURCE_DIR}/msvc-deps/sqlite3/sqlite3.lib") + message("SQLite3 : bundled") +else() set(SQLITE3_LIBRARIES "") message("SQLite3 : no") +endif() endif (SQLITE3_FOUND) if (MYSQL_FOUND) @@ -148,15 +166,19 @@ if (PROTOBUF_FOUND) message("IRC plugin : no (install libCommuni and libprotobuf-dev)") endif() +if (NOT WIN32) message("Frotz plugin : yes") message("SMSTools3 plugin : yes") - +else() + message("Frotz plugin : no") + message("SMSTools3 plugin : no") if(${LIBDBUSGLIB_FOUND}) message("Skype plugin : yes") include_directories(${LIBDBUSGLIB_INCLUDE_DIRS}) else() message("Skype plugin : no (install dbus-glib-devel)") endif() +endif() else() message("Network plugins : no (install libprotobuf-dev)") @@ -169,11 +191,10 @@ endif() if (LOG4CXX_FOUND) message("Logging : yes") include_directories(${LOG4CXX_INCLUDE_DIR}) -else() - message(FATAL_ERROR "Logging : no (install log4cxx-devel)") endif() if (WIN32) +ADD_DEFINITIONS(-DLOG4CXX_STATIC) ADD_DEFINITIONS(-D_WIN32_WINNT=0x501) ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN) endif() @@ -209,7 +230,10 @@ include_directories(include) include_directories(${EVENT_INCLUDE_DIRS}) include_directories(${SWIFTEN_INCLUDE_DIR}) include_directories(${Boost_INCLUDE_DIRS}) + +if (NOT WIN32) include_directories(${OPENSSL_INCLUDE_DIR}) +endif() ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(plugin)