Skip to content

config updates#6

Merged
smanders merged 2 commits into
xprofrom
config
May 15, 2026
Merged

config updates#6
smanders merged 2 commits into
xprofrom
config

Conversation

@smanders
Copy link
Copy Markdown
Collaborator

more CPS-ready...

smanders added 2 commits May 15, 2026 13:07
- Include BuildFlatBuffers.cmake conditionally in xpflatbuffers
- Improve flatc executable detection with fallback logic
- Consolidate FlatcTargets and FlatBuffersSharedTargets into single export
- Add DEFAULT_TARGETS to extern package configuration
- Simplify package configuration by removing redundant includes
@smanders smanders added the release:tag Tag release on merge label May 15, 2026
@smanders smanders merged commit 8d563ad into xpro May 15, 2026
22 checks passed
@smanders smanders deleted the config branch May 15, 2026 19:17
@smanders
Copy link
Copy Markdown
Collaborator Author

looks like there are issues with these changes and the xpv25.2.10.5 release https://github.com/externpro/flatbuffers/releases/tag/xpv25.2.10.5

CMake Warning in _bld-Darwin/_xpro/xpx/flatbuffers-xpv25.2.10.5-clang17-Darwin-arm64-xpro/share/cps/flatbuffers.cps:
  component "flatbuffers::flatc" has unknown type "executable" and was not
  imported
Call Stack (most recent call first):
  .devcontainer/cmake/xpfunmac.cmake:852 (find_package)
  .devcontainer/cmake/xproinc.cmake:20 (xpFindPkg)
  test/CMakeLists.txt:38 (find_package)


CMake Error at .devcontainer/cmake/xpfunmac.cmake:852 (find_package):
  find_package component flatc was not found
Call Stack (most recent call first):
  .devcontainer/cmake/xproinc.cmake:20 (xpFindPkg)
  test/CMakeLists.txt:38 (find_package)


-- Found flatbuffers.cps: 25.2.10.5
CMake Error at _bld-Darwin/_xpro/xpx/flatbuffers-xpv25.2.10.5-clang17-Darwin-arm64-xpro/share/cmake/xpflatbuffers.cmake:17 (include):
  include could not find requested file:

    /Users/smanders/Code/pros/buildpro/test/flatbuffers/BuildFlatBuffers.cmake
Call Stack (most recent call first):
  test/flatbuffers/CMakeLists.txt:14 (xpFlatBuffersBuild)


CMake Error at _bld-Darwin/_xpro/xpx/flatbuffers-xpv25.2.10.5-clang17-Darwin-arm64-xpro/share/cmake/xpflatbuffers.cmake:19 (build_flatbuffers):
  Unknown CMake command "build_flatbuffers".
Call Stack (most recent call first):
  test/flatbuffers/CMakeLists.txt:14 (xpFlatBuffersBuild)


-- Configuring incomplete, errors occurred!

@smanders
Copy link
Copy Markdown
Collaborator Author

it appears the CMake Error of xpflatbuffers.cmake including BuildFlatBuffers.cmake can be fixed by changing ${CMAKE_CURRENT_LIST_DIR} to ${CMAKE_CURRENT_FUNCTION_LIST_DIR}

diff --git a/CMake/xpflatbuffers.cmake b/CMake/xpflatbuffers.cmake
index 4fda7e99..b28eb25a 100644
--- a/CMake/xpflatbuffers.cmake
+++ b/CMake/xpflatbuffers.cmake
@@ -14,7 +14,7 @@ function(xpFlatBuffersBuild)
     set(P_GENERATED_INCLUDES_DIR ${CMAKE_CURRENT_BINARY_DIR}/fbs)
   endif()
   if(NOT COMMAND build_flatbuffers)
-    include(${CMAKE_CURRENT_LIST_DIR}/BuildFlatBuffers.cmake)
+    include(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/BuildFlatBuffers.cmake)
   endif()
   build_flatbuffers("${P_SCHEMAS}" "${P_SCHEMA_INCLUDE_DIRS}" ${P_CUSTOM_TARGET_NAM>
     "${P_ADDITIONAL_DEPS}" "${P_GENERATED_INCLUDES_DIR}"

see docs https://cmake.org/cmake/help/latest/variable/CMAKE_CURRENT_FUNCTION_LIST_DIR.html

@smanders
Copy link
Copy Markdown
Collaborator Author

but the CMake Warning

  component "flatbuffers::flatc" has unknown type "executable" and was not
  imported

and CMake Error

find_package component flatc was not found

appears to be a CMake implementation limitation rather than a CPS specification limitation. The CPS specification supports executables, but perhaps CMake's CPS implementation hasn't caught up with the full specification yet?


CMake CPS Executable Component Limitation Analysis

Issue Summary

The warning message you're encountering:

component "flatbuffers::flatc" has unknown type "executable" and was not imported

Indicates that CMake's CPS implementation doesn't properly handle executable components, even though the CPS specification supports them.

Root Cause: CMake Implementation Limitation

This is a CMake implementation limitation rather than a CPS specification limitation.

Supporting Evidence

1. CPS Specification Officially Supports Executables

URL: https://cps-org.github.io/cps/schema.html

The official CPS schema documentation explicitly lists "executable" as one of the officially supported component types:

"Officially supported values are 'executable' (any artifact which the target platform can directly execute), 'archive', 'dylib', 'module', 'jar', 'interface' and 'symbolic'"

2. CMake Acknowledges Implementation Limitations

URL: https://www.kitware.com/common-package-specification-is-out-the-gate/

Kitware's official announcement states:

"Please be aware that there are some limitations which you may encounter, especially for projects whose usage interface relies on CMake generator expressions, as these are not supported by CPS"

This confirms CMake's CPS implementation has known limitations and gaps.

3. CMake Documentation Shows Limited Executable Support

URL: https://cmake.org/cmake/help/latest/command/install.html

The install(PACKAGE_INFO) documentation mentions CPS export but doesn't provide comprehensive details about executable component handling, showing limited documentation for executable components in CPS context.

Technical Details

CPS Specification vs CMake Implementation

Aspect CPS Specification CMake Implementation
Executable Component Type ✅ Officially supported ❌ Not recognized
Component Type Handling Complete specification Partial implementation
Error Message N/A "unknown type 'executable'"

CPS Component Types (Officially Supported)

According to the CPS schema, the following component types are officially supported:

  • "executable" - Any artifact which the target platform can directly execute
  • "archive" - CABI static library
  • "dylib" - CABI shared library
  • "module" - CABI plugin library
  • "jar" - Java Archive
  • "interface" - Virtual component without location
  • "symbolic" - Feature testing component

Current Status

  • CPS Specification: Complete and supports executable components
  • CMake Implementation: Experimental status removed in CMake 4.3, but still incomplete
  • Workaround: Use traditional CMake package configuration files for executable components

Recommendations

  1. Short-term: Continue using traditional CMake package configuration files for packages with executable components
  2. Long-term: Monitor CMake releases for improved CPS implementation
  3. Reporting: Consider filing issues with CMake for missing CPS component type support

Conclusion

The evidence clearly shows this is a CMake implementation gap, not a CPS specification limitation. The CPS specification properly defines executable components, but CMake's implementation hasn't caught up with the full specification yet.

@smanders smanders mentioned this pull request May 15, 2026
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:tag Tag release on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant