diff --git a/CMakeLists.txt b/CMakeLists.txt
index bfd089f59..2b507c41b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -107,7 +107,6 @@ include(cmake/Packaging.cmake)
include(GNUInstallDirs)
-configure_options()
configure_libs()
add_subdirectory(doc)
diff --git a/cmake/Build.cmake b/cmake/Build.cmake
index 0a86eb4c8..358e6e008 100644
--- a/cmake/Build.cmake
+++ b/cmake/Build.cmake
@@ -13,41 +13,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-macro(configure_options)
-
- set(DEFAULT_BUILD_GUI ON)
- set(DEFAULT_BUILD_TESTS ON)
-
- # unified binary is off by default for now, for backwards compatibility.
- set(DEFAULT_BUILD_UNIFIED OFF)
-
- # coverage is off by default because it's GCC only and a developer preference.
- set(DEFAULT_ENABLE_COVERAGE OFF)
-
- if("$ENV{DESKFLOW_BUILD_MINIMAL}" STREQUAL "true")
- set(DEFAULT_BUILD_GUI OFF)
- set(DEFAULT_BUILD_INSTALLER OFF)
- endif()
-
- if("$ENV{DESKFLOW_BUILD_TESTS}" STREQUAL "false")
- set(DEFAULT_BUILD_TESTS OFF)
- endif()
-
- if("$ENV{DESKFLOW_BUILD_UNIFIED}" STREQUAL "true")
- set(DEFAULT_BUILD_UNIFIED ON)
- endif()
-
- if("$ENV{DESKFLOW_ENABLE_COVERAGE}" STREQUAL "true")
- set(DEFAULT_ENABLE_COVERAGE ON)
- endif()
-
- option(BUILD_GUI "Build GUI" ${DEFAULT_BUILD_GUI})
- option(BUILD_TESTS "Build tests" ${DEFAULT_BUILD_TESTS})
- option(BUILD_UNIFIED "Build unified binary" ${DEFAULT_BUILD_UNIFIED})
- option(ENABLE_COVERAGE "Enable test coverage" ${DEFAULT_ENABLE_COVERAGE})
-
-endmacro()
-
macro(post_config)
# Build to a temp bin dir on Windows and then copy to the final bin dir
diff --git a/cmake/Libraries.cmake b/cmake/Libraries.cmake
index d3e49ea9e..53b630002 100644
--- a/cmake/Libraries.cmake
+++ b/cmake/Libraries.cmake
@@ -28,6 +28,8 @@ macro(configure_libs)
configure_qt()
configure_openssl()
+
+ option(ENABLE_COVERAGE "Enable test coverage" OFF)
configure_coverage()
endmacro()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 338b10908..765ed04fc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -20,10 +20,12 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/lib)
add_subdirectory(lib)
add_subdirectory(cmd)
+option(BUILD_GUI "Build GUI" ON)
if(BUILD_GUI)
add_subdirectory(gui)
endif(BUILD_GUI)
+option(BUILD_TESTS "Build tests" ON)
if(BUILD_TESTS)
add_subdirectory(test)
endif()
diff --git a/src/cmd/CMakeLists.txt b/src/cmd/CMakeLists.txt
index 7ddccc97e..42286e0fa 100644
--- a/src/cmd/CMakeLists.txt
+++ b/src/cmd/CMakeLists.txt
@@ -14,6 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
+option(BUILD_UNIFIED "Build unified binary" OFF)
if(BUILD_UNIFIED)
add_subdirectory(deskflow-core)