CMakeLists.txt 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # -*- cmake -*-
  2. project(openjpeg)
  3. include(00-Common)
  4. # OPENJPEG version number
  5. set(OPENJPEG_VERSION_MAJOR 1)
  6. set(OPENJPEG_VERSION_MINOR 4)
  7. set(OPENJPEG_VERSION_BUILD 0)
  8. set(OPENJPEG_VERSION
  9. "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
  10. set(openjpeg_SOURCE_FILES
  11. bio.c
  12. cio.c
  13. dwt.c
  14. event.c
  15. image.c
  16. j2k.c
  17. j2k_lib.c
  18. jp2.c
  19. jpt.c
  20. mct.c
  21. mqc.c
  22. openjpeg.c
  23. pi.c
  24. raw.c
  25. t1.c
  26. t2.c
  27. tcd.c
  28. tgt.c
  29. )
  30. set(openjpeg_HEADER_FILES
  31. bio.h
  32. cio.h
  33. dwt.h
  34. event.h
  35. fix.h
  36. image.h
  37. int.h
  38. j2k.h
  39. j2k_lib.h
  40. jp2.h
  41. jpt.h
  42. mct.h
  43. mqc.h
  44. openjpeg.h
  45. opj_includes.h
  46. opj_malloc.h
  47. pi.h
  48. raw.h
  49. t1.h
  50. t1_luts.h
  51. t2.h
  52. tcd.h
  53. tgt.h
  54. )
  55. set_source_files_properties(${openjpeg_HEADER_FILES}
  56. PROPERTIES HEADER_FILE_ONLY TRUE)
  57. list(APPEND openjpeg_SOURCE_FILES ${openjpeg_HEADER_FILES})
  58. add_library(openjpeg ${openjpeg_SOURCE_FILES})
  59. if (WINDOWS)
  60. target_compile_definitions(openjpeg PRIVATE -D_CRT_SECURE_NO_WARNINGS -DOPJ_STATIC)
  61. endif (WINDOWS)
  62. # gcc -flto chokes on openjpeg header definitions and sees definitions
  63. # mismatches where there are none... So forget about LTO for this library.
  64. if (USELTO)
  65. set_property(TARGET openjpeg PROPERTY INTERPROCEDURAL_OPTIMIZATION FALSE)
  66. endif (USELTO)
  67. # For the arm64 architecture, we need to download the sse2neon.h header before
  68. # trying to build OpenJPEG...
  69. if (ARCH STREQUAL "arm64")
  70. include(ViewerMiscLibs)
  71. include_directories(${LIBS_PREBUILT_DIR}/include)
  72. add_dependencies(openjpeg prepare)
  73. endif (ARCH STREQUAL "arm64")
  74. get_directory_property(ALLDEFINES COMPILE_DEFINITIONS)
  75. message("libopenjpeg COMPILE_DEFINITIONS = ${ALLDEFINES}")