3 if(NOT BUILD_THIRDPARTY)
5 endif(NOT BUILD_THIRDPARTY)
11 message(STATUS "We will build Z lib from thirdparty")
12 add_subdirectory(libz)
13 set(Z_LIBNAME z PARENT_SCOPE)
14 set(Z_INCLUDE_DIRNAME ${OPENJPEG_SOURCE_DIR}/thirdparty/include PARENT_SCOPE)
16 else(BUILD_THIRDPARTY)
20 set(Z_LIBNAME ${ZLIB_LIBRARIES} PARENT_SCOPE)
21 set(Z_INCLUDE_DIRNAME ${ZLIB_INCLUDE_DIRS} PARENT_SCOPE)
22 message(STATUS "Your system seems to have a Z lib available, we will use it to generate PNG lib")
23 # message(STATUS "DEBUG: ${ZLIB_INCLUDE_DIRS} vs ${ZLIB_INCLUDE_DIR}")
24 else(ZLIB_FOUND) # not found
25 message(STATUS "Z lib not found, activate BUILD_THIRDPARTY if you want build it (necessary to build libPNG)")
27 endif(BUILD_THIRDPARTY)
31 # Try to find lib PNG (which depends on zlib)
34 message(STATUS "We will build PNG lib from thirdparty")
35 add_subdirectory(libpng)
36 set(OPJ_HAVE_PNG_H 1 PARENT_SCOPE)
37 set(OPJ_HAVE_LIBPNG 1 PARENT_SCOPE)
38 set(PNG_LIBNAME png PARENT_SCOPE)
39 set(PNG_INCLUDE_DIRNAME ${OPENJPEG_SOURCE_DIR}/thirdparty/libpng PARENT_SCOPE)
40 else(BUILD_THIRDPARTY)
44 # it is not necessary to invoke pkg_check_module on libpng, because libpng
45 # only depends on zlib, which is already checked.
47 message(STATUS "Your system seems to have a PNG lib available, we will use it")
48 set(OPJ_HAVE_PNG_H 1 PARENT_SCOPE)
49 set(OPJ_HAVE_LIBPNG 1 PARENT_SCOPE)
50 set(PNG_LIBNAME ${PNG_LIBRARIES} PARENT_SCOPE)
51 set(PNG_INCLUDE_DIRNAME ${PNG_PNG_INCLUDE_DIR} PARENT_SCOPE)
52 else(PNG_FOUND) # not found
53 set(OPJ_HAVE_PNG_H 0 PARENT_SCOPE)
54 set(OPJ_HAVE_LIBPNG 0 PARENT_SCOPE)
55 message(STATUS "PNG lib not found, activate BUILD_THIRDPARTY if you want build it")
58 endif(BUILD_THIRDPARTY)
61 # Try to find lib TIFF
65 message(STATUS "We will build TIFF lib from thirdparty")
66 add_subdirectory(libtiff)
67 set(TIFF_LIBNAME tiff PARENT_SCOPE)
68 set(TIFF_INCLUDE_DIRNAME
69 ${OPENJPEG_SOURCE_DIR}/thirdparty/libtiff
70 ${OPENJPEG_BINARY_DIR}/thirdparty/libtiff
72 set(OPJ_HAVE_TIFF_H 1 PARENT_SCOPE)
73 set(OPJ_HAVE_LIBTIFF 1 PARENT_SCOPE)
74 else(BUILD_THIRDPARTY)
77 # it is necessary to invoke pkg_check_module on libtiff since it may have
78 # several other dependencies not declared by its cmake module, but they are
79 # in the its pkgconfig module.
81 foreach(pc_tiff_module tiff tiff3 tiff4 tiff-3 tiff-4 libtiff libtiff3 libtiff4 libtiff-3 libtiff-4)
82 pkg_check_modules(PC_TIFF QUIET ${pc_tiff_module})
87 endif(PKG_CONFIG_FOUND)
89 message(STATUS "Your system seems to have a TIFF lib available, we will use it")
90 set(OPJ_HAVE_TIFF_H 1 PARENT_SCOPE)
91 set(OPJ_HAVE_LIBTIFF 1 PARENT_SCOPE)
92 set(TIFF_LIBNAME ${TIFF_LIBRARIES} ${PC_TIFF_STATIC_LIBRARIES} PARENT_SCOPE)
93 set(TIFF_INCLUDE_DIRNAME ${TIFF_INCLUDE_DIR} ${PC_TIFF_STATIC_INCLUDE_DIRS} PARENT_SCOPE)
94 else(TIFF_FOUND) # not found
95 set(OPJ_HAVE_TIFF_H 0 PARENT_SCOPE)
96 set(OPJ_HAVE_LIBTIFF 0 PARENT_SCOPE)
97 message(STATUS "TIFF lib not found, activate BUILD_THIRDPARTY if you want build it")
99 endif(BUILD_THIRDPARTY)
102 # Try to find lib LCMS2 (or by default LCMS)
103 set(OPJ_HAVE_LCMS_H 0 PARENT_SCOPE)
104 set(OPJ_HAVE_LIBLCMS 0 PARENT_SCOPE)
106 if( BUILD_THIRDPARTY)
108 message(STATUS "We will build LCMS2 lib from thirdparty")
109 add_subdirectory(liblcms2)
110 set(LCMS_LIBNAME lcms2 PARENT_SCOPE)
111 set(LCMS_INCLUDE_DIRNAME ${OPENJPEG_SOURCE_DIR}/thirdparty/liblcms2/include PARENT_SCOPE) #
112 set(OPJ_HAVE_LCMS2_H 1 PARENT_SCOPE)
113 set(OPJ_HAVE_LIBLCMS2 1 PARENT_SCOPE)
114 else(BUILD_THIRDPARTY)
117 # it is necessary to invoke pkg_check_module on lcms2 since it may have
118 # several other dependencies not declared by its cmake module, but they are
119 # in the its pkgconfig module.
121 pkg_check_modules(PC_LCMS2 QUIET lcms2)
122 endif(PKG_CONFIG_FOUND)
124 message(STATUS "Your system seems to have a LCMS2 lib available, we will use it")
125 set(OPJ_HAVE_LCMS2_H 1 PARENT_SCOPE)
126 set(OPJ_HAVE_LIBLCMS2 1 PARENT_SCOPE)
127 set(LCMS_LIBNAME ${LCMS2_LIBRARIES} ${PC_LCMS2_STATIC_LIBRARIES} PARENT_SCOPE)
128 set(LCMS_INCLUDE_DIRNAME ${LCMS2_INCLUDE_DIRS} ${PC_LCMS2_STATIC_INCLUDE_DIRS} PARENT_SCOPE)
129 else(LCMS2_FOUND) # not found lcms2
133 message(STATUS "Your system seems to have a LCMS lib available, we will use it")
134 set(OPJ_HAVE_LCMS_H 1 PARENT_SCOPE)
135 set(OPJ_HAVE_LIBLCMS 1 PARENT_SCOPE)
136 set(LCMS_LIBNAME ${LCMS_LIBRARIES} PARENT_SCOPE)
137 set(LCMS_INCLUDE_DIRNAME ${LCMS_INCLUDE_DIRS} PARENT_SCOPE)
138 else(LCMS_FOUND) # not found lcms
139 set(OPJ_HAVE_LCMS2_H 0 PARENT_SCOPE)
140 set(OPJ_HAVE_LIBLCMS2 0 PARENT_SCOPE)
141 message(STATUS "LCMS2 or LCMS lib not found, activate BUILD_THIRDPARTY if you want build it")
144 endif(BUILD_THIRDPARTY)
150 ADD_SUBDIRECTORY(astyle)