-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
116 lines (107 loc) · 3.16 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
set(LIB_NAME cc_imgui)
set(INCLUDES
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/imgui
${CMAKE_CURRENT_SOURCE_DIR}/imgui/misc/cpp
${COCOS2DX_ROOT_PATH}/cocos
${COCOS2DX_ROOT_PATH}/cocos/base
${COCOS2DX_ROOT_PATH}/cocos/platform
${COCOS2DX_ROOT_PATH}/extensions
${COCOS2DX_ROOT_PATH}/external
${COCOS2DX_ROOT_PATH}/external/glfw3/include/win32
${COCOS2DX_ROOT_PATH}/external/glfw/include/GLFW
${COCOS2DX_ROOT_PATH}/external/win32-specific/gles/include/OGLES
)
if(BUILD_LUA_LIBS)
list(APPEND INCLUDES
${COCOS2DX_ROOT_PATH}/external/lua/luajit/include
${COCOS2DX_ROOT_PATH}/external/lua/tolua)
endif()
foreach(dir ${INCLUDES})
if(EXISTS ${dir})
include_directories(${dir})
endif()
endforeach()
set(HEADER
CCIMGUI.h
CCImGuiLayer.h
CCImGuiColorTextEdit.h
imgui_impl_cocos2dx.h
imgui/imconfig.h
imgui/imgui.h
imgui/imgui_internal.h
imgui/imstb_rectpack.h
imgui/imstb_textedit.h
imgui/imstb_truetype.h
imgui/misc/cpp/imgui_stdlib.h
imgui_markdown/imgui_markdown.h
ImGuiColorTextEdit/TextEditor.h
implot/implot.h
implot/implot_internal.h
)
set(SOURCE
CCIMGUI.cpp
CCImGuiLayer.cpp
CCImGuiColorTextEdit.cpp
imgui_impl_cocos2dx.cpp
imgui/imgui.cpp
imgui/imgui_demo.cpp
imgui/imgui_draw.cpp
imgui/imgui_tables.cpp
imgui/imgui_widgets.cpp
imgui/misc/cpp/imgui_stdlib.cpp
ImGuiColorTextEdit/TextEditor.cpp
implot/implot.cpp
implot/implot_demo.cpp
implot/implot_items.cpp
)
if(BUILD_LUA_LIBS)
include_directories(
lua-bindings
)
list(APPEND HEADER
lua-bindings/imgui_lua.hpp
lua-bindings/lua_conversion.hpp
lua-bindings/lua_imgui_auto.hpp
lua-bindings/lua_imguiDrawList_auto.hpp
lua-bindings/lua_imguiFont_auto.hpp
lua-bindings/lua_imguiIO_auto.hpp
lua-bindings/lua_imguiStyle_auto.hpp
lua-bindings/lua_imguiViewport_auto.hpp
lua-bindings/lua_ImGuiColorTextEdit_auto.hpp
lua-bindings/lua_implot_auto.hpp
)
list(APPEND SOURCE
lua-bindings/imgui_lua.cpp
lua-bindings/lua_imguiDrawList_auto.cpp
lua-bindings/lua_imguiFont_auto.cpp
lua-bindings/lua_imguiIO_auto.cpp
lua-bindings/lua_imguiStyle_auto.cpp
lua-bindings/lua_imguiViewport_auto.cpp
lua-bindings/lua_imgui_auto.cpp
lua-bindings/lua_ImGuiColorTextEdit_auto.cpp
lua-bindings/lua_implot_auto.cpp
)
endif()
add_library(${LIB_NAME} STATIC ${SOURCE} ${HEADER})
add_dependencies(${LIB_NAME} cocos2d)
use_cocos2dx_compile_define(${LIB_NAME})
use_cocos2dx_compile_options(${LIB_NAME})
if(BUILD_LUA_LIBS)
target_compile_definitions(${LIB_NAME} PUBLIC _USRLUASTATIC)
endif()
if(CC_USE_GFX)
target_compile_definitions(${LIB_NAME} PUBLIC CC_USE_GFX)
endif()
set_target_properties(${LIB_NAME}
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)
target_include_directories(${LIB_NAME} INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/imgui
)
if(XCODE OR VS)
cocos_mark_code_files(${LIB_NAME})
endif()