Multiple Cmake_Prefix_Paths

前端 未结 1 866
梦如初夏
梦如初夏 2020-12-28 14:05

On a project I develop on, we\'re using cmake to compile our service. Currently, we need to get data for Qt from 3 different locations and I\'m curious if there\'s a way to

相关标签:
1条回答
  • 2020-12-28 14:45

    To provide multiple paths in the CMAKE_PREFIX_PATH variable you need to delimit each entry by ;(semicolon). So your command will look like:

    cmake -DCMAKE_PREFIX_PATH="C:\Qt\5.5\msvc2013\lib\cmake;C:\protobuf\src;C:\protobuf\c‌​make\build\Release"
    

    To check if everything alright with the provided paths you can use the following code in the cmake file:

    foreach(path ${CMAKE_PREFIX_PATH})
      message("Path: " ${path})
    endforeach(path)
    

    It will print every path provided.

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