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.

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