Copy file from source directory to binary directory using CMake

后端 未结 8 1830
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-28 03:37

I\'m trying to create a simple project on CLion. It uses CMake (I\'m new here) to generate Makefiles to build project (or some sort of it)

All I need to is transfer

8条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-28 04:24

    If you want to put the content of example into install folder after build:

    code/
      src/
      example/
      CMakeLists.txt
    

    try add the following to your CMakeLists.txt:

    install(DIRECTORY example/ DESTINATION example)
    

提交回复
热议问题