summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2018-05-20 18:46:32 -0400
committerCosmin Truta <ctruta@gmail.com>2020-05-18 18:46:32 -0400
commit28c0f8895e4ac270b56b5c7e8089dd2417bc4e3c (patch)
tree86126a0572923bd80216f2440803f24311cca2e8
parent87378bc21d642f109f9d09431302fd75071a82e0 (diff)
downloadlibpng-28c0f8895e4ac270b56b5c7e8089dd2417bc4e3c.tar.gz
cmake: Add an option to enable/disable building of executables
Add the CMake option PNG_EXECUTABLES (on by default) in order to allow or disallow the building of non-essential executable programs associated with libpng. Contributed-by: Alex Gaynor <alex.gaynor@gmail.com> Contributed-by: Cosmin Truta <ctruta@gmail.com> Signed-off-by: Cosmin Truta <ctruta@gmail.com>
-rw-r--r--CMakeLists.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 013f76e9f..d3942046f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,6 +16,7 @@
# Revised by David Callu, 2020
# Revised by Steve Robinson, 2020
# Revised by Simon Hausmann, 2020
+# Revised by Alex Gaynor, 2020
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
@@ -56,7 +57,8 @@ endif()
# COMMAND LINE OPTIONS
option(PNG_SHARED "Build shared lib" ON)
option(PNG_STATIC "Build static lib" ON)
-option(PNG_TESTS "Build libpng tests" ON)
+option(PNG_EXECUTABLES "Build libpng executables" ON)
+option(PNG_TESTS "Build libpng tests" ON)
# Many more configuration options could be added here
option(PNG_FRAMEWORK "Build OS X framework" OFF)
@@ -750,7 +752,7 @@ if(PNG_TESTS AND PNG_SHARED)
png_add_test(NAME pngimage-full COMMAND pngimage OPTIONS --exhaustive --list-combos --log FILES ${PNGSUITE_PNGS})
endif()
-if(PNG_SHARED)
+if(PNG_SHARED AND PNG_EXECUTABLES)
add_executable(pngfix ${pngfix_sources})
target_link_libraries(pngfix png)
set(PNG_BIN_TARGETS pngfix)