build(cmake): modernize build system and dependency management#262
Open
tategotoazarasi wants to merge 7 commits intoParadoxGameConverters:fetchcontentfrom
Open
build(cmake): modernize build system and dependency management#262tategotoazarasi wants to merge 7 commits intoParadoxGameConverters:fetchcontentfrom
tategotoazarasi wants to merge 7 commits intoParadoxGameConverters:fetchcontentfrom
Conversation
Upgrade CMake minimum requirement to 3.25 and refactor dependency resolution logic. - Implement `find_package` with `FetchContent` fallback for `SQLiteCpp`, `CURL`, `wxWidgets`, and `commonItems`. - Add `PkgConfig` support for locating `libcurl` on Linux and manually define the `CURL::libcurl` target if missing. - Standardize C++23 settings via CMake properties instead of flags. - Use target-based linking semantics for all dependencies. - Refactor platform-specific source selection and post-build copy commands.
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…verters#260) Bumps [external/commonItems](https://github.com/ParadoxGameConverters/commonItems) from `df4ab8e` to `b67c85f`. - [Commits](ParadoxGameConverters/commonItems@df4ab8e...b67c85f) --- updated-dependencies: - dependency-name: external/commonItems dependency-version: b67c85f0d26396cb98981a732365a27df0e2bc98 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
The Windows build was failing with multiple linker errors due to entry point mismatches and ABI incompatibilities with pre-built VCPKG libraries. Changes: - Add `WIN32` to `add_executable`. This ensures the linker uses the Windows subsystem, correctly locating the `WinMain` entry point provided by wxWidgets instead of looking for `main`. - Force `SQLiteCpp` to build from source via `FetchContent` instead of using the VCPKG package. This resolves `LNK2019` errors for `SQLite::Database` caused by C++ standard mismatches (specifically regarding C++23 and `std::filesystem` support). - Update `wxWidgets` discovery to correctly prioritize imported targets (Config mode) over legacy variables, ensuring better VCPKG compatibility. - Update `CMakePresets.json` to inject the VCPKG toolchain file from the environment variables and simplify the build directory structure.
The build configuration previously relied on `CMAKE_SOURCE_DIR`, which caused path resolution errors when the project was included as a dependency (e.g., via FetchContent) in another project. Additionally, link errors occurred due to mismatched SQLiteCpp configurations and missing Windows subsystem flags. Changes: - Use `CMAKE_CURRENT_SOURCE_DIR` and `PROJECT_SOURCE_DIR` for source globbing and resource copying. This ensures paths resolve correctly regardless of the project hierarchy. - Force `SQLiteCpp` to be fetched from source. This prevents linking against VCPKG's DLL version, which caused ABI mismatches regarding C++23 and `std::filesystem` support. - Add `WIN32` to `add_executable`. This forces the linker to use the `/SUBSYSTEM:WINDOWS` flag, resolving entry point errors (missing `WinMain`) when linking with wxWidgets.
The Linux build previously relied on `Copy_Files.sh`, which contained hardcoded relative paths that caused build failures when the project was included as a submodule (e.g., via FetchContent). This change removes the platform-specific shell script execution and standardizes the post-build step to use `cmake -E copy` commands for all operating systems. This ensures resources are correctly deployed to the runtime output directory regardless of the build structure. Signed-off-by: Zhiheng Wang <Z.Wang252@liverpool.ac.uk>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR refactors the entire build system to move away from bundled git submodules in favor of a hybrid approach using
find_package,FetchContent, andvcpkg. It also unifies cross-platform build logic and resolves linking errors on Windows.Build System & Dependencies
external/libraries (wxWidgets, commonItems, SQLiteCpp) in favor of system packages orFetchContent.vcpkg.jsonandvcpkg-configuration.jsonfor manifest-mode dependency management.SQLiteCppto be fetched from source to prevent ABI mismatches (DLL/Static runtime) and C++ standard conflicts on Windows.wx::core,wx::net) over legacy variables.PkgConfigfallback for Linux systems.Windows & Platform Fixes
WIN32flag toadd_executable. This ensures the linker correctly locates theWinMainentry point provided by wxWidgets, fixingLNK2019errors.CMAKE_SOURCE_DIRwithCMAKE_CURRENT_SOURCE_DIRto ensure correct path resolution when the project is consumed as a submodule.Copy_Files.shand replaced it with unifiedcmake -E copypost-build commands, resolving build failures on Linux when paths differed from expectations.CI/CD
actions/checkoutto v6.BREAKING CHANGE: The
external/directory has been removed. The build process now requires an internet connection during the initial configuration to download dependencies viaFetchContentor VCPKG. Legacy build scripts (Copy_Files.sh) have been removed; resources are now copied automatically by CMake post-build events.