CMake introduces /__/ in paths. What's the reason?
Here an example from compiling METIS which uses CMake:
[ 3%] Building C object libmetis/CMakeFiles/metis.dir/__/GKlib/b64.c.o
cd /workstuff/dune/zusatz/metis-5.0.2/build/Linux-x86_64/libmetis && /usr/bin/gcc
-DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall
-pedantic -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2
-DHAVE_EXECINFO_H -DHAVE_GETLINE -O3 -I/workstuff/dune/zusatz/metis-5.0.2/GKlib
-I/workstuff/dune/zusatz/metis-5.0.2/include -I/workstuff/dune/zusatz/metis-5.0.2/libmetis/.
-o CMakeFiles/metis.dir/__/GKlib/b64.c.o -c /workstuff/dune/zusatz/metis-5.0.2/GKlib/b64.c
We observe this behavior when adding files to a library / an executable that are not located in a sub-directory of the "current source dir" thus using "/../".
Here an example of when we get this:
FILE(GLOB inFiles
"${CMAKE_CURRENT_SOURCE_DIR}/../BuildEnvCommon/*.c"
"${CMAKE_CURRENT_SOURCE_DIR}/../BuildEnvCommon/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../BuildEnvCommon/*.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/../BuildEnvCommon/*.h"
)
(snip)
add_executable("ProjectName" ${inFiles})
In your example I can imagine that the GKlib is not located in the libmetis source tree but that the compiled source b64.c is added by hand into the library / the executable and compiled as part of it instead of linking against a (separately) compiled GKlib. I hope it's clear what I mean.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With