Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 404265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:17:33+00:00 2026-05-12T17:17:33+00:00

I am trying to automate my build process with cmake. There is currently only

  • 0

I am trying to automate my build process with cmake.
There is currently only one issue:

Where is, in cmake’s philosophy (if there is one), the best place
to put the copying of data files.

I have a library and a few examples. The examples need the data.

I currently do the following:

I use a custom command in each example’s CMakeLists.txt to copy all the Data into the
CMAKE_CURRENT_BINARY_DIR in a post-build step.
I use this in my debugging workflow, so no install target is executed yet.

This works quite well, but has certain drawbacks:

  1. The copying occurs everytime the project is built. With VS 2005 this sometimes occurs even if it is not newly built. Since the data folders are big, the copying takes time, and it gets a bit annoying.
  2. I am certain that this is a very clumsy way of doing this.

I want to copy those directories to the executable paths, so I don’t need hints how to set the debug working directory

The perfect time to copy these directories would be at cmake configuration/generation time, at least I think so.
Should I do this, and how would I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:17:33+00:00Added an answer on May 12, 2026 at 5:17 pm

    As recently seen in this question, you can use configure_file to copy files to the build directory:

    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/input.txt
        ${CMAKE_CURRENT_BINARY_DIR}/output.txt COPYONLY)
    

    That does it once at build time and only when needed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to automate InstallShield from my build process, and I need to set
I'm trying to automate the build process for engineering group. As part of that
Im trying to automate our build process. To do this i need to compile
We are in the process of trying to automate our build process. We use
I'm trying to configure NAnt to automate my build process - once I've got
I am currently trying to automate the deployment process of our rails app as
I'm trying to incorporate some JavaScript unit testing into my automated build process. Currently
Lately, I have been trying to automate our build process on Amazon EC2 and
I am trying to automate our build/deployment process. So far I am using: a
I'm trying to automate the build of a project in Delphi 2009. I'm using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.