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 8508095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:03:42+00:00 2026-06-11T03:03:42+00:00

I am using CMake to build my system and my unit tests. I am

  • 0

I am using CMake to build my system and my unit tests.

I am also doing an out-of-source build.

I’ve found with the ADD_TEST() command, that you don’t need to install the test executable (it will just be run when you run make install, which is great).

However, my unit tests depend on some input files, which need to be copied to where the executable is built.

As far as I am aware, I can’t use INSTALL() to copy the files there, because I haven’t specified where there is – it depends on where the build command is called.

Is there some way I can tell CMake to copy my test files to the same location that it builds the executable?

  • 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-06-11T03:03:43+00:00Added an answer on June 11, 2026 at 3:03 am

    This may not be the best solution, but currently I am doing this:

    file(COPY my_directory DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
    

    Which seems to be doing the trick.

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

Sidebar

Related Questions

I have been using cmake to build my projects out of source, which is
I'm using cmake to generate an nmake build system using the NMake Makefiles generator.
I have built the OpenCV libraries using the cmake build system as described here
A few years ago I looked into using some build system that isnt Make
I'm building a file using the CMake Build System and Microsoft's Visual C++ compiler.
Hallo, I'm using CMake as build system in one of my projects which is
I'm using CMake for my build system and in the project, we will have
I have begun using the waf build system as an alternative to CMake. So
I'm fairly new at using CMake to manage my build system, so if I'm
I am using CMake to build my project and I have the following line:

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.