aboutsummaryrefslogtreecommitdiff
blob: b3bae1cfebeea6d74ea10a4e5cd8ee523090d290 (plain)
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
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,21 +1,13 @@
 cmake_minimum_required(VERSION 3.1)
 
-project(cimgui)
+project(libcimgui)
 
-if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/imgui/imgui_tables.cpp)
-	set(TABLES_SOURCE "imgui/imgui_tables.cpp")
-else()
 	set(TABLES_SOURCE "")
-endif()
 
 
 #general settings
 file(GLOB IMGUI_SOURCES
     cimgui.cpp
-    imgui/imgui.cpp
-    imgui/imgui_draw.cpp
-    imgui/imgui_demo.cpp
-    imgui/imgui_widgets.cpp
 	${TABLES_SOURCE}
 )
 
@@ -24,34 +16,30 @@
 set(IMGUI_LIBRARIES )
 
 if(IMGUI_FREETYPE)
-	FIND_PACKAGE(freetype REQUIRED PATHS ${FREETYPE_PATH})
-	list(APPEND IMGUI_LIBRARIES freetype)
-	list(APPEND IMGUI_SOURCES imgui/misc/freetype/imgui_freetype.cpp)
+	list(APPEND IMGUI_LIBRARIES -lfreetype)
 	add_definitions("-DCIMGUI_FREETYPE=1")
 endif(IMGUI_FREETYPE)
 
 #add library and link
 if (IMGUI_STATIC)
-    add_library(cimgui STATIC ${IMGUI_SOURCES})
+    add_library(libcimgui STATIC ${IMGUI_SOURCES})
 else (IMGUI_STATIC)
-    add_library(cimgui SHARED ${IMGUI_SOURCES})
+    add_library(libcimgui SHARED ${IMGUI_SOURCES})
 endif (IMGUI_STATIC)
 
-target_compile_definitions(cimgui PUBLIC IMGUI_DISABLE_OBSOLETE_FUNCTIONS=1)
 if (WIN32)
-    target_compile_definitions(cimgui PUBLIC IMGUI_IMPL_API=extern\t\"C\"\t__declspec\(dllexport\))
+    target_compile_definitions(libcimgui PUBLIC IMGUI_IMPL_API=extern\t\"C\"\t__declspec\(dllexport\))
     list(APPEND IMGUI_LIBRARIES imm32)
 else (WIN32)
-    target_compile_definitions(cimgui PUBLIC IMGUI_IMPL_API=extern\t\"C\"\t)
+    target_compile_definitions(libcimgui PUBLIC IMGUI_IMPL_API=extern\t\"C\"\t)
 endif (WIN32)
 
-target_include_directories(cimgui PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
-target_include_directories(cimgui PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/imgui)
-set_target_properties(cimgui PROPERTIES PREFIX "")
-target_link_libraries(cimgui ${IMGUI_LIBRARIES})
+target_include_directories(libcimgui PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/imgui)
+set_target_properties(libcimgui PROPERTIES PREFIX "")
+target_link_libraries(libcimgui PUBLIC -limgui)
 
 #install
-install(TARGETS cimgui
+install(TARGETS libcimgui
     RUNTIME DESTINATION  .
     LIBRARY DESTINATION  .
     ARCHIVE DESTINATION  .