Installing additional files with CMake

后端 未结 2 570
感情败类
感情败类 2021-02-07 05:24

I am attempting to supply some \"source\" files with some executables. I was wondering if there was a way to copy these source files to the build directory (From the source dire

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-07 06:27

    If you want to copy a folder's tree with some type of files:

      # Copy all assets to resources file
      INSTALL(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/assets/ DESTINATION ${INSTALL_PATH}/assets
              FILES_MATCHING PATTERN "*.dae"  PATTERN "*.jpg")
    

    If you want to copy all files in folders, just remove the FILES_MATCHING patterns.

提交回复
热议问题