11## building ojph_compress
22#########################
33
4- include_directories (../common)
5- include_directories (../../core/common)
6-
74file (GLOB OJPH_COMPRESS "ojph_compress.cpp" )
85file (GLOB OJPH_IMG_IO "../others/ojph_img_io.cpp" )
96file (GLOB OJPH_IMG_IO_SSE4 "../others/ojph_img_io_sse41.cpp" )
@@ -19,15 +16,12 @@ source_group("common" FILES ${OJPH_IMG_IO_H})
1916if (EMSCRIPTEN)
2017 add_compile_options (-std=c++11 -O3 -fexceptions)
2118 add_link_options (-sWASM=1 -sASSERTIONS=1 -sALLOW_MEMORY_GROWTH=1 -sNODERAWFS=1 -sENVIRONMENT=node -sEXIT_RUNTIME=1 -sEXCEPTION_CATCHING_ALLOWED=['fake'])
22- add_executable (ojph_compress ${SOURCES} )
2319 add_executable (ojph_compress_simd ${SOURCES} ${OJPH_IMG_IO_SSE4} )
2420 target_compile_options (ojph_compress_simd PRIVATE -DOJPH_ENABLE_WASM_SIMD -msimd128 -msse4.1)
2521 source_group ("others" FILES ${OJPH_IMG_IO_SSE4} )
26-
27- target_link_libraries (ojph_compress PRIVATE openjph)
28- install (TARGETS ojph_compress DESTINATION bin)
22+ target_include_directories (ojph_compress_simd PRIVATE ../common)
2923 target_link_libraries (ojph_compress_simd PRIVATE openjphsimd)
30- install (TARGETS ojph_compress_simd DESTINATION bin )
24+ install (TARGETS ojph_compress_simd)
3125else ()
3226 if (NOT OJPH_DISABLE_SIMD)
3327 if (("${OJPH_TARGET_ARCH} " MATCHES "OJPH_ARCH_X86_64" ) OR ("${OJPH_TARGET_ARCH} " MATCHES "OJPH_ARCH_I386" ))
@@ -48,18 +42,21 @@ else()
4842 set_source_files_properties (${OJPH_IMG_IO_AVX2} PROPERTIES COMPILE_FLAGS -mavx2)
4943 endif ()
5044 elseif ("${OJPH_TARGET_ARCH} " MATCHES "OJPH_ARCH_ARM" )
51-
45+
5246 endif ()
5347
5448 endif ()
5549
56- add_executable (ojph_compress ${SOURCES} )
57-
58- if ( USE_TIFF )
59- target_link_libraries (ojph_compress PUBLIC openjph ${TIFF_LIBRARIES} )
60- else ()
61- target_link_libraries (ojph_compress PUBLIC openjph)
62- endif ()
50+ endif ()
6351
64- install (TARGETS ojph_compress DESTINATION bin)
52+ add_executable (ojph_compress ${SOURCES} )
53+ target_include_directories (ojph_compress PRIVATE ../common)
54+ if (TIFF_FOUND AND (NOT EMSCRIPTEN))
55+ target_link_libraries (ojph_compress PRIVATE openjph TIFF::TIFF)
56+ else ()
57+ target_link_libraries (ojph_compress PRIVATE openjph)
6558endif ()
59+
60+ install (TARGETS ojph_compress
61+ EXPORT openjph-config
62+ )
0 commit comments