You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.0 KiB

  1. project (log4cplus)
  2. cmake_minimum_required (VERSION 2.8.0)
  3. set (log4cplus_version_major 1)
  4. set (log4cplus_version_minor 1)
  5. set (log4cplus_version_patch 0)
  6. set (log4cplus_soversion 0)
  7. set (log4cplus_postfix "")
  8. option(LOG4CPLUS_BUILD_TESTING "Build the test suite." ON)
  9. find_package (Threads)
  10. message (STATUS "Threads: ${CMAKE_THREAD_LIBS_INIT}")
  11. set(BUILD_SHARED_LIBS TRUE CACHE BOOL "If TRUE, log4cplus is built as a shared library, otherwise as a static library")
  12. if (WIN32)
  13. set (UNICODE_DEFAULT ON)
  14. else (WIN32)
  15. set (UNICODE_DEFAULT OFF)
  16. endif (WIN32)
  17. if (MSVC)
  18. set (LOG4CPLUS_WORKING_LOCALE_DEFAULT ON)
  19. else (MSVC)
  20. set (LOG4CPLUS_WORKING_LOCALE_DEFAULT OFF)
  21. endif (MSVC)
  22. option(LOG4CPLUS_WORKING_LOCALE "Define for compilers/standard libraries that support more than just the C locale."
  23. ${LOG4CPLUS_WORKING_LOCALE_DEFAULT})
  24. option(LOG4CPLUS_WORKING_C_LOCALE
  25. "Define for compilers/standard libraries that have working C locale."
  26. OFF)
  27. option (LOG4CPLUS_QT4 "Build with Qt4DebugAppender" OFF)
  28. option(UNICODE "Build with tchar = wchar_t" ${UNICODE_DEFAULT})
  29. option(WITH_ICONV "Use iconv() for char->wchar_t conversion."
  30. OFF)
  31. if (UNICODE)
  32. set (log4cplus_postfix "${log4cplus_postfix}U")
  33. endif (UNICODE)
  34. if (WITH_ICONV)
  35. set(LOG4CPLUS_WITH_ICONV 1)
  36. endif ()
  37. set (log4cplus "log4cplus${log4cplus_postfix}")
  38. include(ConfigureChecks.cmake)
  39. configure_file(include/log4cplus/config.h.cmake.in
  40. ${log4cplus_BINARY_DIR}/include/log4cplus/config.h @ONLY)
  41. configure_file(include/log4cplus/config/defines.hxx.cmake.in
  42. ${log4cplus_BINARY_DIR}/include/log4cplus/config/defines.hxx @ONLY)
  43. include_directories (${log4cplus_SOURCE_DIR}/include
  44. ${log4cplus_BINARY_DIR}/include
  45. )
  46. if (LOG4CPLUS_BUILD_TESTING)
  47. enable_testing()
  48. endif (LOG4CPLUS_BUILD_TESTING)
  49. add_subdirectory (src)
  50. add_subdirectory (loggingserver)
  51. if (LOG4CPLUS_BUILD_TESTING)
  52. add_subdirectory (tests)
  53. endif (LOG4CPLUS_BUILD_TESTING)
  54. if (LOG4CPLUS_QT4)
  55. add_subdirectory (qt4debugappender)
  56. endif (LOG4CPLUS_QT4)
  57. include(Log4CPlusCPack.cmake)