mirror of
https://github.com/QuasarApp/CMake.git
synced 2025-04-26 17:54:43 +00:00
added base crossplatform files and mingw win32 and win64
This commit is contained in:
parent
b19c29180d
commit
e40e7f697c
@ -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)
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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}")
|
||||
|
31
crossplatform/Linux/utils/win-base.cmake
Executable file
31
crossplatform/Linux/utils/win-base.cmake
Executable 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)
|
||||
|
21
crossplatform/Linux/win32-g++.cmake
Executable file
21
crossplatform/Linux/win32-g++.cmake
Executable 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)
|
||||
|
20
crossplatform/Linux/win64-g++.cmake
Executable file
20
crossplatform/Linux/win64-g++.cmake
Executable 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)
|
||||
|
27
crossplatform/crossplatform.cmake
Executable file
27
crossplatform/crossplatform.cmake
Executable 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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user