forked from wadesworld2112/libxplanemp
-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
85 lines (79 loc) · 2.31 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
76
77
78
79
80
81
82
83
84
85
cmake_minimum_required(VERSION 3.0)
project(xpsdk LANGUAGES C CXX VERSION 2.0)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules" ${CMAKE_MODULE_PATH})
find_package(XPSDK REQUIRED)
if(CMAKE_BUILD_TYPE MATCHES "Debug")
set(XPMP_DEFINES ${XPMP_DEFINES} DEBUG=1)
set(XPMP_DEBUG ON)
else()
set(XPMP_DEBUG OFF)
endif()
option(XPMP_DEBUG_OPENGL "Install OpenGL Debug hooks and debug info" OFF)
if(XPMP_DEBUG_OPENGL)
set(XPMP_DEFINES ${XPMP_DEFINES} DEBUG_GL=1)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
set(XPMP_DEFINES ${XPMP_DEFINES} LIN=1)
#set(XPMP_PLATFORM_SOURCES
# src/PlatformUtils.lin.cpp)
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
set(XPMP_DEFINES ${XPMP_DEFINES} IBM=1)
#set(XPMP_PLATFORM_SOURCES
# src/PlatformUtils.win.cpp)
set(XPMP_PLATFORM_LIBRARIES opengl32 glu32)
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(XPMP_DEFINES ${XPMP_DEFINES} APL=1)
#set(XPMP_PLATFORM_SOURCES
# src/PlatformUtils.mac.cpp)
find_library(OPENGL OpenGL)
set(XPMP_PLATFORM_LIBRARIES ${OPENGL})
endif()
#if(PNG_FOUND)
add_definitions(-DBITMAP_USE_PNG=1)
#endif()
add_definitions(-DXPLM200=1 -DXPLM210=1)
add_library(xplanemp
${XPMP_PLATFORM_SOURCES}
src/BitmapUtils.cpp
src/BitmapUtils.h
src/TexUtils.cpp
src/TexUtils.h
src/XObjDefs.cpp
src/XObjDefs.h
src/XObjReadWrite.cpp
src/XObjReadWrite.h
src/XOGLUtils.cpp
src/XOGLUtils.h
src/XPCAircraft.cpp
include/XPCAircraft.h
src/XPMPMultiplayer.cpp
include/XPMPMultiplayer.h
src/XPMPMultiplayerCSL.cpp
src/XPMPMultiplayerCSL.h
src/XPMPMultiplayerCSLOffset.cpp
src/XPMPMultiplayerCSLOffset.h
src/XPMPMultiplayerObj8.cpp
src/XPMPMultiplayerObj8.h
src/XPMPMultiplayerObj.cpp
src/XPMPMultiplayerObj.h
src/XPMPMultiplayerVars.cpp
src/XPMPMultiplayerVars.h
src/XPMPPlaneRenderer.cpp
include/XPMPPlaneRenderer.h
src/XUtils.cpp
src/XUtils.h
src/XStringUtils.h
src/ResourceManager.h
src/Interpolation.h)
target_include_directories(xplanemp
PUBLIC
${XPSDK_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src)
target_link_libraries(xplanemp
PRIVATE ${XPSDK_XPLM_LIBRARIES}
${PNG_LIBRARY}
${XPMP_PLATFORM_LIBRARIES})
target_compile_definitions(xplanemp PRIVATE ${XPMP_DEFINES} PUBLIC XUTILS_EXCLUDE_MAC_CRAP=1)
set_property(TARGET xplanemp PROPERTY CXX_STANDARD_REQUIRED 11)
set_property(TARGET xplanemp PROPERTY CXX_STANDARD 14)