-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
cmake_minimum_required(VERSION 3.15.0 FATAL_ERROR) | ||
|
||
project(glgame4 CXX) | ||
|
||
################################################################################ | ||
# Set target arch type if empty. Visual studio solution generator provides it. | ||
################################################################################ | ||
if(NOT CMAKE_VS_PLATFORM_NAME) | ||
set(CMAKE_VS_PLATFORM_NAME "x64") | ||
endif() | ||
message("${CMAKE_VS_PLATFORM_NAME} architecture in use") | ||
|
||
################################################################################ | ||
# Global configuration types | ||
################################################################################ | ||
set(CMAKE_CONFIGURATION_TYPES | ||
"Debug" | ||
"Release" | ||
CACHE STRING "" FORCE | ||
) | ||
|
||
################################################################################ | ||
# Global compiler options | ||
################################################################################ | ||
if(MSVC) | ||
# remove default flags provided with CMake for MSVC | ||
set(CMAKE_CXX_FLAGS "") | ||
set(CMAKE_CXX_FLAGS_DEBUG "") | ||
set(CMAKE_CXX_FLAGS_RELEASE "") | ||
endif() | ||
|
||
################################################################################ | ||
# Global linker options | ||
################################################################################ | ||
if(MSVC) | ||
# remove default flags provided with CMake for MSVC | ||
set(CMAKE_EXE_LINKER_FLAGS "") | ||
set(CMAKE_MODULE_LINKER_FLAGS "") | ||
set(CMAKE_SHARED_LINKER_FLAGS "") | ||
set(CMAKE_STATIC_LINKER_FLAGS "") | ||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS}") | ||
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS}") | ||
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS}") | ||
set(CMAKE_STATIC_LINKER_FLAGS_DEBUG "${CMAKE_STATIC_LINKER_FLAGS}") | ||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS}") | ||
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS}") | ||
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS}") | ||
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS}") | ||
endif() | ||
|
||
################################################################################ | ||
# Nuget packages function stub. | ||
################################################################################ | ||
function(use_package TARGET PACKAGE VERSION) | ||
message(WARNING "No implementation of use_package. Create yours. " | ||
"Package \"${PACKAGE}\" with version \"${VERSION}\" " | ||
"for target \"${TARGET}\" is ignored!") | ||
endfunction() | ||
|
||
################################################################################ | ||
# Common utils | ||
################################################################################ | ||
include(CMake/Utils.cmake) | ||
|
||
################################################################################ | ||
# Additional Global Settings(add specific info there) | ||
################################################################################ | ||
include(CMake/GlobalSettingsInclude.cmake OPTIONAL) | ||
|
||
################################################################################ | ||
# Use solution folders feature | ||
################################################################################ | ||
set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
|
||
################################################################################ | ||
# Sub-projects | ||
################################################################################ | ||
add_subdirectory(oglApplication) |