-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuild.cmake
More file actions
42 lines (35 loc) · 1.08 KB
/
Build.cmake
File metadata and controls
42 lines (35 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
cmake_minimum_required( VERSION 3.12 FATAL_ERROR )
find_package( Git REQUIRED QUIET )
execute_process(
COMMAND ${GIT_EXECUTABLE} config -f .gitmodules --get submodule.Engine.path
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
OUTPUT_VARIABLE ENGINE_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if( NOT ENGINE_DIR )
message( FATAL_ERROR "Cannot find git submodule 'Engine' path" )
endif()
list( APPEND CMAKE_MODULE_PATH "${ENGINE_DIR}/CMake" )
include( AutomatedBuild )
set( BUILD_DIR "Build" )
if( UNIX )
set( BUILD_FILE "Makefile" )
set( BUILD_GENERATOR "Unix Makefiles" )
set( BUILD_TOOL "Linux32" )
elseif( WIN32 )
set( BUILD_FILE "FOC.sln" )
if( DEFINED ENV{APPVEYOR_BUILD_WORKER_IMAGE} )
set( BUILD_GENERATOR "Visual Studio 10 2010" )
else()
set( BUILD_GENERATOR "Visual Studio 15 2017" )
set( BUILD_TOOL "v100" )
endif()
endif()
CreateBuildDirectory( "${BUILD_DIR}" "${BUILD_GENERATOR}" "${BUILD_TOOL}" "${BUILD_FILE}" )
if( BUILD_FAIL )
message( FATAL_ERROR "Build error" )
endif()
RunAllBuilds()
if( BUILD_FAIL )
message( FATAL_ERROR "Build error" )
endif()