LocalUserOptions.cmake included twice if doing in-source build
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
using vtk-5.6.0.tar.gz
CMakeLists.txt line 1078 and 1079 INCLUDE(${VTK_BINARY_DIR}/LocalUserOptions.cmake OPTIONAL) INCLUDE(${VTK_SOURCE_DIR}/LocalUserOptions.cmake OPTIONAL)
if doing out-of-source build this will work fine. but if doing in-source builds it will include LocalUserOptions.cmake twice.
workaround: use include guard in LocalUserOptions.cmake
if(NOT LOCALUSEROPTIONS_INCLUDED) set(LOCALUSEROPTIONS_INCLUDED TRUE) #content ... endif(NOT LOCALUSEROPTIONS_INCLUDED)
fix suggestion: if binary dir and source dir are identical include only once
if(${VTK_BINARY_DIR} STREQUAL ${VTK_SOURCE_DIR}) INCLUDE(${VTK_BINARY_DIR}/LocalUserOptions.cmake OPTIONAL) else(${VTK_BINARY_DIR} STREQUAL ${VTK_SOURCE_DIR}) INCLUDE(${VTK_BINARY_DIR}/LocalUserOptions.cmake OPTIONAL) INCLUDE(${VTK_SOURCE_DIR}/LocalUserOptions.cmake OPTIONAL) endif(${VTK_BINARY_DIR} STREQUAL ${VTK_SOURCE_DIR})