Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CMakeRC] Add new port #24454

Merged
merged 9 commits into from
Apr 29, 2022
Merged

[CMakeRC] Add new port #24454

merged 9 commits into from
Apr 29, 2022

Conversation

Pospelove
Copy link
Contributor

@Pospelove Pospelove commented Apr 27, 2022

CMakeRC - A Standalone CMake-Based C++ Resource Compiler
https://github.com/vector-of-bool/cmrc

This port contains only one CMake file.

Port is called cmakerc, not cmrc cause we need find_package(CMakeRC REQUIRED), not find_package(cmrc REQUIRED)

Usage

find_package(CMakeRC REQUIRED)

# Creates assets library containing all files in `assets` directory
file(GLOB_RECURSE asset_sources assets/*)
cmrc_add_resource_library(assets ${asset_sources})

# Links assets library to our executable
target_link_libraries(main PRIVATE assets)

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

PRs must add only one version and must not modify any published versions

When making any changes to a library, the version or port-version in vcpkg.json or CONTROL must be modified.

Error: Local changes detected for cmakerc but no changes to version or port version.
-- Version: 2021-08-27
-- Old SHA: 5d87fadf9a36c2346477c4a72b1bcf7dbee2afc5
-- New SHA: 23c4f2a7faae911ecc264e6e775ad77fcc7c44cc
-- Did you remember to update the version or port version?
-- Pass `--overwrite-version` to bypass this check.
***No files were updated.***

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

PRs must add only one version and must not modify any published versions

When making any changes to a library, the version or port-version in vcpkg.json or CONTROL must be modified.

Error: Local changes detected for cmakerc but no changes to version or port version.
-- Version: 2021-08-27
-- Old SHA: 23c4f2a7faae911ecc264e6e775ad77fcc7c44cc
-- New SHA: bcc7cc3a7d19acc6e11cb3c03e16208b750d8489
-- Did you remember to update the version or port version?
-- Pass `--overwrite-version` to bypass this check.
***No files were updated.***

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

PRs must add only one version and must not modify any published versions

When making any changes to a library, the version or port-version in vcpkg.json or CONTROL must be modified.

Error: Local changes detected for cmakerc but no changes to version or port version.
-- Version: 2021-08-27
-- Old SHA: 23c4f2a7faae911ecc264e6e775ad77fcc7c44cc
-- New SHA: d44e1fe27676ec334adb098ec3a3734e6b8ac0ff
-- Did you remember to update the version or port version?
-- Pass `--overwrite-version` to bypass this check.
***No files were updated.***

@Neumann-A
Copy link
Contributor

This is not a library why package it with vcpkg?

@Pospelove
Copy link
Contributor Author

This is not a library why package it with vcpkg?

Actually, it is. The author just embeds C++ code into CMake:
https://github.com/vector-of-bool/cmrc/blob/master/CMakeRC.cmake#L66
https://github.com/vector-of-bool/cmrc/blob/master/CMakeRC.cmake#L442

So in C++, you use it like a normal library.

#include <cmrc/cmrc.hpp>

int main() {
    // ...
}

I'm not sure how to handle such things properly. That's why I created the PR. Looking forward to changes to be requested.

Why I ever created the PR is because I want all dependencies to be managed by vcpkg without copy-pasting anything into sources. In fact, CMakeRC can be treated as a header-only library that is hidden inside a CMake script.

@JonLiu1993 JonLiu1993 added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Apr 28, 2022
ports/cmakerc/portfile.cmake Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

PRs must add only one version and must not modify any published versions

When making any changes to a library, the version or port-version in vcpkg.json or CONTROL must be modified.

Error: Local changes detected for cmakerc but no changes to version or port version.
-- Version: 2021-08-27
-- Old SHA: d44e1fe27676ec334adb098ec3a3734e6b8ac0ff
-- New SHA: 740fd9bb83e79eba29ccd69546d2b3105d719d5d
-- Did you remember to update the version or port version?
-- Pass `--overwrite-version` to bypass this check.
***No files were updated.***

@dg0yt
Copy link
Contributor

dg0yt commented Apr 28, 2022

Port is called cmakerc, not cmrc cause we need find_package(CMakeRC REQUIRED), not find_package(cmrc REQUIRED)

FTR the CMake package name doesn't need to match the port name. The config just needs to go a matching directory. However, the project calls itself "CMakeRC". OTOH the C++ functions and includes are in namespace cmrc.

@JonLiu1993 JonLiu1993 added the info:reviewed Pull Request changes follow basic guidelines label Apr 28, 2022
Copy link
Contributor

@JackBoosY JackBoosY left a comment

Choose a reason for hiding this comment

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

I think it's good to me.

@ghost
Copy link

ghost commented Apr 29, 2022

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

❌ Pospelove sign now
You have signed the CLA already but the status is still pending? Let us recheck it.

@BillyONeal
Copy link
Member

There's currently an outstanding issue with the CLA bot; I pushed a merge into this to get the Actions bot to confirm that the version DB edits were OK (they were as far as I could tell).

Because it was entirely green before this (in 8efad51 ) I'm going to force merge this once everything else is green.

@BillyONeal BillyONeal merged commit 6e52f31 into microsoft:master Apr 29, 2022
@Pospelove Pospelove deleted the cmakerc branch April 29, 2022 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR! info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants