aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGtker <git@gtker.com>2022-09-24 11:13:27 +0200
committerGtker <git@gtker.com>2022-09-24 11:13:27 +0200
commit9d6fa9312fc26b87fd0aafb1812c53ebf7194e57 (patch)
treef81e96fd2672f394ea5f25defbd84522d0e67f60 /CMakeLists.txt
parent7a664bf6be4377aabe03f118fcdb6d1d3abc48f5 (diff)
Add `STORM_USE_BUNDLED_LIBRARIES` option that defaults to OFF
This makes builds more reproducible since they aren't dependent on whatever library happens to be installed.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3ec5998..9cf1050 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,6 +10,10 @@ include(CMakeDependentOption)
option(BUILD_SHARED_LIBS "Compile shared libraries" OFF)
option(STORM_SKIP_INSTALL "Skip installing files" OFF)
+option(STORM_USE_BUNDLED_LIBRARIES
+ "Force use of bundled dependencies instead of system libraries."
+ OFF
+)
option(STORM_BUILD_TESTS
"Compile StormLib test application" OFF
# "BUILD_TESTING" OFF # Stay coherent with CTest variables
@@ -286,7 +290,7 @@ add_definitions(-D_7ZIP_ST -DBZ_STRICT_ANSI)
set(LINK_LIBS)
find_package(ZLIB)
-if (ZLIB_FOUND)
+if (ZLIB_FOUND AND NOT STORM_USE_BUNDLED_LIBRARIES)
set(LINK_LIBS ${LINK_LIBS} ZLIB::ZLIB)
add_definitions(-D__SYS_ZLIB)
else()
@@ -294,7 +298,7 @@ else()
endif()
find_package(BZip2)
-if (BZIP2_FOUND)
+if (BZIP2_FOUND AND NOT STORM_USE_BUNDLED_LIBRARIES)
set(LINK_LIBS ${LINK_LIBS} BZip2::BZip2)
add_definitions(-D__SYS_BZLIB)
else()