refactor: options in place

remove use of env vars to set build options
 users should set these at cmake configure time
This commit is contained in:
sithlord48
2024-12-01 20:00:22 -05:00
committed by Chris Rizzitello
parent b0d22926f9
commit 922ad66aff
5 changed files with 5 additions and 36 deletions

View File

@ -107,7 +107,6 @@ include(cmake/Packaging.cmake)
include(GNUInstallDirs)
configure_options()
configure_libs()
add_subdirectory(doc)

View File

@ -13,41 +13,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
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

View File

@ -28,6 +28,8 @@ macro(configure_libs)
configure_qt()
configure_openssl()
option(ENABLE_COVERAGE "Enable test coverage" OFF)
configure_coverage()
endmacro()

View File

@ -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()

View File

@ -14,6 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
option(BUILD_UNIFIED "Build unified binary" OFF)
if(BUILD_UNIFIED)
add_subdirectory(deskflow-core)