Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
CMake
CMake
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,296
    • Issues 3,296
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 9
    • Merge Requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • External Wiki
    • External Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #21530

Closed
Open
Created Nov 30, 2020 by Simon@Simon777

file: Add a COPY command working at cmake generation time

Hi,

I want to copy files on a destination path and on condition which depend on the build type for a multi config generator. Unfortunately the command file(copy... does not work with generator expression.

I wanted to use the file(generate... with the condition parameter, but unfortunately this function does not work on binary file, it copies only part of them (a 5 Mb binary file becomes silently a 3 Kb file which is more or less the beginning of the original file). I guess the function only work for text file, not for binary file. Maybe there is something to make more explicit here (documentation, error case when copying, ...).

Is there another way to achieve what I want without executing sub-process command to copy file at the build time ? Would it makes sense to have a version of the file(copy function at the generation time which supports generator expression and a condition parameter ?

Thank you,

Simon

Edited Nov 30, 2020 by Brad King
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None