forked from Luka-M/bgfx.cmake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
75 lines (61 loc) · 2.47 KB
/
CMakeLists.txt
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# bgfx.cmake - bgfx building in cmake
# Written in 2017 by Joshua Brookover <joshua.al.brookover@gmail.com>
# To the extent possible under law, the author(s) have dedicated all copyright
# and related and neighboring rights to this software to the public domain
# worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along with
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
cmake_minimum_required( VERSION 3.0 )
project( bgfx )
set_property( GLOBAL PROPERTY USE_FOLDERS ON )
if( APPLE )
set( CMAKE_CXX_FLAGS "-ObjC++ --std=c++11" )
elseif(UNIX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
option( BGFX_BUILD_TOOLS "Build bgfx tools." ON )
option( BGFX_BUILD_EXAMPLES "Build bgfx examples." ON )
option( BGFX_INSTALL "Create installation target." ON )
option( BGFX_CUSTOM_TARGETS "Include convenience custom targets." ON )
option( BGFX_USE_OVR "Build with OVR support." OFF )
option( BGFX_AMALGAMATED "Amalgamated bgfx build for faster compilation" OFF )
option( BX_AMALGAMATED "Amalgamated bx build for faster compilation" OFF )
if( NOT BX_DIR )
set( BX_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bx" CACHE STRING "Location of bx." )
endif()
if( NOT BIMG_DIR )
set( BIMG_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bimg" CACHE STRING "Location of bimg." )
endif()
if( NOT BGFX_DIR )
set( BGFX_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bgfx" CACHE STRING "Location of bgfx." )
endif()
if( BGFX_USE_OVR )
include( cmake/ovr.cmake )
endif()
include( cmake/shared.cmake )
include( cmake/bx.cmake )
include( cmake/bimg.cmake )
include( cmake/bgfx.cmake )
if( BGFX_BUILD_TOOLS )
include( cmake/tools.cmake )
endif()
if( BGFX_BUILD_EXAMPLES )
include( cmake/examples.cmake )
endif()
if( BGFX_INSTALL )
# install bx
install( TARGETS bx DESTINATION lib )
install( DIRECTORY ${BX_DIR}/include DESTINATION . )
# install bimg
install( TARGETS bimg DESTINATION lib )
install( DIRECTORY ${BIMG_DIR}/include DESTINATION . )
# install bgfx
install( TARGETS bgfx DESTINATION lib )
install( DIRECTORY ${BGFX_DIR}/include DESTINATION . )
# install tools
if( BGFX_BUILD_TOOLS )
install( TARGETS shaderc DESTINATION bin )
install( TARGETS geometryc DESTINATION bin )
endif()
endif()