summaryrefslogtreecommitdiffstats
path: root/cmake/scripts/common/Platform.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/scripts/common/Platform.cmake')
-rw-r--r--cmake/scripts/common/Platform.cmake9
1 files changed, 7 insertions, 2 deletions
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)
2 string(TOLOWER ${CMAKE_SYSTEM_NAME} CORE_SYSTEM_NAME) 2 string(TOLOWER ${CMAKE_SYSTEM_NAME} CORE_SYSTEM_NAME)
3endif() 3endif()
4 4
5if(CORE_SYSTEM_NAME STREQUAL linux) 5if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd)
6 # Set default CORE_PLATFORM_NAME to X11 6 # Set default CORE_PLATFORM_NAME to X11
7 # This is overridden by user setting -DCORE_PLATFORM_NAME=<platform> 7 # This is overridden by user setting -DCORE_PLATFORM_NAME=<platform>
8 set(_DEFAULT_PLATFORM X11) 8 set(_DEFAULT_PLATFORM X11)
9 option(ENABLE_APP_AUTONAME "Enable renaming the binary according to windowing?" ON)
9else() 10else()
10 string(TOLOWER ${CORE_SYSTEM_NAME} _DEFAULT_PLATFORM) 11 string(TOLOWER ${CORE_SYSTEM_NAME} _DEFAULT_PLATFORM)
11endif() 12endif()
12 13
14set(APP_BINARY_SUFFIX ".bin")
15
13# 16#
14# Note: please do not use CORE_PLATFORM_NAME in any checks, 17# Note: please do not use CORE_PLATFORM_NAME in any checks,
15# use the normalized to lower case CORE_PLATFORM_NAME_LC (see below) instead 18# 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)
23list(APPEND final_message "Platform: ${CORE_PLATFORM_NAME}") 26list(APPEND final_message "Platform: ${CORE_PLATFORM_NAME}")
24if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake) 27if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake)
25 include(${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake) 28 include(${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake)
29 if(ENABLE_APP_AUTONAME)
30 set(APP_BINARY_SUFFIX "-${CORE_PLATFORM_NAME_LC}")
31 endif()
26else() 32else()
27 file(GLOB _platformnames RELATIVE ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/ 33 file(GLOB _platformnames RELATIVE ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/
28 ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/*.cmake) 34 ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/*.cmake)
29 string(REPLACE ".cmake" " " _platformnames ${_platformnames}) 35 string(REPLACE ".cmake" " " _platformnames ${_platformnames})
30 message(FATAL_ERROR "invalid CORE_PLATFORM_NAME: ${CORE_PLATFORM_NAME_LC}\nValid platforms: ${_platformnames}") 36 message(FATAL_ERROR "invalid CORE_PLATFORM_NAME: ${CORE_PLATFORM_NAME_LC}\nValid platforms: ${_platformnames}")
31endif() 37endif()
32