Closed K20shores closed 3 months ago
The linked kitware issue solves the problem. BUT if I do a make install in a project that includes json-fortran with FetchContent, json-fortran also gets installed because there is no check to make sure the project is not the top level proejct.
Fixed in #557
Given this CMakeLists.txt file
and this fortran program
I cannot build the cmake project. That project attempts to include json-fortran with
FetchContent
. This is the error messageIf I look into
build/_deps/jsonfortran-gnu-build
, I can see that the mod files are there instead of inbuild/_deps/jsonfortran-gnu-build/include
which is odd because the output ofmessage(STATUS ${MODULE_DIR})
inside of the json-fortran CMakeLists.txt points to/Users/kshores/Downloads/thing/build/_deps/jsonfortran-gnu-build/include
.When I
make VERBOSE=1
and look at the command that copies the mod files to the include directory, this is what it isI realize that this could be a bug in cmake, but I thought I'd drop this here just in case one of the maintainers might know offhand what could be causing this. If I figure it out, I'll make a PR.