CMakeLists.txt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. set(WITH_UNIT_TESTING ON)
  29. find_package(CMocka)
  30. if (CMOCKA_FOUND)
  31. include(AddCMockaTest)
  32. add_subdirectory(tests)
  33. endif (CMOCKA_FOUND)
  34. endif (UNIT_TESTING)
  35. configure_file(config_csync.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_csync.h)
  36. configure_file(config_test.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_test.h)