CMakeLists.txt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. cmake_minimum_required(VERSION 3.23)
  2. project(libdng C)
  3. set(CMAKE_C_STANDARD 23)
  4. set(LIBRARY_VERSION_MAJOR 0)
  5. set(LIBRARY_VERSION_STRING 0.1)
  6. set(CMAKE_C_VISIBILITY_PRESET hidden)
  7. add_definitions(-D_XOPEN_SOURCE=700)
  8. add_library(libdng SHARED include/libdng.h src/libdng.c src/dng.h src/mode.c src/repack.c src/repack.h src/dcp.c)
  9. set_target_properties(libdng PROPERTIES
  10. VERSION ${LIBRARY_VERSION_STRING}
  11. SOVERSION ${LIBRARY_VERSION_MAJOR}
  12. PUBLIC_HEADER include/libdng.h)
  13. target_include_directories(libdng PUBLIC include)
  14. target_link_libraries(libdng "tiff")
  15. add_executable(makedng util/makedng.c)
  16. target_include_directories(makedng PUBLIC include)
  17. target_link_libraries(makedng PUBLIC libdng)
  18. add_executable(dngmerge util/dngmerge.c)
  19. target_include_directories(dngmerge PUBLIC include)
  20. target_link_libraries(dngmerge PUBLIC libdng)
  21. find_program(BASH bash)
  22. enable_testing()
  23. find_program(DNG_VALIDATE dng_validate)
  24. if (DNG_VALIDATE)
  25. add_test(NAME test_dng_validate COMMAND ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_dng_validate.sh $<TARGET_FILE:makedng>)
  26. endif (DNG_VALIDATE)
  27. add_subdirectory(tests)