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.

207 lines
6.4 KiB

  1. set (log4cplus_sources
  2. appenderattachableimpl.cxx
  3. appender.cxx
  4. asyncappender.cxx
  5. clogger.cxx
  6. configurator.cxx
  7. consoleappender.cxx
  8. cygwin-win32.cxx
  9. env.cxx
  10. factory.cxx
  11. fileappender.cxx
  12. fileinfo.cxx
  13. filter.cxx
  14. global-init.cxx
  15. hierarchy.cxx
  16. hierarchylocker.cxx
  17. layout.cxx
  18. log4judpappender.cxx
  19. lockfile.cxx
  20. logger.cxx
  21. loggerimpl.cxx
  22. loggingevent.cxx
  23. loggingmacros.cxx
  24. loglevel.cxx
  25. loglog.cxx
  26. logloguser.cxx
  27. mdc.cxx
  28. ndc.cxx
  29. nullappender.cxx
  30. objectregistry.cxx
  31. patternlayout.cxx
  32. pointer.cxx
  33. property.cxx
  34. queue.cxx
  35. rootlogger.cxx
  36. sleep.cxx
  37. snprintf.cxx
  38. socketappender.cxx
  39. socketbuffer.cxx
  40. socket.cxx
  41. stringhelper.cxx
  42. stringhelper-clocale.cxx
  43. stringhelper-cxxlocale.cxx
  44. stringhelper-iconv.cxx
  45. syncprims.cxx
  46. syslogappender.cxx
  47. threads.cxx
  48. timehelper.cxx
  49. tls.cxx
  50. version.cxx)
  51. #message (STATUS "Type: ${UNIX}|${CYGWIN}|${WIN32}")
  52. if ("${UNIX}" OR "${CYGWIN}" OR APPLE)
  53. set (log4cplus_sources ${log4cplus_sources}
  54. socket-unix.cxx)
  55. elseif (WIN32)
  56. set (log4cplus_sources ${log4cplus_sources}
  57. nteventlogappender.cxx
  58. socket-win32.cxx
  59. win32consoleappender.cxx
  60. win32debugappender.cxx)
  61. #add_definitions (-DLOG4CPLUS_STATIC)
  62. #set (log4cplus_postfix "${log4cplus_postfix}S")
  63. endif ()
  64. if (UNICODE)
  65. add_definitions (-DUNICODE -D_UNICODE -UMBCS -U_MBCS)
  66. else(UNICODE)
  67. add_definitions (-UUNICODE -U_UNICODE -DMBCS -D_MBCS)
  68. endif (UNICODE)
  69. if (WIN32)
  70. add_definitions (-DMINGW_HAS_SECURE_API=1)
  71. add_definitions (-D_WIN32_WINNT=${_WIN32_WINNT})
  72. endif (WIN32)
  73. if(CMAKE_COMPILER_IS_GNUCC)
  74. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable")
  75. elseif(CLANG)
  76. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable")
  77. endif()
  78. add_library (${log4cplus} ${log4cplus_sources})
  79. set (log4cplus_LIBS ${CMAKE_THREAD_LIBS_INIT})
  80. if (LIBRT)
  81. list (APPEND log4cplus_LIBS ${LIBRT})
  82. endif ()
  83. if (LIBPOSIX4)
  84. list (APPEND log4cplus_LIBS ${LIBPOSIX4})
  85. endif ()
  86. if (LIBCPOSIX)
  87. list (APPEND log4cplus_LIBS ${LIBCPOSIX})
  88. endif ()
  89. if (LIBSOCKET)
  90. list (APPEND log4cplus_LIBS ${LIBSOCKET})
  91. endif ()
  92. if (LIBNSL)
  93. list (APPEND log4cplus_LIBS ${LIBNSL})
  94. endif ()
  95. if (LOG4CPLUS_WITH_ICONV AND LIBICONV)
  96. list (APPEND log4cplus_LIBS ${LIBICONV})
  97. endif ()
  98. target_link_libraries (${log4cplus} ${log4cplus_LIBS})
  99. set_target_properties (${log4cplus} PROPERTIES
  100. VERSION "${log4cplus_version_major}.${log4cplus_version_minor}.${log4cplus_version_patch}"
  101. SOVERSION "${log4cplus_soversion}"
  102. COMPILE_FLAGS "-DINSIDE_LOG4CPLUS")
  103. if (WIN32)
  104. set_target_properties (${log4cplus} PROPERTIES
  105. DEBUG_POSTFIX "D")
  106. target_link_libraries (${log4cplus} ws2_32 advapi32)
  107. endif ()
  108. if (LOG4CPLUS_DEFINE_INSTALL_TARGET)
  109. install(TARGETS ${log4cplus} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  110. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  111. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
  112. install(FILES ../include/log4cplus/appender.h
  113. ../include/log4cplus/asyncappender.h
  114. ../include/log4cplus/clogger.h
  115. ../include/log4cplus/config.hxx
  116. ../include/log4cplus/configurator.h
  117. ../include/log4cplus/consoleappender.h
  118. ../include/log4cplus/fileappender.h
  119. ../include/log4cplus/fstreams.h
  120. ../include/log4cplus/hierarchy.h
  121. ../include/log4cplus/hierarchylocker.h
  122. ../include/log4cplus/layout.h
  123. ../include/log4cplus/log4judpappender.h
  124. ../include/log4cplus/logger.h
  125. ../include/log4cplus/loggingmacros.h
  126. ../include/log4cplus/loglevel.h
  127. ../include/log4cplus/mdc.h
  128. ../include/log4cplus/ndc.h
  129. ../include/log4cplus/nteventlogappender.h
  130. ../include/log4cplus/nullappender.h
  131. ../include/log4cplus/socketappender.h
  132. ../include/log4cplus/streams.h
  133. ../include/log4cplus/syslogappender.h
  134. ../include/log4cplus/tchar.h
  135. ../include/log4cplus/tracelogger.h
  136. ../include/log4cplus/tstring.h
  137. ../include/log4cplus/version.h
  138. ../include/log4cplus/win32debugappender.h
  139. ../include/log4cplus/win32consoleappender.h
  140. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/log4cplus )
  141. install(FILES ../include/log4cplus/boost/deviceappender.hxx
  142. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/log4cplus/boost )
  143. install(FILES ../include/log4cplus/helpers/appenderattachableimpl.h
  144. ../include/log4cplus/helpers/fileinfo.h
  145. ../include/log4cplus/helpers/lockfile.h
  146. ../include/log4cplus/helpers/loglog.h
  147. ../include/log4cplus/helpers/logloguser.h
  148. ../include/log4cplus/helpers/pointer.h
  149. ../include/log4cplus/helpers/property.h
  150. ../include/log4cplus/helpers/queue.h
  151. ../include/log4cplus/helpers/sleep.h
  152. ../include/log4cplus/helpers/snprintf.h
  153. ../include/log4cplus/helpers/socket.h
  154. ../include/log4cplus/helpers/socketbuffer.h
  155. ../include/log4cplus/helpers/stringhelper.h
  156. ../include/log4cplus/helpers/thread-config.h
  157. ../include/log4cplus/helpers/timehelper.h
  158. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/log4cplus/helpers )
  159. install(FILES ../include/log4cplus/internal/env.h
  160. ../include/log4cplus/internal/internal.h
  161. ../include/log4cplus/internal/socket.h
  162. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/log4cplus/internal )
  163. install(FILES ../include/log4cplus/spi/appenderattachable.h
  164. ../include/log4cplus/spi/factory.h
  165. ../include/log4cplus/spi/filter.h
  166. ../include/log4cplus/spi/loggerfactory.h
  167. ../include/log4cplus/spi/loggerimpl.h
  168. ../include/log4cplus/spi/loggingevent.h
  169. ../include/log4cplus/spi/objectregistry.h
  170. ../include/log4cplus/spi/rootlogger.h
  171. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/log4cplus/spi )
  172. install(FILES ../include/log4cplus/thread/impl/syncprims-impl.h
  173. # ../include/log4cplus/thread/impl/syncprims-pmsm.h
  174. ../include/log4cplus/thread/impl/syncprims-pthreads.h
  175. ../include/log4cplus/thread/impl/syncprims-win32.h
  176. ../include/log4cplus/thread/impl/threads-impl.h
  177. ../include/log4cplus/thread/impl/tls.h
  178. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/log4cplus/thread/impl )
  179. install(FILES ../include/log4cplus/thread/syncprims-pub-impl.h
  180. ../include/log4cplus/thread/syncprims.h
  181. ../include/log4cplus/thread/threads.h
  182. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/log4cplus/thread )
  183. install(FILES ../include/log4cplus/config/macosx.h
  184. ../include/log4cplus/config/win32.h
  185. ../include/log4cplus/config/windowsh-inc.h
  186. ${log4cplus_BINARY_DIR}/include/log4cplus/config/defines.hxx
  187. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/log4cplus/config )
  188. endif()