CMakeLists.txt 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 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_compile_definitions(SYSCONFDIR="/etc")
  24. add_compile_definitions(DATADIR="/usr/share")
  25. include_directories(${CMAKE_CURRENT_BINARY_DIR})
  26. add_custom_command(
  27. OUTPUT config.h
  28. COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/config.h
  29. DEPENDS CMakeLists.txt
  30. COMMENT "Generating dummy header for meson compat..."
  31. )