CMakeLists.txt 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. cmake_minimum_required(VERSION 3.23)
  2. project(libmegapixels C)
  3. set(LIBRARY_VERSION_MAJOR 0)
  4. set(LIBRARY_VERSION_STRING 0.1)
  5. set(CMAKE_C_STANDARD 23)
  6. set(CMAKE_C_VISIBILITY_PRESET hidden)
  7. add_library(megapixels SHARED include/libmegapixels.h src/findconfig.c src/parse.c src/mode.c src/pipeline.c src/log.c src/util.c src/convert.c src/aaa.c src/flash.c config.h)
  8. set_target_properties(megapixels PROPERTIES
  9. VERSION ${LIBRARY_VERSION_STRING}
  10. SOVERSION ${LIBRARY_VERSION_MAJOR}
  11. PUBLIC_HEADER include/libmegapixels.h)
  12. target_include_directories(megapixels PUBLIC include)
  13. target_link_libraries(megapixels "config")
  14. add_executable(findconfig util/findconfig.c)
  15. target_include_directories(findconfig PUBLIC include)
  16. target_link_libraries(findconfig PUBLIC megapixels)
  17. add_executable(getframe util/getframe.c)
  18. target_include_directories(getframe PUBLIC include)
  19. target_link_libraries(getframe PUBLIC megapixels)
  20. add_executable(sensorprofile util/sensorprofile.c)
  21. target_include_directories(sensorprofile PUBLIC include)
  22. target_link_libraries(sensorprofile PUBLIC megapixels)
  23. add_executable(configlint util/configlint.c)
  24. target_include_directories(configlint PUBLIC include)
  25. target_link_libraries(configlint PUBLIC megapixels)
  26. add_compile_definitions(SYSCONFDIR="/etc")
  27. add_compile_definitions(DATADIR="/usr/share")
  28. include_directories(${CMAKE_CURRENT_BINARY_DIR})
  29. add_custom_command(
  30. OUTPUT config.h
  31. COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/config.h
  32. DEPENDS CMakeLists.txt
  33. COMMENT "Generating dummy header for meson compat..."
  34. )
  35. add_subdirectory(tests)