[CMAKE]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 1 Nov 2010 15:15:02 +0000 (15:15 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 1 Nov 2010 15:15:02 +0000 (15:15 +0000)
When PreLoad.cmake is run, the CMAKE_CURRENT_SOURCE_DIR points to the directory, where the cmake command was executed (bug?). To get the root folder of reactos, use CMAKE_CURRENT_LIST_FILE, which points to PreLoad.cmake in the root folder.

svn path=/branches/cmake-bringup/; revision=49405

PreLoad.cmake

index 59de559..e74be69 100644 (file)
@@ -1,7 +1,10 @@
 \r
-#message("PreLoad.cmake ...")\r
+# small trick to get the real source directory at this stage\r
+STRING(REPLACE "/PreLoad.cmake" "" REACTOS_HOME_DIR ${CMAKE_CURRENT_LIST_FILE})\r
 \r
-SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules" CACHE INTERNAL "")\r
+#message("/PreLoad.cmake ... ${REACTOS_HOME_DIR}")\r
+\r
+SET(CMAKE_MODULE_PATH "${REACTOS_HOME_DIR}/cmake/Modules" CACHE INTERNAL "")\r
 \r
 #message("CMAKE_MODULE_PATH = ${CMAKE_MODULE_PATH}")\r
 \r