CLion and CMake: only building a library without an executable?

后端 未结 1 1595
夕颜
夕颜 2020-12-14 10:21

How to only build a static library with clion without having an executable? How does the CMakeLists.txt look like? (without add_executable)

Update: If

相关标签:
1条回答
  • 2020-12-14 10:37

    This is an old question. But I'll add the answer to your question as a help for other people. You need to replace your add_executable with add_library

    add_library(target_name source_files)
    
    0 讨论(0)
提交回复
热议问题