diff CMakeLists.txt @ 180:43aec6678cad

cmake: add options
author David Demelier <markand@malikania.fr>
date Tue, 27 Oct 2020 14:07:18 +0100
parents 6a15145b331e
children a5436e15898d
line wrap: on
line diff
--- a/CMakeLists.txt	Tue Oct 27 14:07:04 2020 +0100
+++ b/CMakeLists.txt	Tue Oct 27 14:07:18 2020 +0100
@@ -34,6 +34,10 @@
 	set(CMAKE_EXE_LINKER_FLAGS "${options} ${CMAKE_EXE_LINKER_FLAGS}")
 endif ()
 
+option(MOLKO_WITH_DOXYGEN "Enable Doxygen build" On)
+option(MOLKO_WITH_TESTS "Enable unit tests" On)
+option(MOLKO_WITH_EXAMPLES "Enable build of examples" On)
+
 set_property(GLOBAL PROPERTY USE_FOLDERS On)
 
 include(GNUInstallDirs)
@@ -46,14 +50,14 @@
 find_package(Jansson REQUIRED)
 find_package(SDL2 REQUIRED COMPONENTS image mixer ttf)
 
-enable_testing()
-
 add_subdirectory(cmake)
 
 add_subdirectory(extern/libsqlite)
 add_subdirectory(extern/libgreatest)
 
-add_subdirectory(doxygen)
+if (MOLKO_WITH_DOXYGEN)
+	add_subdirectory(doxygen)
+endif ()
 
 add_subdirectory(tools/bcc)
 add_subdirectory(tools/map)
@@ -64,6 +68,11 @@
 add_subdirectory(libadventure)
 add_subdirectory(molko)
 
-add_subdirectory(examples)
+if (MOLKO_WITH_EXAMPLES)
+	add_subdirectory(examples)
+endif ()
 
-add_subdirectory(tests)
+if (MOLKO_WITH_TESTS)
+	enable_testing()
+	add_subdirectory(tests)
+endif ()