Skip to content

add CMake build option#135

Open
scivision wants to merge 14 commits into
wmcbrine:masterfrom
scivision:cmake
Open

add CMake build option#135
scivision wants to merge 14 commits into
wmcbrine:masterfrom
scivision:cmake

Conversation

@scivision
Copy link
Copy Markdown

@scivision scivision commented Jul 22, 2022

CMake builds for Windows, macOS and Linux. Uses X11, SDL, or wincon. Static or shared. UTF8, WIDE or not.

@scivision scivision force-pushed the cmake branch 2 times, most recently from e55cfac to db6566a Compare July 22, 2022 16:05
@scivision scivision force-pushed the cmake branch 11 times, most recently from d1bd74d to e5ff212 Compare September 3, 2023 23:38
@scivision scivision force-pushed the cmake branch 10 times, most recently from 30c638c to c43315c Compare March 22, 2024 00:19
Repository owner deleted a comment from Bill-Gray Mar 22, 2024
@scivision scivision force-pushed the cmake branch 6 times, most recently from 916ff08 to 266f5ae Compare March 22, 2024 14:48
scivision and others added 10 commits April 27, 2026 10:24
more correct logic

add defines from makefile

add option  PDC_WIDE

better install

compiler options

utf8

cmake: add sdl2
`PDC_WIDE` define is used in public interface (in curses.h), so it must be available in `PUBLIC` scope.
Copilot AI review requested due to automatic review settings April 27, 2026 14:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a CMake-based build/install system (including presets) for PDCurses and its demos, and wires up GitHub Actions CI to build/test/package across multiple platforms.

Changes:

  • Introduces top-level CMake build, install/export, and packaging support (plus toolchain/helpers for X11 and DOS/OpenWatcom).
  • Adds CMake build + a minimal CTest smoke test for demos/.
  • Documents CMake usage and adds a CI workflow to exercise the new build.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
CMakeLists.txt New top-level CMake build for PDCurses with platform backends and install/export wiring
CMakePresets.json Adds configure/build/test/workflow presets for Ninja/MSVC/DOS
cmake/compilers.cmake Compiler-specific flags (notably OpenWatcom)
cmake/config.cmake.in Package config template for find_package(PDCurses CONFIG)
cmake/dos.cmake OpenWatcom DOS toolchain file
cmake/dos.ps1 Helper to set up OpenWatcom env on Windows
cmake/dos.sh Helper to set up OpenWatcom env on Unix-like systems
cmake/install.cmake Export/install + CPack packaging boilerplate
cmake/x11.cmake X11 dependency and include path discovery
demos/CMakeLists.txt CMake build for demos + CTest registration
demos/CMakePresets.json Inherits top-level presets for building demos via workflow
demos/README.md Documents building demos with CMake + installed PDCurses
demos/test_init.c Adds a minimal initialization smoke test binary for CTest/CI
docs/README.md Documents CMake build/install steps and X11 prereqs
.github/workflows/ci.yml Adds CI workflow to build/install/test/package via CMake workflows

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CMakeLists.txt Outdated
Comment thread CMakeLists.txt
Comment thread CMakeLists.txt
Comment thread cmake/install.cmake Outdated
Comment thread cmake/compilers.cmake Outdated
Comment thread demos/test_init.c
int main(void){
WINDOW* w = initscr();
if(w == NULL){
fprintf(stderr, "Error initialising ncurses.\n");
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message says "ncurses" but this demo is intended to validate PDCurses; this will be confusing when diagnosing failures. Update the message to refer to PDCurses (or just "curses") consistently with the rest of the project.

Suggested change
fprintf(stderr, "Error initialising ncurses.\n");
fprintf(stderr, "Error initialising PDCurses.\n");

Copilot uses AI. Check for mistakes.
Comment thread CMakePresets.json Outdated
Comment thread cmake/dos.cmake Outdated
Comment thread docs/README.md Outdated
Comment thread .github/workflows/ci.yml Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants