-
Notifications
You must be signed in to change notification settings - Fork 4
/
get_glfw.cmake
40 lines (35 loc) · 1.3 KB
/
get_glfw.cmake
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
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
set(GLFW_VERSION 3.3.9)
set(COMPONENT_NAME glfw)
set(COMPONENT_PATH ${INSTALL_DIR_ABSOLUTE})
if (INSTALL_IN_SEPARATE_DIRECTORIES)
set(COMPONENT_PATH ${INSTALL_DIR_ABSOLUTE}/${COMPONENT_NAME})
endif()
ExternalProject_Add(${COMPONENT_NAME}
PREFIX ${COMPONENT_NAME}
DOWNLOAD_DIR ${COMPONENT_NAME}
STAMP_DIR ${COMPONENT_NAME}/stamp
SOURCE_DIR ${COMPONENT_NAME}/src
BINARY_DIR ${COMPONENT_NAME}/build
GIT_REPOSITORY "https://github.com/glfw/glfw.git"
GIT_TAG "3.3.8"
GIT_SHALLOW ON
CMAKE_ARGS
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX:PATH=${COMPONENT_PATH}
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
-DCMAKE_INSTALL_DOCDIR=${CMAKE_INSTALL_DOCDIR}
-DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
-DCMAKE_BUILD_TYPE=${DEPENDENCIES_BUILD_TYPE}
-DGLFW_BUILD_DOCS=OFF
-DGLFW_BUILD_EXAMPLES=OFF
-DGLFW_BUILD_TESTS=OFF
BUILD_COMMAND ${DEFAULT_BUILD_COMMAND}
BUILD_ALWAYS ${ALWAYS_REBUILD}
PATCH_COMMAND git apply -v ${CMAKE_CURRENT_SOURCE_DIR}/glfw.patch
)
list(APPEND CMAKE_PREFIX_PATH ${COMPONENT_PATH})
string(REPLACE ";" "|" CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH}")