Skip to content

Commit

Permalink
CMake: PCIDSK: fix build without JPEG (fixes OSGeo#5741)
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed May 17, 2022
1 parent 451d38b commit c25a2d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion frmts/pcidsk/CMakeLists.txt
Expand Up @@ -12,6 +12,6 @@ gdal_standard_includes(gdal_PCIDSK)
target_include_directories(gdal_PCIDSK PRIVATE $<TARGET_PROPERTY:pcidsk_sdk,SOURCE_DIR>)
add_subdirectory(sdk)

if (NOT GDAL_USE_JPEG_INTERNAL)
if (GDAL_USE_JPEG AND NOT GDAL_USE_JPEG_INTERNAL)
gdal_target_link_libraries(gdal_PCIDSK PRIVATE JPEG::JPEG)
endif ()
17 changes: 8 additions & 9 deletions frmts/pcidsk/sdk/CMakeLists.txt
Expand Up @@ -71,15 +71,14 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16)
set_property(TARGET pcidsk_sdk PROPERTY UNITY_BUILD OFF)
endif ()

target_compile_definitions(pcidsk_sdk PRIVATE -DHAVE_LIBJPEG)
if (GDAL_USE_JPEG_INTERNAL)
target_include_directories(pcidsk_sdk PRIVATE $<TARGET_PROPERTY:libjpeg,SOURCE_DIR>)
if (RENAME_INTERNAL_JPEG_SYMBOLS)
target_compile_definitions(pcidsk_sdk PRIVATE -DRENAME_INTERNAL_LIBJPEG_SYMBOLS)
endif ()
else ()
target_include_directories(pcidsk_sdk PRIVATE ${JPEG_INCLUDE_DIRS})
endif ()
if (GDAL_USE_JPEG OR GDAL_USE_JPEG_INTERNAL)
target_compile_definitions(pcidsk_sdk PRIVATE -DHAVE_LIBJPEG)
if (GDAL_USE_JPEG_INTERNAL)
gdal_add_vendored_lib(pcidsk_sdk libjpeg)
else ()
target_include_directories(pcidsk_sdk PRIVATE ${JPEG_INCLUDE_DIRS})
endif ()
endif()

if (NOT TARGET PCIDSK::PCIDSK)
add_library(PCIDSK::PCIDSK UNKNOWN IMPORTED)
Expand Down

0 comments on commit c25a2d8

Please sign in to comment.