Skip to content

cmake: fix CMake 4 and include install paths#4

Open
Old-Ding wants to merge 1 commit into
webosose:masterfrom
Old-Ding:codex/cmake4-install-paths
Open

cmake: fix CMake 4 and include install paths#4
Old-Ding wants to merge 1 commit into
webosose:masterfrom
Old-Ding:codex/cmake4-install-paths

Conversation

@Old-Ding

@Old-Ding Old-Ding commented Jul 5, 2026

Copy link
Copy Markdown

Fixes #2.

Summary

  • raise the project CMake minimum from 2.8.7 to 3.5 so CMake 4.x accepts this project's policy boundary
  • replace @WEBOS_INSTALL_INCLUDEDIR@ with ${WEBOS_INSTALL_INCLUDEDIR} in ordinary install() commands
  • leave the pkg-config .pc.in placeholders unchanged, because those are template files and should still use @...@

Verification

  • CMake 4.3.2 with Ninja and GCC 16.1.0
  • with the issue-recommended CMAKE_POLICY_VERSION_MINIMUM=3.5 override and the official webOS module:
    • BUILD_PRIVATE=ON configured and installed PmLogLibPrv.h to <WEBOS_INSTALL_ROOT>/usr/include
    • SHIP_HEADERS_ONLY=ON configured and installed PmLogLib.h and PmLogMsg.h to <WEBOS_INSTALL_ROOT>/usr/include
    • both generated install manifests contain the expanded paths and no literal @WEBOS_INSTALL_INCLUDEDIR@
    • generated PmLogLib-private.pc and PmLogLib-headers.pc retain correctly expanded pkg-config paths
  • configured the actual cxx/CMakeLists.txt in a target-only harness with the existing cmake-modules-webos#3 head; its generated install script places PmLog.h in <WEBOS_INSTALL_ROOT>/usr/include, and PmLogLibCpp.pc has the same includedir
  • git diff --check
  • git ls-files --eol CMakeLists.txt cxx/CMakeLists.txt

Dependency note

A full unmodified CMake 4 configure currently stops in cmake-modules-webos/webOS/webOS.cmake, which still declares CMake 2.8.7. That dependency is tracked by webosose/cmake-modules-webos#2; its open PR #3 also fixes the later CMake 4 rejection of reading a build target's LOCATION. This PR does not duplicate those dependency fixes. The full library build additionally requires the webOS glib-2.0 and pbnjson_c development environment.

Raise the CMake minimum to 3.5 so CMake 4.x can configure the project, and use WEBOS_INSTALL_INCLUDEDIR as a CMake variable in install() rules instead of the pkg-config template placeholder syntax.

Fixes webosose#2

Generated-by: OpenAI Codex
Signed-off-by: aineoae86-sys <ai.neo.ae86@gmail.com>
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.

Fails to build with newer cmake

2 participants