Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Fixed use of ENV in CMake if (deskflow#7366)
Browse files Browse the repository at this point in the history
* Fixed use of `ENV` in CMake `if`s and only set product name when no licensing

* Check for empty strings
  • Loading branch information
nbolton authored Jul 4, 2024
1 parent 4690b61 commit 8c239d7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions cmake/Definitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ macro(configure_definitions)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")

set(PRODUCT_NAME "Synergy 1 Community Edition")
if(DEFINED $ENV{SYNERGY_PRODUCT_NAME})
message(STATUS "Product name: $ENV{SYNERGY_PRODUCT_NAME}")
set(PRODUCT_NAME $ENV{SYNERGY_PRODUCT_NAME})
endif()
add_definitions(-DSYNERGY_PRODUCT_NAME="${PRODUCT_NAME}")

configure_ninja()
configure_options()

if(ENABLE_LICENSING)
message(STATUS "Licensing enabled")
add_definitions(-DSYNERGY_ENABLE_LICENSING=1)
else()
set(PRODUCT_NAME "Synergy 1 Community Edition")
if(NOT "$ENV{SYNERGY_PRODUCT_NAME}" STREQUAL "")
set(PRODUCT_NAME $ENV{SYNERGY_PRODUCT_NAME})
endif()
message(STATUS "Product name: ${PRODUCT_NAME}")
add_definitions(-DSYNERGY_PRODUCT_NAME="${PRODUCT_NAME}")
endif()

if(ENABLE_AUTO_CONFIG)
Expand Down Expand Up @@ -87,24 +87,24 @@ macro(configure_options)
# licensing is off by default to make life easier for contributors.
set(DEFAULT_ENABLE_LICENSING OFF)

if(DEFINED $ENV{SYNERGY_BUILD_MINIMAL})
if("$ENV{SYNERGY_BUILD_MINIMAL}" STREQUAL "true")
set(DEFAULT_BUILD_GUI OFF)
set(DEFAULT_BUILD_INSTALLER OFF)
endif()

if(DEFINED $ENV{SYNERGY_NO_TESTS})
if("$ENV{SYNERGY_BUILD_TESTS}" STREQUAL "false")
set(DEFAULT_BUILD_TESTS OFF)
endif()

if(DEFINED $ENV{SYNERGY_BUILD_UNIFIED})
if("$ENV{SYNERGY_BUILD_UNIFIED}" STREQUAL "true")
set(DEFAULT_BUILD_UNIFIED ON)
endif()

if(DEFINED $ENV{SYNERGY_ENABLE_LICENSING})
if("$ENV{SYNERGY_ENABLE_LICENSING}" STREQUAL "true")
set(DEFAULT_ENABLE_LICENSING ON)
endif()

if(DEFINED $ENV{SYNERGY_ENABLE_COVERAGE})
if("$ENV{SYNERGY_ENABLE_COVERAGE}" STREQUAL "true")
set(DEFAULT_ENABLE_COVERAGE ON)
endif()

Expand Down

0 comments on commit 8c239d7

Please sign in to comment.