0

HI I'm beginning to use cmake, And I like it a lot, I was wondering if there was a command to add an existing folder that contain input file in the build process.

Desired structure

project/
   src/
   ressources/someinputData

I don't want to copy all the files on resources to the build folder.

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
  • 1
    What do you mean by "add in the build process"? Are you files involved in the build process (if yes, how?) or do you want them installed with your targets? – rocambille Aug 02 '16 at 14:29
  • Non there are non compiled file,Just some input data to test my program. – anass belcaid Aug 02 '16 at 14:45

1 Answers1

1

You can use the command install to copy your files when using make install or building the INSTALL project in visual, according to your prefered tool:

install(
    FILES /path/to/your/file.s
    DESTINATION /where/you/want/to/copy
)

There is also this version to install a whole directory, eventually filtering file extensions:

install(
    DIRECTORY /path/to/your/directory/
    DESTINATION /where/you/want/to/copy
    FILES_MATCHING
    PATTERN *.txt  # only copy text files
)
rocambille
  • 15,398
  • 12
  • 50
  • 68