【发布时间】:2019-12-09 14:09:59
【问题描述】:
假设我用vcpkg 安装了一些库,并且它有很多依赖(比如cgal)。现在我想用CMake针对这些库编译一些程序。
我应该如何告诉CMake 我下载的所有库的所有位置?包括我安装的主库?我在CMake 中只有一个设置,称为“源目录”,它将指向我的代码。库的设置在哪里?
D:\Users\ThirdPartyDesign\CGAL-5.0-examples\CGAL-5.0\examples\Triangulation_2
λ env | grep CMAKE
CMAKE_TOOLCHAIN_FILE=D:\Users\ThirdPartyDesign\vcpkg\scripts\buildsystems\vcpkg.cmake
D:\Users\ThirdPartyDesign\CGAL-5.0-examples\CGAL-5.0\examples\Triangulation_2
λ cmake .
CMake Warning at CMakeLists.txt:18 (find_package):
By not providing "FindCGAL.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "CGAL", but
CMake did not find one.
Could not find a package configuration file provided by "CGAL" with any of
the following names:
CGALConfig.cmake
cgal-config.cmake
Add the installation prefix of "CGAL" to CMAKE_PREFIX_PATH or set
"CGAL_DIR" to a directory containing one of the above files. If "CGAL"
provides a separate development package or SDK, be sure it has been
installed.
-- This program requires the CGAL library, and will not be compiled.
-- Configuring done
-- Generating done
-- Build files have been written to: D:/Users/ThirdPartyDesign/CGAL-5.0-examples/CGAL-5.0/examples/Triangulation_2
【问题讨论】: