-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule.cmake
59 lines (46 loc) · 3.06 KB
/
module.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# ┌─┐┬ ┬┬─┐┌─┐┬─┐┌─┐ ┌─┐┬─┐┌─┐┌┬┐┌─┐┬ ┬┌─┐┬─┐┬┌─
# ├─┤│ │├┬┘│ │├┬┘├─┤ ├┤ ├┬┘├─┤│││├┤ ││││ │├┬┘├┴┐
# ┴ ┴└─┘┴└─└─┘┴└─┴ ┴ └ ┴└─┴ ┴┴ ┴└─┘└┴┘└─┘┴└─┴ ┴
# A Powerful General Purpose Framework
# More information in: https://aurora-fw.github.io/
#
# Copyright (C) 2017 Aurora Framework, All rights reserved.
#
# This file is part of the Aurora Framework. This framework is free
# software; you can redistribute it and/or modify it under the terms of
# the GNU Lesser General Public License version 3 as published by the
# Free Software Foundation and appearing in the file LICENSE included in
# the packaging of this file. Please review the following information to
# ensure the GNU Lesser General Public License version 3 requirements
# will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
message(STATUS "Loading gengine-opengl module...")
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
if (NOT CONFIGURED_ONCE)
set(AURORAFW_MODULE_GENGINE_OPENGL_SOURCE_DIR ${AURORAFW_MODULE_GENGINE_OPENGL_DIR}/src)
endif()
include_directories(${AURORAFW_MODULE_GENGINE_OPENGL_DIR}/include)
include_directories(${OPENGL_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS})
file(GLOB_RECURSE AURORAFW_MODULE_GENGINE_OPENGL_HEADERS ${AURORAFW_MODULE_GENGINE_OPENGL_DIR}/include/*.*)
file(GLOB_RECURSE AURORAFW_MODULE_GENGINE_OPENGL_SOURCE ${AURORAFW_MODULE_GENGINE_OPENGL_SOURCE_DIR}/*.*)
add_library (aurorafw-gengine-opengl STATIC ${AURORAFW_MODULE_GENGINE_OPENGL_SOURCE})
aurorafw_add_library_target(aurorafw-gengine-opengl STATIC)
if(AURORAFW_PCH)
add_precompiled_header(aurorafw-gengine-opengl "${AURORAFW_MODULE_GENGINE_OPENGL_HEADERS}")
endif()
if(OPENGL_FOUND)
set_target_properties(aurorafw-gengine-opengl PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -DAFW__OPENGL_FOUND")
endif()
if(OPENGL_XMESA_FOUND)
set_target_properties(aurorafw-gengine-opengl PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -DAFW__OPENGL_XMESA_FOUND")
endif()
if(OPENGL_GLU_FOUND)
set_target_properties(aurorafw-gengine-opengl PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -DAFW__OPENGL_GLU_FOUND")
endif()
target_link_libraries(aurorafw-gengine-opengl aurorafw-cli ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES} aurorafw-image)
set_target_properties(aurorafw-gengine-opengl PROPERTIES OUTPUT_NAME "aurorafw-gengine-opengl_${AURORAFW_PLATFORM_PREFIX}_${AURORAFW_CPUARCH_PREFIX}")
install(TARGETS aurorafw-gengine-opengl DESTINATION lib)
file(GLOB AURORAFW_MODULE_GENGINE_OPENGL_HEADERS_AURORAFW_GENGINE ${AURORAFW_MODULE_GENGINE_OPENGL_DIR}/include/GEngine/*.*)
file(GLOB AURORAFW_MODULE_GENGINE_OPENGL_HEADERS_AURORAFW_GENGINE_GL ${AURORAFW_MODULE_GENGINE_OPENGL_DIR}/include/AuroraFW/GEngine/GL/*.*)
install(FILES ${AURORAFW_MODULE_GENGINE_OPENGL_HEADERS_AURORAFW_GENGINE} DESTINATION include/AuroraFW/GEngine)
install(FILES ${AURORAFW_MODULE_GENGINE_OPENGL_HEADERS_AURORAFW_GENGINE_GL} DESTINATION include/AuroraFW/GEngine/GL)