summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorsezero <sezero@users.sourceforge.net>2019-11-14 01:10:02 +0300
committerErik de Castro Lopo <erikd@mega-nerd.com>2019-11-15 19:06:58 +1100
commitcdcf0d557597e31a4d0230fbf472d3fb3f09c829 (patch)
tree13aba73060ff513aa6d3dd5413d262c019b61981 /CMakeLists.txt
parent2907d4921cc4e46751c18478f5cbe1d60ce50cac (diff)
downloadflac-cdcf0d557597e31a4d0230fbf472d3fb3f09c829.tar.gz
cmake_minimum_required() cleanup:
- document version requirements in the top-level file. - remove incorrect version requirements from sub-dirs. - set min. required version to 3.5 in top-level file. - set minimun required version to 3.9 under docs/ . - make documents building an option (on by default.) so, the tree can be built using cmake-3.5 using -DBUILD_DOCS=0 on the command line.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 9 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d4578c5b..9c9e9556 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,8 @@
-cmake_minimum_required(VERSION 3.9)
+# 3.1 is OK for most parts. However:
+# 3.3 is needed in src/libFLAC
+# 3.5 is needed in src/libFLAC/ia32
+# 3.9 is needed in 'doc' because of doxygen_add_docs()
+cmake_minimum_required(VERSION 3.5)
if(NOT (CMAKE_BUILD_TYPE OR CMAKE_CONFIGURATION_TYPES OR DEFINED ENV{CFLAGS} OR DEFINED ENV{CXXFLAGS}))
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo")
@@ -10,6 +14,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
option(BUILD_CXXLIBS "Build libFLAC++" ON)
option(BUILD_EXAMPLES "Build and install examples" ON)
+option(BUILD_DOCS "Build and install doxygen documents" ON)
option(WITH_OGG "ogg support (default: test for libogg)" ON)
if(WITH_OGG)
@@ -93,9 +98,11 @@ if(CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
add_definitions(-DFLAC__OVERFLOW_DETECT)
endif()
-add_subdirectory("doc")
add_subdirectory("src")
add_subdirectory("microbench")
+if(BUILD_DOCS)
+ add_subdirectory("doc")
+endif()
if(BUILD_EXAMPLES)
add_subdirectory("examples")
endif()