wxwidgets source build

This commit is contained in:
2025-06-28 20:25:24 +02:00
parent ef4de7fa43
commit 27cd6a339d
4 changed files with 30 additions and 11 deletions

View File

@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.10)
project(launcher)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
@@ -28,6 +30,8 @@ if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
add_link_options(-O3)
endif ()
include(wxWidgets)
add_subdirectory(utils)
add_subdirectory(backend)
add_subdirectory(gui)

View File

@@ -1,8 +1,3 @@
find_package(wxWidgets REQUIRED COMPONENTS base)
if (wxWidgets_USE_FILE) # not defined in CONFIG mode
include(${wxWidgets_USE_FILE})
endif ()
add_library(backend
src/DhfsInstance.cpp
include_public/DhfsInstance.hpp

View File

@@ -0,0 +1,26 @@
# if linux
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
option(wxWidgets_IN_TREE_BUILD "Build wxWidgets in-tree" OFF)
else ()
option(wxWidgets_IN_TREE_BUILD "Build wxWidgets in-tree" ON)
endif ()
if (wxWidgets_IN_TREE_BUILD)
message(STATUS "Building wxWidgets in-tree")
include(FetchContent)
set(wxBUILD_SHARED OFF)
FetchContent_Declare(wx
GIT_REPOSITORY https://github.com/wxWidgets/wxWidgets.git
GIT_TAG v3.2.8.1
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable(wx)
set(wxWidgets_LIBRARIES wx::core wx::base wx::webview wx::net)
else ()
message(STATUS "Using system wxWidgets")
find_package(wxWidgets REQUIRED COMPONENTS net core base webview)
if (wxWidgets_USE_FILE) # not defined in CONFIG mode
include(${wxWidgets_USE_FILE})
endif ()
endif ()

View File

@@ -1,9 +1,3 @@
find_package(wxWidgets REQUIRED COMPONENTS net core base webview)
if (wxWidgets_USE_FILE) # not defined in CONFIG mode
include(${wxWidgets_USE_FILE})
endif ()
add_executable(launcher
src/LauncherApp.cpp
src/GLauncherApp.cpp