diff options
Diffstat (limited to 'cmake/scripts/common/Platform.cmake')
| -rw-r--r-- | cmake/scripts/common/Platform.cmake | 9 |
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) |
| 3 | endif() | 3 | endif() |
| 4 | 4 | ||
| 5 | if(CORE_SYSTEM_NAME STREQUAL linux) | 5 | if(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) | ||
| 9 | else() | 10 | else() |
| 10 | string(TOLOWER ${CORE_SYSTEM_NAME} _DEFAULT_PLATFORM) | 11 | string(TOLOWER ${CORE_SYSTEM_NAME} _DEFAULT_PLATFORM) |
| 11 | endif() | 12 | endif() |
| 12 | 13 | ||
| 14 | set(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) | |||
| 23 | list(APPEND final_message "Platform: ${CORE_PLATFORM_NAME}") | 26 | list(APPEND final_message "Platform: ${CORE_PLATFORM_NAME}") |
| 24 | if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake) | 27 | if(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() | ||
| 26 | else() | 32 | else() |
| 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}") |
| 31 | endif() | 37 | endif() |
| 32 | |||
