Files
opu/CMakeLists.txt
T
yann64andClaude Opus 5.5 ce7316af29
CI / Linux arm64 (push) Waiting to run
CI / Linux x86_64 (push) Waiting to run
CI / ASan + UBSan (push) Waiting to run
Linux packaging: Debian package, AppImage script, release workflow
- CPack DEB configuration (cmake/Packaging.cmake): dependencies from
  dpkg-shlibdeps, udisks2 recommended, strip.
- AppStream metadata, installed with the desktop file and the icons;
  tools/release.sh adds each release to it.
- tools/appimage.sh: AppImage of the GTK interface and openpu-cli with
  linuxdeploy and its GTK plugin (x86_64 and aarch64).
- Release workflow: .deb, AppImage and openpu-cli tarball for x86_64 and
  arm64, attached to the release of a vX.Y.Z tag, or kept as artifacts
  on a manual run. tools/release.sh edits the release when the workflow
  created it first.
- The GTK interface finds its translations next to the executable
  (../share/locale), for relocatable installs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WDASLCiN764v685boRVYar
2026-11-29 06:17:50 +01:00

62 lines
1.8 KiB
CMake

cmake_minimum_required(VERSION 3.20)
project(openpu VERSION 0.2.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(OPENPU_BUILD_CLI "Build openpu-cli" ON)
option(OPENPU_BUILD_TESTS "Build unit tests" ON)
option(OPENPU_UI_GTK "Build the GTK4 user interface" OFF)
if(CMAKE_SYSTEM_NAME STREQUAL "Haiku")
set(OPENPU_UI_HAIKU_DEFAULT ON)
else()
set(OPENPU_UI_HAIKU_DEFAULT OFF)
endif()
option(OPENPU_UI_HAIKU "Build the Haiku user interface" ${OPENPU_UI_HAIKU_DEFAULT})
option(OPENPU_WERROR "Treat warnings as errors" OFF)
option(OPENPU_CLANG_TIDY "Run clang-tidy while compiling" OFF)
option(OPENPU_SANITIZE "Build with ASan + UBSan" OFF)
add_library(openpu_warnings INTERFACE)
target_compile_options(openpu_warnings INTERFACE -Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wno-sign-conversion)
if(OPENPU_WERROR)
target_compile_options(openpu_warnings INTERFACE -Werror)
endif()
if(OPENPU_SANITIZE)
add_compile_options(-fsanitize=address,undefined -fno-omit-frame-pointer)
add_link_options(-fsanitize=address,undefined)
endif()
if(OPENPU_CLANG_TIDY)
find_program(CLANG_TIDY_EXE NAMES clang-tidy REQUIRED)
set(CMAKE_CXX_CLANG_TIDY ${CLANG_TIDY_EXE})
endif()
add_subdirectory(src/core)
if(OPENPU_BUILD_CLI)
add_subdirectory(src/cli)
endif()
if(OPENPU_UI_GTK)
add_subdirectory(src/ui-gtk)
endif()
if(OPENPU_UI_HAIKU)
add_subdirectory(src/ui-haiku)
endif()
if(OPENPU_UI_GTK OR OPENPU_UI_HAIKU)
add_subdirectory(po)
endif()
if(OPENPU_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Haiku") # Haiku packages are built from a HaikuPorts recipe
include(cmake/Packaging.cmake)
endif()