2
0

build.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. diff --git a/CMakeLists.txt b/CMakeLists.txt
  2. index 57cd95d..67c703a 100644
  3. --- a/CMakeLists.txt
  4. +++ b/CMakeLists.txt
  5. @@ -280,8 +280,10 @@ else (USE_EXT_GD)
  6. add_subdirectory(src)
  7. endif (USE_EXT_GD)
  8. +if(BUILD_TEST)
  9. add_subdirectory(tests)
  10. add_subdirectory(examples)
  11. +endif()
  12. add_custom_target(distclean ${GD_SOURCE_DIR}/cmake/distclean.sh)
  13. @@ -299,6 +301,7 @@ else(WIN32)
  14. endif(WIN32)
  15. +if (BUILD_DOCS)
  16. INSTALL(FILES docs/INSTALL DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
  17. INSTALL(FILES docs/README.JPN DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
  18. INSTALL(FILES docs/README.CMAKE DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
  19. @@ -320,6 +323,7 @@ INSTALL(FILES examples/test_crop_threshold.png DESTINATION share/doc/gd-${GDLIB_
  20. INSTALL(FILES examples/tgaread.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
  21. INSTALL(FILES examples/tiffread.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
  22. INSTALL(FILES examples/windows.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR})
  23. +endif()
  24. set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
  25. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
  26. index 509c422..45c27f4 100644
  27. --- a/src/CMakeLists.txt
  28. +++ b/src/CMakeLists.txt
  29. @@ -98,7 +98,7 @@ if (BUILD_STATIC_LIBS)
  30. endif()
  31. endif()
  32. -if (NOT "${GD_PROGRAMS_LIB_SRC_FILES}" STREQUAL "")
  33. +if (BUILD_PROGRAMS AND NOT "${GD_PROGRAMS_LIB_SRC_FILES}" STREQUAL "")
  34. add_library(gd_programs_lib STATIC ${GD_PROGRAMS_LIB_SRC_FILES})
  35. endif()
  36. @@ -148,6 +148,7 @@ SET(LIBS_PRIVATES
  37. ${WEBP_LIBRARIES}
  38. )
  39. +if (BUILD_PROGRAMS)
  40. set(GD_PROGRAMS gdcmpgif)
  41. if (PNG_FOUND)
  42. @@ -178,6 +179,9 @@ foreach(program ${GD_PROGRAMS})
  43. endforeach(program)
  44. set(GD_INSTALL_TARGETS ${GD_PROGRAMS})
  45. +else ()
  46. +set(GD_INSTALL_TARGETS )
  47. +endif ()
  48. if (BUILD_SHARED_LIBS)
  49. set(GD_INSTALL_TARGETS ${GD_INSTALL_TARGETS} ${GD_LIB})
  50. endif()
  51. @@ -189,7 +193,9 @@ install(TARGETS ${GD_INSTALL_TARGETS}
  52. RUNTIME DESTINATION bin
  53. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  54. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
  55. +if (UNIX)
  56. install(PROGRAMS bdftogd DESTINATION bin)
  57. +endif ()
  58. install(FILES
  59. entities.h
  60. gd.h