Skip to content

build: Add support for CMake builds#89

Open
gulfemsavrun wants to merge 5 commits into
Linaro:masterfrom
gulfemsavrun:add-cmake-support
Open

build: Add support for CMake builds#89
gulfemsavrun wants to merge 5 commits into
Linaro:masterfrom
gulfemsavrun:add-cmake-support

Conversation

@gulfemsavrun
Copy link
Copy Markdown

  1. Add a root CMakeLists.txt file to provide cross-platform build support, making it easier to link against OpenCSD in large external projects.

  2. Generate native CMake package files using OpenCSDConfig.cmake.in template.

@mikel-armbb
Copy link
Copy Markdown
Contributor

Hi,
I've tried out the cmake patch you provided on linux initially. It works in as far as it goes. However the lack of building the .so files etc for linux is an issue - any build update needs to be comprehensive and produce the same output per platform as the original build process.

The cmake install method installs far more header files than the linux install - at present the linux install only adds sufficient for using the c-api based library. There is also no uninstall option within the cmake solution

In short, what you have provided may be sufficient for build into a larger project - adding cmake to the library should also allow a standalone build that produces the same results as the existing build.

Regards

Mike

@mikel-armbb
Copy link
Copy Markdown
Contributor

I've added an update on top of your original patch. Please look at and see if your requirements are still met.

I do not think this is yet tested enough for the main upstream branch so may have to miss the next release.

Mike

@gulfemsavrun
Copy link
Copy Markdown
Author

I've added an update on top of your original patch. Please look at and see if your requirements are still met.

I do not think this is yet tested enough for the main upstream branch so may have to miss the next release.

Mike

Thanks for the feedback, Mike! I have just pushed a new commit that addresses your points regarding restricted header installation and the addition of the uninstall target. I have verified that these changes work on macOS, Linux, and Windows.

Can you please clarify where exactly you pushed an update on top of my patch, as I was not able to find it in the PR commits or branches?

@gulfemsavrun
Copy link
Copy Markdown
Author

@mikel-armbb when is the upcoming release planned?

@mikel-armbb
Copy link
Copy Markdown
Contributor

My updates are in an rc branch - ocsd-main-1.8.2-rc1

1) Add a root CMakeLists.txt file to provide cross-platform
build support, making it easier to link against OpenCSD in
large external projects.

2) Generate native CMake package files using
OpenCSDConfig.cmake.in template.
@mikel-armbb
Copy link
Copy Markdown
Contributor

I've moved the cmake development onto ocsd-main-1.8.3-rc1 which will be pushed shortly. I didn't want to delay a decoder fix which is to go out as 1.8.2.

@gulfemsavrun
Copy link
Copy Markdown
Author

I've moved the cmake development onto ocsd-main-1.8.3-rc1 which will be pushed shortly. I didn't want to delay a decoder fix which is to go out as 1.8.2.

Thanks @mikel-armbb. Could you please incorporate the latest version of my changes into the ocsd-main-1.8.3-rc1 branch?

@mikel-armbb
Copy link
Copy Markdown
Contributor

The second patch does not apply cleanly to ocsd-main-1.8.3-rc1

CMake linux build updated to match the existing makefiles full project build
by default.

CMake windows build updated to ensure full windows build works.

Option to build only the static libs retained.

Added docs to explain CMake use.

Added python helper script to drive cmake tools on each platform for ease of testing
CMake builds.

Signed-off-by: Mike Leach <mike.leach@arm.com>
In the python test script ensure that only options after '--' are passed
through to the trc_pkt_lister program.

Unknown options before this will now result in a error and the script
will fail

Signed-off-by: Mike Leach <mike.leach@arm.com>
Signed-off-by: Mike Leach <mike.leach@arm.com>
@gulfemsavrun gulfemsavrun force-pushed the add-cmake-support branch 2 times, most recently from 6ec9b72 to 9338a17 Compare May 29, 2026 00:30
@gulfemsavrun
Copy link
Copy Markdown
Author

The second patch does not apply cleanly to ocsd-main-1.8.3-rc1

I've resolved the merge conflicts. Could you please try again?

1) Restrict installed headers to match the Makefile,
ensuring only sufficient headers for using the C-API
are installed.

2) Add an uninstall target to allow removing installed
files.

3) Resolve parallel build race conditions and target
link failures.
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.

2 participants