From 4cea7e80ac43337717dceee68d000c185aebb848 Mon Sep 17 00:00:00 2001
From: Kasper Marstal <kaspermarstal@gmail.com>
Date: Tue, 22 Sep 2015 14:09:54 +0200
Subject: [PATCH] COMP: ELASTIX-15 Added CMake scripts folder to
 CMAKE_MODULE_PATH #comment #resolve

---
 CMake/elxWinConfig.cmake | 8 +++++---
 CMakeLists.txt           | 3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/CMake/elxWinConfig.cmake b/CMake/elxWinConfig.cmake
index 6e240833..6f83da4f 100644
--- a/CMake/elxWinConfig.cmake
+++ b/CMake/elxWinConfig.cmake
@@ -5,7 +5,8 @@ if( MSVC )
   if( n GREATER 50 )
   message(
     FATAL_ERROR
-    "ITK source code directory path length is too long for MSVC (${n} > 50)."
+      "Source code directory path length is too long for MSVC (${n} > 50)."
+      "Please move the source code directory to a directory with a shorter path."
     )
   endif()
 
@@ -13,11 +14,12 @@ if( MSVC )
   if( n GREATER 50 )
   message(
     FATAL_ERROR
-    "ITK build directory path length is too long for MSVC (${n} > 50)."
+      "Build directory path length is too long for MSVC (${n} > 50)."
+      "Please move the build directory to a directory with a shorter path."
     )
   endif()
 
   set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj" )
   set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /bigobj" )
   set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /bigobj" )
-endif()
+endif()
\ No newline at end of file
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e07eb5ed..96e2f9c8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,8 +8,9 @@ set( MSVC_INCREMENTAL_DEFAULT ON )
 project( Elastix )
 
 # Include SuperElastix CMake scripts
-list( APPEND CMAKE_MODULE_PATH
+set( CMAKE_MODULE_PATH
   "${CMAKE_CURRENT_SOURCE_DIR}/CMake" 
+  ${CMAKE_MODULE_PATH}
 )
 
 if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC" )
-- 
GitLab