Skip to content

Commit

Permalink
Add support for libpng and libtiff
Browse files Browse the repository at this point in the history
  • Loading branch information
daljit46 committed Jul 27, 2023
1 parent 5aecdf3 commit 05963ac
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ find_package(Eigen3 REQUIRED NO_MODULE)
find_package(ZLIB REQUIRED)
find_package(FFTW REQUIRED)
find_package(Git QUIET)
find_package(PNG QUIET)
find_package(TIFF QUIET)

add_library(mrtrix-core SHARED ${CORE_SRCS})
add_library(mrtrix::core ALIAS mrtrix-core)
Expand Down Expand Up @@ -42,6 +44,20 @@ target_compile_definitions(mrtrix-core PUBLIC
MRTRIX_BASE_VERSION="${MRTRIX_BASE_VERSION}"
)

if(PNG_FOUND)
target_compile_definitions(mrtrix-core PUBLIC MRTRIX_PNG_SUPPORT)
target_link_libraries(mrtrix-core PUBLIC PNG::PNG)
else()
message(WARNING "libpng not found, disabling PNG support")
endif()

if(TIFF_FOUND)
target_compile_definitions(mrtrix-core PUBLIC MRTRIX_TIFF_SUPPORT)
target_link_libraries(mrtrix-core PUBLIC TIFF::TIFF)
else()
message(WARNING "libtiff not found, disabling TIFF support")
endif()

target_link_libraries(mrtrix-core PUBLIC
Eigen3::Eigen
ZLIB::ZLIB
Expand Down

0 comments on commit 05963ac

Please sign in to comment.