This repository was archived by the owner on Sep 20, 2025. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
106 lines (87 loc) · 2.84 KB
/
Copy pathCMakeLists.txt
File metadata and controls
106 lines (87 loc) · 2.84 KB
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
cmake_minimum_required(VERSION 3.19)
project(MikoView)
# Include our custom CMake modules
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Include configuration first
include(MikoConfig)
# Include platform detection
include(MikoPlatform)
# Include macros and functions
include(MikoMacros)
# Include and setup dependencies
include(MikoDependencies)
setup_all_dependencies()
# Configure output directories
configure_output_directories()
# Convert icon if needed (Windows)
convert_icon_if_needed()
# Setup MikoView framework (this now generates config files)
setup_mikoview_framework()
# Example executable (if enabled)
if(MIKO_BUILD_EXAMPLES)
if(WIN32)
# Windows application (no console unless requested)
if(MIKO_WIN32_CONSOLE)
add_executable(${PROJECT_NAME}
example/main.cpp
)
else()
add_executable(${PROJECT_NAME} WIN32
example/main.cpp
)
endif()
else()
# Linux/Unix application
add_executable(${PROJECT_NAME}
example/main.cpp
)
endif()
# Add Windows resource file
if(WIN32 AND MIKO_WIN32_MANIFEST)
target_sources(${PROJECT_NAME} PRIVATE example/assets/app.rc)
endif()
# Set target properties
SET_EXECUTABLE_TARGET_PROPERTIES(${PROJECT_NAME})
# Set platform-specific compiler flags
set_platform_compiler_flags(${PROJECT_NAME})
# Link the example with the framework
target_link_libraries(${PROJECT_NAME}
mikoview_framework
SDL2::SDL2main
)
# Include directories for example
target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/example
${CMAKE_CURRENT_BINARY_DIR}/generated
${CEF_ROOT}
)
# Setup CEF files and app assets
setup_cef_files(${PROJECT_NAME})
setup_app_assets(${PROJECT_NAME})
endif()
# Print configuration information
print_configuration_summary()
print_project_config()
PRINT_CEF_CONFIG()
# Install targets
if(MIKO_BUILD_EXAMPLES)
install(TARGETS ${PROJECT_NAME} mikoview_framework
RUNTIME DESTINATION ${MIKO_INSTALL_BINDIR}
LIBRARY DESTINATION ${MIKO_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${MIKO_INSTALL_LIBDIR}
)
else()
install(TARGETS mikoview_framework
LIBRARY DESTINATION ${MIKO_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${MIKO_INSTALL_LIBDIR}
)
endif()
# Install headers for the framework
install(FILES mikoview.hpp DESTINATION ${MIKO_INSTALL_INCLUDEDIR})
install(DIRECTORY mikoview/ DESTINATION ${MIKO_INSTALL_INCLUDEDIR}/mikoview
FILES_MATCHING PATTERN "*.hpp")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/generated/mikoview/app_config.hpp
DESTINATION ${MIKO_INSTALL_INCLUDEDIR}/mikoview)
# Include CPack for packaging
include(CPack)