From b0d22926f90cb2da698b36fc2181071f53a9810a Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Sun, 1 Dec 2024 19:52:15 -0500 Subject: [PATCH] refactor: rm :cmake/Defines move last macro to Bulid.cmake --- CMakeLists.txt | 1 - cmake/Build.cmake | 35 +++++++++++++++++++++++++++++ cmake/Definitions.cmake | 50 ----------------------------------------- 3 files changed, 35 insertions(+), 51 deletions(-) delete mode 100644 cmake/Definitions.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 13f4beac7..bfd089f59 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,7 +101,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") set(BIN_TEMP_DIR ${PROJECT_BINARY_DIR}/temp/bin) -include(cmake/Definitions.cmake) include(cmake/Build.cmake) include(cmake/Libraries.cmake) include(cmake/Packaging.cmake) diff --git a/cmake/Build.cmake b/cmake/Build.cmake index 358e6e008..0a86eb4c8 100644 --- a/cmake/Build.cmake +++ b/cmake/Build.cmake @@ -13,6 +13,41 @@ # 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/Definitions.cmake b/cmake/Definitions.cmake deleted file mode 100644 index 3d25533d8..000000000 --- a/cmake/Definitions.cmake +++ /dev/null @@ -1,50 +0,0 @@ -# Deskflow -- mouse and keyboard sharing utility -# Copyright (C) 2012-2024 Symless Ltd. -# Copyright (C) 2009-2012 Nick Bolton -# -# This package is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# found in the file LICENSE that should have accompanied this file. -# -# This package is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# 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()