-
Notifications
You must be signed in to change notification settings - Fork 240
/
Copy pathconfig.cmake
84 lines (69 loc) · 1.94 KB
/
config.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
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
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lc++ -lc++abi")
endif()
if (CMAKE_COMPILER_IS_GNUCC)
message(STATUS "Using gcc ${CMAKE_CXX_COMPILER_VERSION}")
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.1)
message(STATUS "USE CXX11_ABI")
add_definitions("-D_GLIBCXX_USE_CXX11_ABI=1")
endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-strict-aliasing")
endif()
endif()
check_unsupported_compiler_version()
add_definitions(-DTANGRAM_LINUX)
set(OpenGL_GL_PREFERENCE GLVND)
find_package(OpenGL REQUIRED)
include(cmake/glfw.cmake)
# System font config
include(FindPkgConfig)
pkg_check_modules(FONTCONFIG REQUIRED "fontconfig")
find_package(CURL REQUIRED)
add_executable(tangram
platforms/linux/src/linuxPlatform.cpp
platforms/linux/src/main.cpp
platforms/common/platform_gl.cpp
platforms/common/imgui_impl_glfw.cpp
platforms/common/imgui_impl_opengl3.cpp
platforms/common/urlClient.cpp
platforms/common/linuxSystemFontHelper.cpp
platforms/common/glfwApp.cpp
)
add_subdirectory(platforms/common/imgui)
target_include_directories(tangram
PRIVATE
platforms/common
${FONTCONFIG_INCLUDE_DIRS}
)
target_link_libraries(tangram
PRIVATE
tangram-core
glfw
imgui
${GLFW_LIBRARIES}
${OPENGL_LIBRARIES}
${FONTCONFIG_LDFLAGS}
${CURL_LIBRARIES}
-pthread
# only used when not using external lib
-ldl
)
target_compile_options(tangram
PRIVATE
-std=c++1y
-fno-omit-frame-pointer
-Wall
-Wreturn-type
-Wsign-compare
-Wignored-qualifiers
-Wtype-limits
-Wmissing-field-initializers
)
get_nextzen_api_key(NEXTZEN_API_KEY)
target_compile_definitions(tangram
PRIVATE
NEXTZEN_API_KEY="${NEXTZEN_API_KEY}")
add_resources(tangram "${PROJECT_SOURCE_DIR}/scenes" "res")