From 4830f27a40323fe859dc166337a2b861877b7121 Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 1 Jan 2018 13:40:09 +0100 Subject: sync with upstream --- cmake/scripts/common/Platform.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'cmake/scripts/common/Platform.cmake') diff --git a/cmake/scripts/common/Platform.cmake b/cmake/scripts/common/Platform.cmake index b19b7e5..5ac233a 100644 --- a/cmake/scripts/common/Platform.cmake +++ b/cmake/scripts/common/Platform.cmake @@ -2,14 +2,17 @@ if(NOT CORE_SYSTEM_NAME) string(TOLOWER ${CMAKE_SYSTEM_NAME} CORE_SYSTEM_NAME) endif() -if(CORE_SYSTEM_NAME STREQUAL linux) +if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd) # Set default CORE_PLATFORM_NAME to X11 # This is overridden by user setting -DCORE_PLATFORM_NAME= set(_DEFAULT_PLATFORM X11) + option(ENABLE_APP_AUTONAME "Enable renaming the binary according to windowing?" ON) else() string(TOLOWER ${CORE_SYSTEM_NAME} _DEFAULT_PLATFORM) endif() +set(APP_BINARY_SUFFIX ".bin") + # # Note: please do not use CORE_PLATFORM_NAME in any checks, # use the normalized to lower case CORE_PLATFORM_NAME_LC (see below) instead @@ -23,10 +26,12 @@ string(TOLOWER ${CORE_PLATFORM_NAME} CORE_PLATFORM_NAME_LC) list(APPEND final_message "Platform: ${CORE_PLATFORM_NAME}") if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake) include(${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake) + if(ENABLE_APP_AUTONAME) + set(APP_BINARY_SUFFIX "-${CORE_PLATFORM_NAME_LC}") + endif() else() file(GLOB _platformnames RELATIVE ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/ ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/*.cmake) string(REPLACE ".cmake" " " _platformnames ${_platformnames}) message(FATAL_ERROR "invalid CORE_PLATFORM_NAME: ${CORE_PLATFORM_NAME_LC}\nValid platforms: ${_platformnames}") endif() - -- cgit v1.2.3