Skip to content

Commit cc93a8d

Browse files
committed
[cmake] workaround for opensuse libpng
It does not support RelWithDebInfo build type, fall back to plain Release
1 parent 17170c5 commit cc93a8d

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

cmake/modules/SearchInstalledSoftware.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,15 @@ if(asimage)
178178
# This check can be added only now because of the reasons explained above, where all
179179
# other required dependencies are checked.
180180
ROOT_FIND_REQUIRED_DEP(PNG builtin_png)
181+
# special check for opensuse which does not provide RelWithDebInfo for PNG
182+
if(NOT builtin_png AND TARGET PNG::PNG)
183+
get_target_property(PNG_RELWITHDEB_LOC PNG::PNG IMPORTED_LOCATION_RELWITHDEBINFO)
184+
get_target_property(PNG_RELEASE_LOC PNG::PNG IMPORTED_LOCATION_RELEASE)
185+
if(NOT PNG_RELWITHDEB_LOC AND PNG_RELEASE_LOC)
186+
message(STATUS "PNG::PNG misses RelWithDebInfo. Use Release as fallback.")
187+
set_target_properties(PNG::PNG PROPERTIES MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release)
188+
endif()
189+
endif()
181190
ROOT_FIND_REQUIRED_DEP(TIFF builtin_tiff)
182191
endif()
183192

@@ -369,7 +378,7 @@ if(asimage)
369378
get_target_property(JPEG_LIBRARY_LOCATION JPEG::JPEG IMPORTED_LOCATION)
370379
endif()
371380
list(APPEND ASEXTRA_LIBRARIES JPEG::JPEG)
372-
381+
373382
if(builtin_tiff)
374383
add_subdirectory(builtins/libtiff)
375384
get_target_property(TIFF_INCLUDE_DIR TIFF::TIFF INTERFACE_INCLUDE_DIRECTORIES)

0 commit comments

Comments
 (0)