我有一个非常简单的
CMakeLists.txt
文件:
cmake_minimum_required(VERSION 3.15)
project(Test_documentation)
find_package(Doxygen)
if (Doxygen_FOUND)
find_file(DOXYGEN_PLANTUML_JAR_PATH
plantuml.jar
$ENV{PLANT_UML_JAR_PATH}
/usr/share/plantuml
)
endif (Doxygen_FOUND)
(我确实有更多,但我在尝试解决此问题时将其剥离)。
我想运行一个简单的源代码外构建(在 Windows 上 - 尽管我知道其中一个 plantuml 搜索路径与 Linux 相关)。
PS D:\cmaketest> cmake D:\repos\My\far\away\project\Doc\CMakeLists.txt
....
-- Build files have been written to: D:/repos/My/far/away/project/Doc
cmaketest
中根本没有写入任何内容(我希望将构建文件写入其中,并且 .\Doc 保持不变。)
...\Doc 中没有其他与 CMake 相关的文件。
我在这里出了什么问题,因为我想要一个源代码外构建,而不是让任何构建文件位于源目录中。
我通过使用 -S (源路径)和 -B (构建路径)选项解决了这个问题。
即。
cmake -S D:\repos\path\to\my\far\away\project\Doc -B .
会在Doc目录下找到
CMakeLists.txt
,并在当前目录下构建一棵树。