Skip to content

Commit

Permalink
BUILD: Allow overwrite of cpp std & target platform
Browse files Browse the repository at this point in the history
If CMAKE_CXX_STANDARD and/or CMAKE_OSX_DEPLOYMENT_TARGET are specified
on the command line when invoking cmake, these values will be respected
instead of being overwritten by the project.
  • Loading branch information
Krzmbrzl committed Jan 21, 2024
1 parent 84e881d commit 58e24d6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ if ("${BUILD_NUMBER}" STREQUAL "")
endif()
endif()

if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
set(CMAKE_CXX_EXTENSIONS OFF)

if(NOT DEFINED CMAKE_OSX_DEPLOYMENT_TARGET)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)
endif()

# Get compilation year
string(TIMESTAMP MUMBLE_BUILD_YEAR "%Y")

Expand All @@ -37,10 +46,6 @@ project(mumble
set(3RDPARTY_DIR "${CMAKE_SOURCE_DIR}/3rdparty")
set(PLUGINS_DIR "${CMAKE_SOURCE_DIR}/plugins")

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)

list(APPEND CMAKE_MODULE_PATH
"${CMAKE_SOURCE_DIR}/cmake"
"${CMAKE_SOURCE_DIR}/cmake/FindModules"
Expand Down

0 comments on commit 58e24d6

Please sign in to comment.