Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 

62 рядки
2.1 KiB

  1. cmake_minimum_required (VERSION 3.0.0)
  2. list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
  3. project(aptdec)
  4. file(GLOB_RECURSE C_SOURCE_FILES src/*.c src/libs/*.c)
  5. add_executable(aptdec ${C_SOURCE_FILES})
  6. add_compile_definitions(PALETTE_DIR="../palettes")
  7. # Math
  8. target_link_libraries(aptdec PRIVATE m)
  9. # Throw errors on warnings on release builds
  10. if(CMAKE_BUILD_TYPE MATCHES "Release")
  11. target_compile_options(aptdec PRIVATE -Wall -Wextra -pedantic -Wno-missing-field-initializers -Werror)
  12. else()
  13. target_compile_options(aptdec PRIVATE -Wall -Wextra -pedantic)
  14. endif()
  15. # libpng
  16. target_link_libraries(aptdec PRIVATE PNG::PNG)
  17. if(WIN32 AND NOT MINGW)
  18. find_package(PNG CONFIG REQUIRED)
  19. else()
  20. find_package(PNG REQUIRED)
  21. endif()
  22. # libsndfile
  23. find_package(LibSndFile REQUIRED)
  24. target_link_libraries(aptdec PRIVATE ${LIBSNDFILE_LIBRARY})
  25. # TODO: get this from git
  26. set(PROJECT_VERSION "1.7.0")
  27. # CPack
  28. set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
  29. set(CPACK_PACKAGE_NAME "aptdec")
  30. set(CPACK_PACKAGE_CONTACT "Xerbo (xerbo@protonmail.com)")
  31. set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "NOAA APT satellite imagery decoder")
  32. set(CPACK_PACKAGE_DESCRIPTION "Aptdec is a FOSS program that decodes images transmitted by NOAA weather satellites. These satellites transmit constantly (among other things) medium resolution (4km/px) images of the earth over a analog mode called APT.")
  33. set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
  34. set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
  35. IF(NOT WIN32)
  36. set(CPACK_GENERATOR "DEB;TGZ")
  37. set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.${CMAKE_SYSTEM_PROCESSOR}")
  38. install(TARGETS aptdec DESTINATION "bin/")
  39. install(DIRECTORY "${PROJECT_SOURCE_DIR}/palettes/" DESTINATION "palettes/")
  40. else()
  41. #set(CPACK_GENERATOR "ZIP;NSIS")
  42. set(CPACK_GENERATOR "ZIP")
  43. set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
  44. install(TARGETS aptdec DESTINATION "bin/")
  45. file(GLOB_RECURSE DLLS *.dll)
  46. install(FILES ${DLLS} DESTINATION "bin/")
  47. install(DIRECTORY "${PROJECT_SOURCE_DIR}/palettes/" DESTINATION "palettes/")
  48. endif()
  49. include(CPack)