CMakeLists.txt 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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_library(libdng SHARED include/libdng.h src/libdng.c src/dng.h src/mode.c src/repack.c src/repack.h src/dcp.c)
  8. set_target_properties(libdng PROPERTIES
  9. VERSION ${LIBRARY_VERSION_STRING}
  10. SOVERSION ${LIBRARY_VERSION_MAJOR}
  11. PUBLIC_HEADER include/libdng.h)
  12. target_include_directories(libdng PUBLIC include)
  13. target_link_libraries(libdng "tiff")
  14. add_executable(makedng util/makedng.c)
  15. target_include_directories(makedng PUBLIC include)
  16. target_link_libraries(makedng PUBLIC libdng)
  17. add_executable(dngmerge util/dngmerge.c)
  18. target_include_directories(dngmerge PUBLIC include)
  19. target_link_libraries(dngmerge PUBLIC libdng)
  20. find_program(BASH bash)
  21. enable_testing()
  22. find_program(DNG_VALIDATE dng_validate)
  23. if (DNG_VALIDATE)
  24. add_test(NAME test_dng_validate COMMAND ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_dng_validate.sh $<TARGET_FILE:makedng>)
  25. endif (DNG_VALIDATE)
  26. add_subdirectory(tests)