CMakeLists.txt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # global needed variables
  2. set(APPLICATION_NAME "ocsync")
  3. set(LIBRARY_VERSION ${MIRALL_VERSION})
  4. set(LIBRARY_SOVERSION "0")
  5. # add definitions
  6. include(DefineCMakeDefaults)
  7. include(DefinePlatformDefaults)
  8. include(DefineCompilerFlags)
  9. include(DefineOptions.cmake)
  10. include(DefineInstallationPaths)
  11. # add macros
  12. include(MacroAddPlugin)
  13. include(MacroCopyFile)
  14. if (NOT WIN32)
  15. find_package(Iconv)
  16. endif (NOT WIN32)
  17. find_package(SQLite3 3.8.0 REQUIRED)
  18. include(ConfigureChecks.cmake)
  19. set(SOURCE_DIR ${CMAKE_SOURCE_DIR})
  20. set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
  21. include_directories(${CMAKE_CURRENT_BINARY_DIR})
  22. macro_copy_file(${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake ${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake)
  23. if (MEM_NULL_TESTS)
  24. add_definitions(-DCSYNC_MEM_NULL_TESTS)
  25. endif (MEM_NULL_TESTS)
  26. add_subdirectory(src)
  27. if (UNIT_TESTING)
  28. find_package(CMocka)
  29. if (CMOCKA_FOUND)
  30. include(AddCMockaTest)
  31. add_subdirectory(tests)
  32. endif (CMOCKA_FOUND)
  33. endif (UNIT_TESTING)
  34. configure_file(config_csync.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_csync.h)
  35. configure_file(config_test.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_test.h)