Skip to content

Commit 7b9ee39

Browse files
committed
fix cmake for EXR
1 parent 19c65e1 commit 7b9ee39

File tree

3 files changed

+110
-82
lines changed

3 files changed

+110
-82
lines changed

src/apps/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if( OJPH_ENABLE_TIFF_SUPPORT AND (NOT EMSCRIPTEN))
2121
message(STATUS " TIFF_LIBRARIES = ${TIFF_LIBRARIES}")
2222
endif(TIFF_FOUND)
2323

24-
endif(OJPH_ENABLE_TIFF_SUPPORT)
24+
endif(OJPH_ENABLE_TIFF_SUPPORT AND (NOT EMSCRIPTEN))
2525
############################################################
2626

2727
# Add OPENEXR library
@@ -51,7 +51,7 @@ if( OJPH_ENABLE_OPENEXR_SUPPORT )
5151
message(STATUS " found OpenEXR with FindModule")
5252
endif(OpenEXR_FOUND_WITH_CONFIG)
5353
else(OpenEXR_FOUND)
54-
message(STATUS "OpenEXR support has been enabled but no path to the OpenEXR or IlmBase library "
54+
message(STATUS "OpenEXR support has been requested but no path to the OpenEXR or IlmBase library "
5555
"has been specified; please configure with -DCMAKE_PREFIX_PATH=<OpenEXR library directory>, "
5656
"or disable OpenEXR support using -DOJPH_ENABLE_OpenEXR_SUPPORT=OFF.")
5757
endif(OpenEXR_FOUND)

src/apps/ojph_compress/CMakeLists.txt

Lines changed: 54 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -44,52 +44,66 @@ else()
4444

4545
endif()
4646

47-
add_executable(ojph_compress ${SOURCES})
47+
# add_executable(ojph_compress ${SOURCES})
4848

49-
if( USE_TIFF )
50-
if( USE_OPENEXR )
51-
target_link_libraries(ojph_compress PUBLIC openjph ${TIFF_LIBRARIES}
52-
# For OpenEXR/Imath 3.x:
53-
$<$<TARGET_EXISTS:OpenEXR::OpenEXR>:OpenEXR::OpenEXR>
54-
$<$<TARGET_EXISTS:Imath::Imath>:Imath::Imath>
55-
$<$<TARGET_EXISTS:Imath::Half>:Imath::Half>
56-
# For OpenEXR 2.4/2.5:
57-
$<$<TARGET_EXISTS:OpenEXR::IlmImf>:OpenEXR::IlmImf>
58-
$<$<TARGET_EXISTS:IlmBase::Imath>:IlmBase::Imath>
59-
$<$<TARGET_EXISTS:IlmBase::Half>:IlmBase::Half>
60-
$<$<TARGET_EXISTS:IlmBase::IlmThread>:IlmBase::IlmThread>
61-
$<$<TARGET_EXISTS:IlmBase::Iex>:IlmBase::Iex>
62-
# ZLIB for OpenEXR 2.x:
63-
$<$<TARGET_EXISTS:ZLIB::ZLIB>:ZLIB::ZLIB>)
64-
else()
65-
target_link_libraries(ojph_compress PUBLIC openjph ${TIFF_LIBRARIES})
66-
endif()
67-
else()
68-
if( USE_OPENEXR )
69-
target_link_libraries(ojph_compress PUBLIC openjph
70-
# For OpenEXR/Imath 3.x:
71-
$<$<TARGET_EXISTS:OpenEXR::OpenEXR>:OpenEXR::OpenEXR>
72-
$<$<TARGET_EXISTS:Imath::Imath>:Imath::Imath>
73-
$<$<TARGET_EXISTS:Imath::Half>:Imath::Half>
74-
# For OpenEXR 2.4/2.5:
75-
$<$<TARGET_EXISTS:OpenEXR::IlmImf>:OpenEXR::IlmImf>
76-
$<$<TARGET_EXISTS:IlmBase::Imath>:IlmBase::Imath>
77-
$<$<TARGET_EXISTS:IlmBase::Half>:IlmBase::Half>
78-
$<$<TARGET_EXISTS:IlmBase::IlmThread>:IlmBase::IlmThread>
79-
$<$<TARGET_EXISTS:IlmBase::Iex>:IlmBase::Iex>
80-
# ZLIB for OpenEXR 2.x:
81-
$<$<TARGET_EXISTS:ZLIB::ZLIB>:ZLIB::ZLIB>)
82-
else()
83-
target_link_libraries(ojph_compress PUBLIC openjph)
84-
endif()
85-
endif()
49+
# if( USE_TIFF )
50+
# if( USE_OPENEXR )
51+
# target_link_libraries(ojph_compress PUBLIC openjph ${TIFF_LIBRARIES}
52+
# # For OpenEXR/Imath 3.x:
53+
# $<$<TARGET_EXISTS:OpenEXR::OpenEXR>:OpenEXR::OpenEXR>
54+
# $<$<TARGET_EXISTS:Imath::Imath>:Imath::Imath>
55+
# $<$<TARGET_EXISTS:Imath::Half>:Imath::Half>
56+
# # For OpenEXR 2.4/2.5:
57+
# $<$<TARGET_EXISTS:OpenEXR::IlmImf>:OpenEXR::IlmImf>
58+
# $<$<TARGET_EXISTS:IlmBase::Imath>:IlmBase::Imath>
59+
# $<$<TARGET_EXISTS:IlmBase::Half>:IlmBase::Half>
60+
# $<$<TARGET_EXISTS:IlmBase::IlmThread>:IlmBase::IlmThread>
61+
# $<$<TARGET_EXISTS:IlmBase::Iex>:IlmBase::Iex>
62+
# # ZLIB for OpenEXR 2.x:
63+
# $<$<TARGET_EXISTS:ZLIB::ZLIB>:ZLIB::ZLIB>)
64+
# else()
65+
# target_link_libraries(ojph_compress PUBLIC openjph ${TIFF_LIBRARIES})
66+
# endif()
67+
# else()
68+
# if( USE_OPENEXR )
69+
# target_link_libraries(ojph_compress PUBLIC openjph
70+
# # For OpenEXR/Imath 3.x:
71+
# $<$<TARGET_EXISTS:OpenEXR::OpenEXR>:OpenEXR::OpenEXR>
72+
# $<$<TARGET_EXISTS:Imath::Imath>:Imath::Imath>
73+
# $<$<TARGET_EXISTS:Imath::Half>:Imath::Half>
74+
# # For OpenEXR 2.4/2.5:
75+
# $<$<TARGET_EXISTS:OpenEXR::IlmImf>:OpenEXR::IlmImf>
76+
# $<$<TARGET_EXISTS:IlmBase::Imath>:IlmBase::Imath>
77+
# $<$<TARGET_EXISTS:IlmBase::Half>:IlmBase::Half>
78+
# $<$<TARGET_EXISTS:IlmBase::IlmThread>:IlmBase::IlmThread>
79+
# $<$<TARGET_EXISTS:IlmBase::Iex>:IlmBase::Iex>
80+
# # ZLIB for OpenEXR 2.x:
81+
# $<$<TARGET_EXISTS:ZLIB::ZLIB>:ZLIB::ZLIB>)
82+
# else()
83+
# target_link_libraries(ojph_compress PUBLIC openjph)
84+
# endif()
85+
# endif()
8686

87-
install(TARGETS ojph_compress DESTINATION bin)
87+
# install(TARGETS ojph_compress DESTINATION bin)
8888
endif()
8989

9090
add_executable(ojph_compress ${SOURCES})
9191
target_include_directories(ojph_compress PRIVATE ../common)
92-
target_link_libraries(ojph_compress PRIVATE openjph $<TARGET_NAME_IF_EXISTS:TIFF::TIFF>)
92+
target_link_libraries(ojph_compress PRIVATE openjph
93+
#TIFF
94+
$<TARGET_NAME_IF_EXISTS:TIFF::TIFF>
95+
# For OpenEXR/Imath 3.x:
96+
$<$<TARGET_EXISTS:OpenEXR::OpenEXR>:OpenEXR::OpenEXR>
97+
$<$<TARGET_EXISTS:Imath::Imath>:Imath::Imath>
98+
$<$<TARGET_EXISTS:Imath::Half>:Imath::Half>
99+
# For OpenEXR 2.4/2.5:
100+
$<$<TARGET_EXISTS:OpenEXR::IlmImf>:OpenEXR::IlmImf>
101+
$<$<TARGET_EXISTS:IlmBase::Imath>:IlmBase::Imath>
102+
$<$<TARGET_EXISTS:IlmBase::Half>:IlmBase::Half>
103+
$<$<TARGET_EXISTS:IlmBase::IlmThread>:IlmBase::IlmThread>
104+
$<$<TARGET_EXISTS:IlmBase::Iex>:IlmBase::Iex>
105+
# ZLIB for OpenEXR 2.x:
106+
$<$<TARGET_EXISTS:ZLIB::ZLIB>:ZLIB::ZLIB>)
93107

94108
install(TARGETS ojph_compress
95109
EXPORT openjph-config

src/apps/ojph_expand/CMakeLists.txt

Lines changed: 54 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -44,52 +44,66 @@ else()
4444

4545
endif()
4646

47-
add_executable(ojph_expand ${SOURCES})
47+
# add_executable(ojph_expand ${SOURCES})
4848

49-
if( USE_TIFF )
50-
if( USE_OPENEXR )
51-
target_link_libraries(ojph_expand PUBLIC openjph ${TIFF_LIBRARIES}
52-
# For OpenEXR/Imath 3.x:
53-
$<$<TARGET_EXISTS:OpenEXR::OpenEXR>:OpenEXR::OpenEXR>
54-
$<$<TARGET_EXISTS:Imath::Imath>:Imath::Imath>
55-
$<$<TARGET_EXISTS:Imath::Half>:Imath::Half>
56-
# For OpenEXR 2.4/2.5:
57-
$<$<TARGET_EXISTS:OpenEXR::IlmImf>:OpenEXR::IlmImf>
58-
$<$<TARGET_EXISTS:IlmBase::Imath>:IlmBase::Imath>
59-
$<$<TARGET_EXISTS:IlmBase::Half>:IlmBase::Half>
60-
$<$<TARGET_EXISTS:IlmBase::IlmThread>:IlmBase::IlmThread>
61-
$<$<TARGET_EXISTS:IlmBase::Iex>:IlmBase::Iex>
62-
# ZLIB for OpenEXR 2.x:
63-
$<$<TARGET_EXISTS:ZLIB::ZLIB>:ZLIB::ZLIB>)
64-
else()
65-
target_link_libraries(ojph_expand PUBLIC openjph ${TIFF_LIBRARIES})
66-
endif()
67-
else()
68-
if( USE_OPENEXR )
69-
target_link_libraries(ojph_expand PUBLIC openjph
70-
# For OpenEXR/Imath 3.x:
71-
$<$<TARGET_EXISTS:OpenEXR::OpenEXR>:OpenEXR::OpenEXR>
72-
$<$<TARGET_EXISTS:Imath::Imath>:Imath::Imath>
73-
$<$<TARGET_EXISTS:Imath::Half>:Imath::Half>
74-
# For OpenEXR 2.4/2.5:
75-
$<$<TARGET_EXISTS:OpenEXR::IlmImf>:OpenEXR::IlmImf>
76-
$<$<TARGET_EXISTS:IlmBase::Imath>:IlmBase::Imath>
77-
$<$<TARGET_EXISTS:IlmBase::Half>:IlmBase::Half>
78-
$<$<TARGET_EXISTS:IlmBase::IlmThread>:IlmBase::IlmThread>
79-
$<$<TARGET_EXISTS:IlmBase::Iex>:IlmBase::Iex>
80-
# ZLIB for OpenEXR 2.x:
81-
$<$<TARGET_EXISTS:ZLIB::ZLIB>:ZLIB::ZLIB>)
82-
else()
83-
target_link_libraries(ojph_expand PUBLIC openjph)
84-
endif()
85-
endif()
49+
# if( USE_TIFF )
50+
# if( USE_OPENEXR )
51+
# target_link_libraries(ojph_expand PUBLIC openjph ${TIFF_LIBRARIES}
52+
# # For OpenEXR/Imath 3.x:
53+
# $<$<TARGET_EXISTS:OpenEXR::OpenEXR>:OpenEXR::OpenEXR>
54+
# $<$<TARGET_EXISTS:Imath::Imath>:Imath::Imath>
55+
# $<$<TARGET_EXISTS:Imath::Half>:Imath::Half>
56+
# # For OpenEXR 2.4/2.5:
57+
# $<$<TARGET_EXISTS:OpenEXR::IlmImf>:OpenEXR::IlmImf>
58+
# $<$<TARGET_EXISTS:IlmBase::Imath>:IlmBase::Imath>
59+
# $<$<TARGET_EXISTS:IlmBase::Half>:IlmBase::Half>
60+
# $<$<TARGET_EXISTS:IlmBase::IlmThread>:IlmBase::IlmThread>
61+
# $<$<TARGET_EXISTS:IlmBase::Iex>:IlmBase::Iex>
62+
# # ZLIB for OpenEXR 2.x:
63+
# $<$<TARGET_EXISTS:ZLIB::ZLIB>:ZLIB::ZLIB>)
64+
# else()
65+
# target_link_libraries(ojph_expand PUBLIC openjph ${TIFF_LIBRARIES})
66+
# endif()
67+
# else()
68+
# if( USE_OPENEXR )
69+
# target_link_libraries(ojph_expand PUBLIC openjph
70+
# # For OpenEXR/Imath 3.x:
71+
# $<$<TARGET_EXISTS:OpenEXR::OpenEXR>:OpenEXR::OpenEXR>
72+
# $<$<TARGET_EXISTS:Imath::Imath>:Imath::Imath>
73+
# $<$<TARGET_EXISTS:Imath::Half>:Imath::Half>
74+
# # For OpenEXR 2.4/2.5:
75+
# $<$<TARGET_EXISTS:OpenEXR::IlmImf>:OpenEXR::IlmImf>
76+
# $<$<TARGET_EXISTS:IlmBase::Imath>:IlmBase::Imath>
77+
# $<$<TARGET_EXISTS:IlmBase::Half>:IlmBase::Half>
78+
# $<$<TARGET_EXISTS:IlmBase::IlmThread>:IlmBase::IlmThread>
79+
# $<$<TARGET_EXISTS:IlmBase::Iex>:IlmBase::Iex>
80+
# # ZLIB for OpenEXR 2.x:
81+
# $<$<TARGET_EXISTS:ZLIB::ZLIB>:ZLIB::ZLIB>)
82+
# else()
83+
# target_link_libraries(ojph_expand PUBLIC openjph)
84+
# endif()
85+
# endif()
8686

87-
install(TARGETS ojph_expand DESTINATION bin)
87+
# install(TARGETS ojph_expand DESTINATION bin)
8888
endif()
8989

9090
add_executable(ojph_expand ${SOURCES})
9191
target_include_directories(ojph_expand PRIVATE ../common)
92-
target_link_libraries(ojph_expand PRIVATE openjph $<TARGET_NAME_IF_EXISTS:TIFF::TIFF>)
92+
target_link_libraries(ojph_expand PRIVATE openjph
93+
# TIFF
94+
$<TARGET_NAME_IF_EXISTS:TIFF::TIFF>
95+
# For OpenEXR/Imath 3.x:
96+
$<$<TARGET_EXISTS:OpenEXR::OpenEXR>:OpenEXR::OpenEXR>
97+
$<$<TARGET_EXISTS:Imath::Imath>:Imath::Imath>
98+
$<$<TARGET_EXISTS:Imath::Half>:Imath::Half>
99+
# For OpenEXR 2.4/2.5:
100+
$<$<TARGET_EXISTS:OpenEXR::IlmImf>:OpenEXR::IlmImf>
101+
$<$<TARGET_EXISTS:IlmBase::Imath>:IlmBase::Imath>
102+
$<$<TARGET_EXISTS:IlmBase::Half>:IlmBase::Half>
103+
$<$<TARGET_EXISTS:IlmBase::IlmThread>:IlmBase::IlmThread>
104+
$<$<TARGET_EXISTS:IlmBase::Iex>:IlmBase::Iex>
105+
# ZLIB for OpenEXR 2.x:
106+
$<$<TARGET_EXISTS:ZLIB::ZLIB>:ZLIB::ZLIB>)
93107

94108
install(TARGETS ojph_expand
95109
EXPORT openjph-config

0 commit comments

Comments
 (0)