OTB Superbuild does not forward compiler versions to external projects anymore
Mantis Issue 1251, reported by mgrizonnet, assigned to rkanavath, created: 2016-07-12
I've 2 versions of gcc available on my system. One in /usr/lib and the other in a local directory $GCCHOME.
I noticed that OTB superbuild does not forward anymore compiler versions to external projects (also projects which use cmake).
I've noticed this with ITK.
Note that the compiler options like CMAKE_CXX_COMPILER are properly forwarded to external projects.
Note that compiler forwarding was working on the same system with OTB 5.4.
1468335826 - grizonnetmI confirm that compiler information is not properly forwarded for all external projects build with cmake. Ironically it seems to work for project which use autoconf like gdal.
1468394765 - rashadkmCC=GCCHOME/bin/gcc CXX=
GCCHOME/bin/g++ cmake must be enough for cmake to use compiler.
but in your command line, you have wrong variable type
CMAKE_C_COMPILER:STRING= must be CMAKE_C_COMPILER:FILEPATH= same for CMAKE_CXX_COMPILER
you can confirm this in your CMakeCache.txt, you can see two CMAKE_C_COMPILER setting one with string and other with FILEPATH.
BTW, there is a way to pass it using SB_CMAKE_ARGS where we now put only cmake generator to externalprojects.
1468395905 - grizonnetmchanging the variable type does not solve the problem.
What seems to work is to patch SB_CMAKE_ARGS cmakelists. Compilation is not over yet but I can see in the log that the right compiler is forwarded to external projects.
diff --git a/SuperBuild/CMakeLists.txt b/SuperBuild/CMake