Add Nebula Browser app, UI and assets
Add initial Nebula Browser project skeleton: CMakeLists to configure and link CEF (including post-build steps to copy runtime and UI files), a Windows CEF-based entry (app/main.cpp) that initializes CEF and loads the bundled UI, and a full ui/ and assets/ tree (HTML, CSS, JS, fonts, icons, and branding images). Update .gitignore to ignore build/out, thirdparty/cef, IDE and common OS artifacts.
This commit is contained in:
+113
@@ -0,0 +1,113 @@
|
||||
cmake_minimum_required(VERSION 3.21)
|
||||
|
||||
project(NebulaBrowser LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# CEF location
|
||||
# ------------------------------------------------------------
|
||||
|
||||
set(CEF_ROOT "${CMAKE_SOURCE_DIR}/thirdparty/cef" CACHE PATH "Path to the CEF binary distribution")
|
||||
|
||||
if(NOT EXISTS "${CEF_ROOT}/cmake/FindCEF.cmake")
|
||||
message(FATAL_ERROR
|
||||
"CEF was not found.\n"
|
||||
"Expected CEF here:\n"
|
||||
" ${CEF_ROOT}\n\n"
|
||||
"Make sure the contents of the CEF binary distribution are inside thirdparty/cef."
|
||||
)
|
||||
endif()
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# CEF setup
|
||||
# ------------------------------------------------------------
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CEF_ROOT}/cmake")
|
||||
|
||||
find_package(CEF REQUIRED)
|
||||
|
||||
add_subdirectory(
|
||||
"${CEF_LIBCEF_DLL_WRAPPER_PATH}"
|
||||
"${CMAKE_BINARY_DIR}/libcef_dll_wrapper"
|
||||
)
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Nebula source files
|
||||
# ------------------------------------------------------------
|
||||
|
||||
set(NEBULA_SOURCES
|
||||
app/main.cpp
|
||||
)
|
||||
|
||||
add_executable(NebulaBrowser WIN32
|
||||
${NEBULA_SOURCES}
|
||||
)
|
||||
|
||||
SET_EXECUTABLE_TARGET_PROPERTIES(NebulaBrowser)
|
||||
|
||||
if(MSVC)
|
||||
set_property(TARGET NebulaBrowser PROPERTY
|
||||
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>"
|
||||
)
|
||||
endif()
|
||||
|
||||
target_include_directories(NebulaBrowser PRIVATE
|
||||
"${CEF_ROOT}"
|
||||
"${CEF_ROOT}/include"
|
||||
)
|
||||
|
||||
target_link_libraries(NebulaBrowser PRIVATE
|
||||
libcef_dll_wrapper
|
||||
${CEF_STANDARD_LIBS}
|
||||
)
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Platform-specific CEF linking
|
||||
# ------------------------------------------------------------
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(NebulaBrowser PRIVATE
|
||||
"${CEF_ROOT}/Release/libcef.lib"
|
||||
)
|
||||
|
||||
target_compile_definitions(NebulaBrowser PRIVATE
|
||||
NOMINMAX
|
||||
WIN32_LEAN_AND_MEAN
|
||||
)
|
||||
endif()
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Copy CEF runtime files after build
|
||||
# ------------------------------------------------------------
|
||||
|
||||
if(WIN32)
|
||||
add_custom_command(TARGET NebulaBrowser POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CEF_ROOT}/Release"
|
||||
"$<TARGET_FILE_DIR:NebulaBrowser>"
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CEF_ROOT}/Resources"
|
||||
"$<TARGET_FILE_DIR:NebulaBrowser>"
|
||||
|
||||
COMMENT "Copying CEF runtime files..."
|
||||
)
|
||||
endif()
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Copy Nebula UI files after build
|
||||
# ------------------------------------------------------------
|
||||
|
||||
add_custom_command(TARGET NebulaBrowser POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CMAKE_SOURCE_DIR}/ui"
|
||||
"$<TARGET_FILE_DIR:NebulaBrowser>/ui"
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CMAKE_SOURCE_DIR}/assets"
|
||||
"$<TARGET_FILE_DIR:NebulaBrowser>/ui/assets"
|
||||
|
||||
COMMENT "Copying Nebula UI files and assets..."
|
||||
)
|
||||
Reference in New Issue
Block a user