Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

4 лет назад
4 лет назад
4 лет назад
4 лет назад
4 лет назад
4 лет назад
4 лет назад
4 лет назад
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. cmake_minimum_required (VERSION 3.0.0)
  2. list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
  3. set(PROJECT_VERSION "1.7.0")
  4. project(aptdec)
  5. file(GLOB_RECURSE C_SOURCE_FILES src/*.c)
  6. add_executable(aptdec ${C_SOURCE_FILES})
  7. add_compile_definitions(PALETTE_DIR="${CMAKE_SOURCE_DIR}/palettes")
  8. # Math
  9. target_link_libraries(aptdec PRIVATE m)
  10. # Throw errors on warnings on release builds
  11. if(CMAKE_BUILD_TYPE MATCHES "Release")
  12. target_compile_options(aptdec PRIVATE -Wall -Wextra -pedantic -Wno-missing-field-initializers -Werror)
  13. else()
  14. target_compile_options(aptdec PRIVATE -Wall -Wextra -pedantic)
  15. endif()
  16. # libpng
  17. target_link_libraries(aptdec PRIVATE PNG::PNG)
  18. if(WIN32 AND NOT MINGW)
  19. find_package(PNG CONFIG REQUIRED)
  20. else()
  21. find_package(PNG REQUIRED)
  22. endif()
  23. # libsndfile
  24. find_package(LibSndFile REQUIRED)
  25. target_link_libraries(aptdec PRIVATE ${LIBSNDFILE_LIBRARY})
  26. # CPack
  27. set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
  28. set(CPACK_PACKAGE_NAME "aptdec")
  29. set(CPACK_PACKAGE_CONTACT "Xerbo (xerbo@protonmail.com)")
  30. set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "NOAA APT satellite imagery decoder")
  31. set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
  32. set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
  33. IF(NOT WIN32)
  34. set(CPACK_GENERATOR "DEB")
  35. set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.${CMAKE_SYSTEM_PROCESSOR}")
  36. install(TARGETS aptdec DESTINATION "bin/")
  37. install(DIRECTORY "${PROJECT_SOURCE_DIR}/palettes/" DESTINATION "lib/aptdec/palettes")
  38. else()
  39. #set(CPACK_GENERATOR "ZIP;NSIS")
  40. set(CPACK_GENERATOR "ZIP")
  41. set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
  42. install(TARGETS aptdec DESTINATION "bin/")
  43. install(FILES libpng16.dll libsndfile-1.dll libzlib.dll DESTINATION "bin/")
  44. install(DIRECTORY "${PROJECT_SOURCE_DIR}/palettes/" DESTINATION "palettes/")
  45. endif()
  46. include(CPack)