2008-06-03 13:00:50 +04:00
project ( csync C )
2008-02-27 20:56:47 +03:00
2008-05-06 12:51:12 +04:00
# Required cmake version
cmake_minimum_required ( VERSION 2.4.6 )
2008-02-27 20:56:47 +03:00
# global needed variables
set ( APPLICATION_NAME ${ PROJECT_NAME } )
2008-12-16 17:03:57 +03:00
2010-02-15 13:56:35 +03:00
set ( APPLICATION_VERSION "0.44.0" )
2008-02-27 20:56:47 +03:00
2008-12-16 17:03:57 +03:00
set ( APPLICATION_VERSION_MAJOR "0" )
2010-02-15 13:56:35 +03:00
set ( APPLICATION_VERSION_MINOR "44" )
2008-12-16 17:03:57 +03:00
set ( APPLICATION_VERSION_PATCH "0" )
2010-02-15 13:56:35 +03:00
set ( LIBRARY_VERSION "0.1.2" )
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
$ { C M A K E _ S O U R C E _ D I R } / c m a k e / M o d u l e s
)
# add definitions
include ( DefineCMakeDefaults )
include ( DefineCompilerFlags )
include ( DefineInstallationPaths )
include ( DefineOptions.cmake )
2008-06-09 20:14:25 +04:00
include ( CPackConfig.cmake )
2008-02-27 20:56:47 +03:00
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
if ( WITH_LOG4C )
2009-05-07 19:03:24 +04:00
find_package ( Log4C REQUIRED )
2008-02-27 20:56:47 +03:00
endif ( WITH_LOG4C )
include ( ConfigureChecks.cmake )
configure_file ( config.h.cmake ${ CMAKE_CURRENT_BINARY_DIR } /config.h )
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
2009-09-01 14:16:51 +04:00
find_package ( Check )
2008-03-03 14:27:52 +03:00
if ( CHECK_FOUND AND UNIT_TESTING )
include ( MacroAddCheckTest )
2008-02-27 20:56:47 +03:00
add_subdirectory ( tests )
2008-03-03 14:27:52 +03:00
endif ( CHECK_FOUND AND UNIT_TESTING )
2008-02-27 20:56:47 +03:00