From 922ad66aff99d8455abae39bb6eda9fcccb39698 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Sun, 1 Dec 2024 20:00:22 -0500 Subject: [PATCH] refactor: options in place remove use of env vars to set build options users should set these at cmake configure time --- CMakeLists.txt | 1 - cmake/Build.cmake | 35 ----------------------------------- cmake/Libraries.cmake | 2 ++ src/CMakeLists.txt | 2 ++ src/cmd/CMakeLists.txt | 1 + 5 files changed, 5 insertions(+), 36 deletions(-) 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)