File: CMakeLists.txt

package info (click to toggle)
cegui-mk2 0.8.7%2Bgit20220615-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 57,816 kB
  • sloc: cpp: 306,263; python: 1,175; ansic: 812; sh: 616; xml: 191; java: 162; makefile: 21
file content (25 lines) | stat: -rw-r--r-- 1,230 bytes parent folder | download | duplicates (4)
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
option(CEGUI_SAMPLES_ENABLE_WIDGET_DEMO "Specifies whether this sample should be built or not" TRUE)
if(CEGUI_SAMPLES_ENABLE_WIDGET_DEMO)
    file(GLOB WIDGET_HEADERS "${CMAKE_SOURCE_DIR}/cegui/include/CEGUI/widgets/*.h")
    list(APPEND WIDGET_HEADERS "${CMAKE_SOURCE_DIR}/cegui/include/CEGUI/Window.h")
 
    set(ALL_EVENTS_CODE "std::set<String> allEvents;")
 
    foreach (WIDGET_HEADER ${WIDGET_HEADERS})
        file(READ "${WIDGET_HEADER}" HEADER_SOURCE)
        string(REGEX MATCHALL "static const String Event[^;]+" MATCHED_LINES "${HEADER_SOURCE}")
        foreach (MATCHED_LINE ${MATCHED_LINES})
            string(REGEX REPLACE "static const String Event([^;]+)" "\\1" CAPTURE_GROUP "${MATCHED_LINE}")
            if (NOT CAPTURE_GROUP STREQUAL "Namespace")
                set(ALL_EVENTS_CODE "${ALL_EVENTS_CODE}\nallEvents.insert(\"${CAPTURE_GROUP}\");")
            endif()                                                                                      
        endforeach()
    endforeach()
 
    file(WRITE ${CMAKE_BINARY_DIR}/samples/common/include/AllEvents.inc "${ALL_EVENTS_CODE}")

    include_directories(${CMAKE_BINARY_DIR}/samples/common/include)
	
    
    cegui_add_sample(CEGUIWidgetDemo)
endif()