<div dir="ltr"><div><div>I have been trying to compile Ogre [1] as external dependency with ExternalProject_Add(). In theory this should be straightforward since Ogre itself also uses CMake as buildsystem. However, in the process I encountered the following problem:<br><br></div>Ogre checks the value of the CMAKE_COMPILER_IS_GNUCXX variable in some places (e.g. [2]). I am running Linux and compiling with g++ and everything works fine if I manually configure Ogre with cmake or cmake-gui. Unfortunately, after wrapping everything inside ExternalProject_Add(), the CMAK_COMPILER_IS_GNUCXX variable is no longer being set correctly.<br></div><div><div><div><div><div><div><div><br></div><div>A simple workaround is to manually set this variable, i.e.:<br><br></div><div><pre> ExternalProject_Add(
    ogre
    URL <a href="https://bitbucket.org/sinbad/ogre/get/v1-9-0.zip" target="_blank">https://bitbucket.org/sinbad/ogre/get/v1-9-0.zip</a>
    CMAKE_ARGS
      -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_OUTPUT_DIR}
      -DCMAKE_COMPILER_IS_GNUCXX=${CMAKE_COMPILER_IS_GNUCXX}   # workaround
  )</pre>This works, but I'm uncertain if this should be necessary. Is this a bug or a feature?<br></div><div><br><br>[1] <a href="https://bitbucket.org/sinbad/ogre" target="_blank">https://bitbucket.org/sinbad/ogre</a><br>[2] <a href="https://bitbucket.org/sinbad/ogre/src/0d580c7216abe27fafe41cb43e31d8ed86ded591/CMake/Utils/OgreConfigTargets.cmake?at=default&fileviewer=file-view-default#OgreConfigTargets.cmake-277" target="_blank">https://bitbucket.org/sinbad/ogre/src/0d580c7216abe27fafe41cb43e31d8ed86ded591/CMake/Utils/OgreConfigTargets.cmake?at=default&fileviewer=file-view-default#OgreConfigTargets.cmake-277</a><br></div></div></div></div></div></div></div></div>