diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e37be9d5..b3c989d88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,10 +6,7 @@ set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ) include(${CMAKE_SOURCE_DIR}/VERSION.cmake) find_package(Qt4 4.4.3 COMPONENTS QtCore QtGui QtXml QtNetwork QtTest REQUIRED ) - -IF( UNIX ) find_package(Csync) -ENDIF( UNIX ) if(CSYNC_FOUND) add_definitions(-DWITH_CSYNC) diff --git a/cmake/modules/FindCsync.cmake b/cmake/modules/FindCsync.cmake index c2488fccc..fb4090a72 100644 --- a/cmake/modules/FindCsync.cmake +++ b/cmake/modules/FindCsync.cmake @@ -1,8 +1,18 @@ +IF(EXISTS "${CMAKE_SOURCE_DIR}/../csync/src/csync.h") + SET(CSYNC_INCLUDE_PATH ${CMAKE_SOURCE_DIR}/../csync/src/) +ELSE(EXISTS "${CMAKE_SOURCE_DIR}/../csync/src/csync.h") + FIND_PATH(CSYNC_INCLUDE_PATH NAMES csync.h HINTS /usr/include/csync) +ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/../csync/src/csync.h") -FIND_LIBRARY(CSYNC_LIBRARY NAMES csync - HINTS "${CMAKE_SOURCE_DIR}/../buildcsync/src" ) -FIND_PATH(CSYNC_INCLUDE_PATH csync.h - HINTS "${CMAKE_SOURCE_DIR}/../csync/src" "/usr/include/csync") +IF(EXISTS "${CMAKE_SOURCE_DIR}/../buildcsync/src/") + IF( WIN32 ) + SET(CSYNC_LIBRARY ${CMAKE_SOURCE_DIR}/../win/buildcsync/src/libcsync.dll) + ELSE( WIN32 ) + SET(CSYNC_LIBRARY ${CMAKE_SOURCE_DIR}/../buildcsync/src/libcsync.so) + ENDIF( WIN32 ) +ELSE(EXISTS "${CMAKE_SOURCE_DIR}/../buildcsync/src/") + FIND_LIBRARY(CSYNC_LIBRARY NAMES csync ) +ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/../buildcsync/src/") SET(CSYNC_INCLUDE_DIR ${CSYNC_INCLUDE_PATH}) @@ -12,6 +22,4 @@ include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Csync DEFAULT_MSG CSYNC_LIBRARY CSYNC_INCLUDE_PATH) -MARK_AS_ADVANCED( - CSYNC_INCLUDE_PATH - CSYNC_LIBRARY) +MARK_AS_ADVANCED( CSYNC_INCLUDE_PATH CSYNC_LIBRARY )