2012-10-01 14:39:05 +04:00
project(ocsync C)
2008-02-27 20:56:47 +03:00
2008-05-06 12:51:12 +04:00
# Required cmake version
2012-02-04 15:23:30 +04:00
cmake_minimum_required(VERSION 2.6.0)
2008-05-06 12:51:12 +04:00
2008-02-27 20:56:47 +03:00
# global needed variables
set(APPLICATION_NAME ${PROJECT_NAME})
2008-12-16 17:03:57 +03:00
set(APPLICATION_VERSION_MAJOR "0")
2013-08-08 18:00:20 +04:00
set(APPLICATION_VERSION_MINOR "81")
2013-06-25 11:52:44 +04:00
set(APPLICATION_VERSION_PATCH "0")
2012-02-22 21:25:41 +04:00
set(APPLICATION_VERSION "${APPLICATION_VERSION_MAJOR}.${APPLICATION_VERSION_MINOR}.${APPLICATION_VERSION_PATCH}")
2008-12-16 17:03:57 +03:00
2013-08-08 18:00:20 +04:00
set(LIBRARY_VERSION "0.2.1")
2008-12-16 17:03:57 +03:00
set(LIBRARY_SOVERSION "0")
2008-02-27 20:56:47 +03:00
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
set(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/cmake/Modules
)
# add definitions
include(DefineCMakeDefaults)
2011-10-17 21:07:52 +04:00
include(DefinePlatformDefaults)
2008-02-27 20:56:47 +03:00
include(DefineCompilerFlags)
include(DefineOptions.cmake)
2008-06-09 20:14:25 +04:00
include(CPackConfig.cmake)
2008-02-27 20:56:47 +03:00
2012-02-21 20:43:30 +04:00
include(DefineInstallationPaths)
# install .dlls to bin/
set(BIN_INSTALL_DIR "bin" CACHE PATH "-")
2008-03-03 12:18:59 +03:00
# disallow in-source build
include(MacroEnsureOutOfSourceBuild)
macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source build. Please create a separate build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there.")
2008-02-27 20:56:47 +03:00
# add macros
include(MacroAddPlugin)
2008-03-03 15:43:12 +03:00
include(MacroCopyFile)
2008-02-27 20:56:47 +03:00
2012-12-08 02:09:46 +04:00
find_package(Iconv)
2012-10-19 21:06:50 +04:00
find_package(CMocka)
if (CMOCKA_FOUND AND UNIT_TESTING)
include(AddCMockaTest)
endif (CMOCKA_FOUND AND UNIT_TESTING)
2008-02-27 20:56:47 +03:00
include(ConfigureChecks.cmake)
2013-01-09 18:04:17 +04:00
2012-07-11 18:50:25 +04:00
set(SOURCE_DIR ${CMAKE_SOURCE_DIR})
2012-02-20 21:21:22 +04:00
include_directories(${CMAKE_CURRENT_BINARY_DIR})
2008-02-27 20:56:47 +03:00
2008-03-03 15:43:12 +03:00
macro_copy_file(${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake ${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake)
2008-07-28 13:49:56 +04:00
if (MEM_NULL_TESTS)
add_definitions(-DCSYNC_MEM_NULL_TESTS)
endif (MEM_NULL_TESTS)
2008-02-27 20:56:47 +03:00
add_subdirectory(src)
2008-04-07 19:16:41 +04:00
add_subdirectory(modules)
2008-02-27 20:56:47 +03:00
add_subdirectory(client)
add_subdirectory(config)
add_subdirectory(doc)
2008-03-03 14:27:52 +03:00
2012-10-16 12:37:40 +04:00
if (CMOCKA_FOUND AND UNIT_TESTING)
add_subdirectory(tests)
endif (CMOCKA_FOUND AND UNIT_TESTING)
2008-02-27 20:56:47 +03:00
2013-01-09 18:04:17 +04:00
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
configure_file(config_test.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_test.h)