added base crossplatform files and mingw win32 and win64

This commit is contained in:
Andrei Yankovich 2019-10-05 15:28:00 +03:00
parent b19c29180d
commit e40e7f697c
7 changed files with 116 additions and 0 deletions

View File

@ -5,6 +5,12 @@
# of this license document, but changing it is not allowed.
#
if(DEFINED PROJECT_OUT_SUPPORT)
return()
else()
set(PROJECT_OUT_SUPPORT 1)
endif()
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release)
ENDIF(NOT CMAKE_BUILD_TYPE)

View File

@ -5,6 +5,11 @@
# of this license document, but changing it is not allowed.
#
if(DEFINED PROJECT_VERSIONS_SUPPORT)
return()
else()
set(PROJECT_VERSIONS_SUPPORT 1)
endif()
function(setVersion maj min rev)

View File

@ -5,6 +5,12 @@
# of this license document, but changing it is not allowed.
#
if(DEFINED CCACHE_SUPPORT)
return()
else()
set(CCACHE_SUPPORT 1)
endif()
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
message("using ccache in ${CCACHE_PROGRAM}")

View File

@ -0,0 +1,31 @@
#
# Copyright (C) 2018-2019 QuasarApp.
# Distributed under the MIT software license, see the accompanying
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
if(DEFINED CROSSPLATFORM_BUILD_TOOLCHAIN_WIN_BASE)
return()
else()
set(CROSSPLATFORM_BUILD_TOOLCHAIN_WIN_BASE 1)
endif()
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)
# which compilers to use for C and C++
SET(CMAKE_C_COMPILER ${PLATFORM_COMPILLER_NAME}-${BASE_COMPILLER_NAME}-gcc)
SET(CMAKE_CXX_COMPILER ${PLATFORM_COMPILLER_NAME}-${BASE_COMPILLER_NAME}-g++)
SET(CMAKE_RC_COMPILER ${PLATFORM_COMPILLER_NAME}-${BASE_COMPILLER_NAME}-windres)
# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/${PLATFORM_COMPILLER_NAME}-${BASE_COMPILLER_NAME})
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

View File

@ -0,0 +1,21 @@
#
# Copyright (C) 2018-2019 QuasarApp.
# Distributed under the MIT software license, see the accompanying
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
if(DEFINED CROSSPLATFORM_BUILD_TOOLCHAIN_WIN_32)
return()
else()
set(CROSSPLATFORM_BUILD_TOOLCHAIN_WIN_32 1)
endif()
# the name of the target operating system
SET(BASE_COMPILLER_NAME w64-mingw32)
SET(PLATFORM_COMPILLER_NAME i686)
include(${CMAKE_CURRENT_LIST_DIR}/utils/win-base.cmake)

View File

@ -0,0 +1,20 @@
#
# Copyright (C) 2018-2019 QuasarApp.
# Distributed under the MIT software license, see the accompanying
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
if(DEFINED CROSSPLATFORM_BUILD_TOOLCHAIN_WIN_64)
return()
else()
set(CROSSPLATFORM_BUILD_TOOLCHAIN_WIN_64 1)
endif()
# the name of the target operating system
SET(BASE_COMPILLER_NAME w64-mingw32)
SET(PLATFORM_COMPILLER_NAME x86_64)
include(${CMAKE_CURRENT_LIST_DIR}/utils/win-base.cmake)

View File

@ -0,0 +1,27 @@
#
# Copyright (C) 2018-2019 QuasarApp.
# Distributed under the MIT software license, see the accompanying
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
if(DEFINED CROSSPLATFORM_BUILD_TOOLCHAIN)
return()
else()
set(CROSSPLATFORM_BUILD_TOOLCHAIN 1)
endif()
# use TRGET_PLATFORM_LOOLCHAIN
set(CROSSPLATFORM_BUILD_TOOLCHAIN_PATH ${CMAKE_CURRENT_LIST_DIR}/${CMAKE_HOST_SYSTEM_NAME}/${TRGET_PLATFORM_TOOLCHAIN})
if(EXISTS ${CROSSPLATFORM_BUILD_TOOLCHAIN_PATH})
message("${TRGET_PLATFORM_TOOLCHAIN} exits in ${CROSSPLATFORM_BUILD_TOOLCHAIN_PATH}")
include(${CROSSPLATFORM_BUILD_TOOLCHAIN_PATH})
else(EXISTS ${CROSSPLATFORM_BUILD_TOOLCHAIN_PATH})
message("${TRGET_PLATFORM_TOOLCHAIN} not exits in ${CROSSPLATFORM_BUILD_TOOLCHAIN_PATH}")
endif()