You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.4 KiB

  1. From 28c0f8895e4ac270b56b5c7e8089dd2417bc4e3c Mon Sep 17 00:00:00 2001
  2. From: Alex Gaynor <alex.gaynor@gmail.com>
  3. Date: Sun, 20 May 2018 18:46:32 -0400
  4. Subject: [PATCH] cmake: Add an option to enable/disable building of
  5. executables
  6. Add the CMake option PNG_EXECUTABLES (on by default) in order to
  7. allow or disallow the building of non-essential executable programs
  8. associated with libpng.
  9. Contributed-by: Alex Gaynor <alex.gaynor@gmail.com>
  10. Contributed-by: Cosmin Truta <ctruta@gmail.com>
  11. Signed-off-by: Cosmin Truta <ctruta@gmail.com>
  12. ---
  13. CMakeLists.txt | 6 ++++--
  14. 1 file changed, 4 insertions(+), 2 deletions(-)
  15. --- a/CMakeLists.txt
  16. +++ b/CMakeLists.txt
  17. @@ -53,7 +53,8 @@ endif()
  18. # COMMAND LINE OPTIONS
  19. option(PNG_SHARED "Build shared lib" ON)
  20. option(PNG_STATIC "Build static lib" ON)
  21. -option(PNG_TESTS "Build libpng tests" ON)
  22. +option(PNG_EXECUTABLES "Build libpng executables" ON)
  23. +option(PNG_TESTS "Build libpng tests" ON)
  24. # Many more configuration options could be added here
  25. option(PNG_FRAMEWORK "Build OS X framework" OFF)
  26. @@ -747,7 +748,7 @@ if(PNG_TESTS AND PNG_SHARED)
  27. png_add_test(NAME pngimage-full COMMAND pngimage OPTIONS --exhaustive --list-combos --log FILES ${PNGSUITE_PNGS})
  28. endif()
  29. -if(PNG_SHARED)
  30. +if(PNG_SHARED AND PNG_EXECUTABLES)
  31. add_executable(pngfix ${pngfix_sources})
  32. target_link_libraries(pngfix png)
  33. set(PNG_BIN_TARGETS pngfix)