{"id":17981981,"url":"https://github.com/sftrabbit/cmake-transform","last_synced_at":"2026-02-17T11:02:46.658Z","repository":{"id":151887685,"uuid":"92741445","full_name":"sftrabbit/cmake-transform","owner":"sftrabbit","description":"CMake functions for transforming files","archived":false,"fork":false,"pushed_at":"2017-05-30T21:15:03.000Z","size":4,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T09:29:43.119Z","etag":null,"topics":["cmake","cmake-scripts"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sftrabbit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-29T13:13:48.000Z","updated_at":"2021-05-12T21:36:01.000Z","dependencies_parsed_at":"2023-05-13T18:00:13.983Z","dependency_job_id":null,"html_url":"https://github.com/sftrabbit/cmake-transform","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sftrabbit/cmake-transform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sftrabbit%2Fcmake-transform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sftrabbit%2Fcmake-transform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sftrabbit%2Fcmake-transform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sftrabbit%2Fcmake-transform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sftrabbit","download_url":"https://codeload.github.com/sftrabbit/cmake-transform/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sftrabbit%2Fcmake-transform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29541119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T08:11:05.436Z","status":"ssl_error","status_checked_at":"2026-02-17T08:09:38.860Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","cmake-scripts"],"created_at":"2024-10-29T18:12:34.838Z","updated_at":"2026-02-17T11:02:46.636Z","avatar_url":"https://github.com/sftrabbit.png","language":"CMake","readme":"# CMake Transform\n\nCMake Transform is a collection of CMake functions for transforming files by piping them through a command.\n\n## Usage\n\nTo add a transform target that will transform a list of source files by piping their content through a command:\n\n    add_transform(\u003ctransform_name\u003e\n      COMMAND \u003ccommand\u003e\n      SOURCES \u003cfiles\u003e...)\n\nThis also creates targets for each transformed file. To extract the names of the transformed file targets:\n\n    get_transformed(\u003ctransform_name\u003e \u003coutput_variable\u003e\n      SOURCES \u003cfiles\u003e...)\n\n## Example\n\nGiven a text file `test.txt`:\n\n    The old man said \"GREETING\" to the dog. The dog responded in kind: \"GREETING\". \n\nWe can create a transform target in our `CMakeLists.txt` that substitutes the text `GREETING` with `Hello` and then, for demonstration purposes, add a post-build command that prints the transformed file contents:\n\n    include(transform.cmake)\n\n    set(input_file test.txt)\n\n    add_transform(substitute\n      COMMAND sed -e 's/GREETING/Hello/g'\n      SOURCES ${input_file})\n\n    get_transformed(substitute transformed_test_file\n      SOURCES ${input_file})\n    \n    add_custom_command(\n      TARGET substitute\n      POST_BUILD\n      COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/${transformed_test_file}) \n\nIf we then run `cmake` on the directory with these files and then `make substitute`, we see the following output:\n\n    Scanning dependencies of target substitute\n    [100%] Generating CMakeFiles/transform_gen/substitute/test.txt\n    The old man said \"Hello\" to the dog. The dog responded in kind: \"Hello\".\n    [100%] Built target substitute\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsftrabbit%2Fcmake-transform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsftrabbit%2Fcmake-transform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsftrabbit%2Fcmake-transform/lists"}