CMAKE: Build library and link against it

前端 未结 4 1923
挽巷
挽巷 2021-02-13 20:38

I\'m trying to use cmake (on Linux with GNU make and g++) to build a project with two sub-directories: MyLib and MyApp. MyLib contains source for a static library; MyApp needs

4条回答
  •  别跟我提以往
    2021-02-13 21:15

    I've discovered the 'optimal' solution to (1)... so, thought I should post it here:

    SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY MyStage)
    SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY MyStage)
    

    The thing that confused me previously is that static libraries are not considered a LIBRARY by Cmake - they're considered to be ARCHIVEs.

提交回复
热议问题