假設我們在CMakeLists.txt文件夾/A
中有一個命令調用foo
。如何包含額外的CMakeLists.txt
foo
在antother CMakeLists.txt中定義,該文件位於文件夾/B
中。
如何從/A/CMakeLists.txt
內引用/B/CMakeLists.txt
以便撥打foo
?
我試圖通過搜索路徑設置爲/B/CMakeLists.txt
:
CMAKE_INCLUDE_PATH
CMAKE_MODULE_PATH
CMAKE_SOURCE_DIR
,但沒有一次成功。
CMake的還是complaines Unknown CMake command "foo".