-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathCMakeLists.txt
68 lines (51 loc) · 1.71 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
cmake_minimum_required(VERSION 3.8)
project(Ogre_glTF)
#to build a library
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_INSTALL_PREFIX "./output")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG=1 -D_DEBUG=1")
if(NOT CMAKE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX "_d")
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMake)
include(Ogre_glTF_ConfigTargets)
option(Ogre_glTF_STATIC "Static build" FALSE)
if (Ogre_glTF_STATIC)
add_definitions(-DOgre_glTF_STATIC)
set(Ogre_glTF_LIB_TYPE STATIC)
set(Ogre_glTF_LIB_SUFFIX "Static")
else ()
set(Ogre_glTF_LIB_TYPE SHARED)
set(Ogre_glTF_LIB_SUFFIX "")
endif ()
#Get Ogre from your system. May need to set some variables for Windows folks
find_package(OGRE COMPONENTS HlmsPbs REQUIRED)
file(GLOB librarySources ./src/*.cpp ./src/private_headers/*.hpp ./include/*.hpp)
add_library(${PROJECT_NAME} ${Ogre_glTF_LIB_TYPE} ${librarySources})
target_compile_definitions(${PROJECT_NAME} PUBLIC Ogre_glTF_DLL_EXPORT_CONFIG_ON)
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_NAME}${Ogre_glTF_LIB_SUFFIX})
target_include_directories( Ogre_glTF PUBLIC
#Ogre and the physics based high level material system
${OGRE_INCLUDE_DIRS}
${OGRE_HlmsPbs_INCLUDE_DIRS}
${OGRE_INCLUDE_DIR}/Hlms/Common
#local include directory
./include
./src/private_headers
./thirdParty/tinygltf/
)
target_link_libraries(Ogre_glTF
${OGRE_LIBRARIES}
${OGRE_HlmsPbs_LIBRARIES}
)
add_subdirectory(Samples)
#installation
install(FILES
./include/Ogre_glTF.hpp
./include/Ogre_glTF_OgrePlugin.hpp
./include/Ogre_glTF_OgreResource.hpp
./include/Ogre_glTF_DLL.hpp
DESTINATION
"include")
install(TARGETS Ogre_glTF DESTINATION "bin")