CMakeLists.txt 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. # Sources
  2. file(GLOB SRCS_G "src/*.cpp")
  3. POCO_SOURCES_AUTO(SRCS ${SRCS_G})
  4. # Headers
  5. file(GLOB_RECURSE HDRS_G "include/*.h")
  6. POCO_HEADERS_AUTO(SRCS ${HDRS_G})
  7. # If POCO_UNBUNDLED is enabled we try to find the required packages
  8. # The configuration will fail if the packages are not found
  9. if(POCO_UNBUNDLED)
  10. find_package(ZLIB REQUIRED)
  11. else()
  12. # zlib
  13. POCO_SOURCES(SRCS zlib
  14. src/adler32.c
  15. src/compress.c
  16. src/crc32.c
  17. src/deflate.c
  18. src/gzio.c
  19. src/infback.c
  20. src/inffast.c
  21. src/inflate.c
  22. src/inftrees.c
  23. src/trees.c
  24. src/zutil.c
  25. )
  26. endif(POCO_UNBUNDLED)
  27. # TODO: Currently only bundled is supported, in future this should also be possible
  28. # with an unbundled version of hpdf
  29. # hpdf
  30. POCO_SOURCES(SRCS hpdf
  31. src/hpdf_3dmeasure.c
  32. src/hpdf_annotation.c
  33. src/hpdf_array.c
  34. src/hpdf_binary.c
  35. src/hpdf_boolean.c
  36. src/hpdf_catalog.c
  37. src/hpdf_destination.c
  38. src/hpdf_dict.c
  39. src/hpdf_doc.c
  40. src/hpdf_doc_png.c
  41. src/hpdf_encoder.c
  42. src/hpdf_encoder_cns.c
  43. src/hpdf_encoder_cnt.c
  44. src/hpdf_encoder_jp.c
  45. src/hpdf_encoder_kr.c
  46. src/hpdf_encoder_utf.c
  47. src/hpdf_encrypt.c
  48. src/hpdf_encryptdict.c
  49. src/hpdf_error.c
  50. src/hpdf_exdata.c
  51. src/hpdf_ext_gstate.c
  52. src/hpdf_font.c
  53. src/hpdf_font_cid.c
  54. src/hpdf_font_tt.c
  55. src/hpdf_font_type1.c
  56. src/hpdf_fontdef.c
  57. src/hpdf_fontdef_base14.c
  58. src/hpdf_fontdef_cid.c
  59. src/hpdf_fontdef_cns.c
  60. src/hpdf_fontdef_cnt.c
  61. src/hpdf_fontdef_jp.c
  62. src/hpdf_fontdef_kr.c
  63. src/hpdf_fontdef_tt.c
  64. src/hpdf_fontdef_type1.c
  65. src/hpdf_gstate.c
  66. src/hpdf_image.c
  67. src/hpdf_image_ccitt.c
  68. src/hpdf_image_png.c
  69. src/hpdf_info.c
  70. src/hpdf_list.c
  71. src/hpdf_mmgr.c
  72. src/hpdf_name.c
  73. src/hpdf_namedict.c
  74. src/hpdf_null.c
  75. src/hpdf_number.c
  76. src/hpdf_objects.c
  77. src/hpdf_outline.c
  78. src/hpdf_page_label.c
  79. src/hpdf_page_operator.c
  80. src/hpdf_pages.c
  81. src/hpdf_pdfa.c
  82. src/hpdf_real.c
  83. src/hpdf_streams.c
  84. src/hpdf_string.c
  85. src/hpdf_u3d.c
  86. src/hpdf_utils.c
  87. src/hpdf_xref.c
  88. )
  89. # TODO: Currently only bundled is supported, in future this should also be possible
  90. # with an unbundled version of libpng
  91. POCO_SOURCES(SRCS libpng
  92. src/png.c
  93. src/pngerror.c
  94. src/pnggccrd.c
  95. src/pngget.c
  96. src/pngmem.c
  97. src/pngpread.c
  98. src/pngread.c
  99. src/pngrio.c
  100. src/pngrtran.c
  101. src/pngrutil.c
  102. src/pngset.c
  103. src/pngtest.c
  104. src/pngtrans.c
  105. src/pngvcrd.c
  106. src/pngwio.c
  107. src/pngwrite.c
  108. src/pngwtran.c
  109. src/pngwutil.c
  110. )
  111. # Version Resource
  112. if(MSVC AND BUILD_SHARED_LIBS)
  113. source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc)
  114. list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc)
  115. endif()
  116. #TODO: Can we put this with the below includes? PRIVAT eg.
  117. include_directories("include/Poco/PDF") # zip src
  118. add_library(PDF ${SRCS})
  119. add_library(Poco::PDF ALIAS PDF)
  120. set_target_properties(PDF
  121. PROPERTIES
  122. VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
  123. OUTPUT_NAME PocoPDF
  124. DEFINE_SYMBOL PDF_EXPORTS
  125. )
  126. if(POCO_UNBUNDLED)
  127. target_link_libraries(PDF PUBLIC ZLIB::ZLIB)
  128. target_compile_definitions(PDF PUBLIC POCO_UNBUNDLED)
  129. endif(POCO_UNBUNDLED)
  130. target_link_libraries(PDF PUBLIC Poco::XML Poco::Util)
  131. target_include_directories(PDF
  132. PUBLIC
  133. $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  134. $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
  135. PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
  136. )
  137. POCO_INSTALL(PDF)
  138. POCO_GENERATE_PACKAGE(PDF)
  139. if(ENABLE_SAMPLES)
  140. add_subdirectory(samples)
  141. endif()
  142. if(ENABLE_TESTS)
  143. add_subdirectory(testsuite)
  144. endif()