Issue
I have a very simple CMakeLists.txt
file:
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)
(I did have more but I stripped it down whilst trying to fix this issue).
I want to run a simple out-of-source build (on Windows - though I know one of those plantuml search path's is Linux-related).
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
Nothing gets written in cmaketest
at all (and I want the build files to be written there and .\Doc to be unchanged.)
There are no other CMake-related files in ...\Doc.
What have I got wrong here as I want an out of source build and not for any of the build files to be in the source directory.
Solution
I solved this by using the -S (path to source) and -B (path to build) options.
ie.
cmake -S D:\repos\path\to\my\far\away\project\Doc -B .
Will find the CMakeLists.txt
in the Doc directory and build a tree in the current directory.
Answered By - adrianmcmenamin Answer Checked By - Senaida (WPSolving Volunteer)