Index: trunk/Mars/CMakeLists.txt
===================================================================
--- trunk/Mars/CMakeLists.txt	(revision 19321)
+++ trunk/Mars/CMakeLists.txt	(revision 19324)
@@ -107,21 +107,21 @@
 # --------- ROOT -------------
 
-#IF(EXISTS "$ENV{ROOTSYS}/ROOTConfig.cmake")
-IF(DEFINED ENV{CMAKE_PREFIX_PATH}) # -- This is if compiled with cmake --
-   # You need to tell CMake where to find the ROOT installation. This can be done in a number of ways:
-   #   - ROOT built with classic configure/make use the provided $ROOTSYS/etc/cmake/FindROOT.cmake
-   #   - ROOT built with CMake. Add in CMAKE_PREFIX_PATH the installation prefix for ROOT
-   LIST(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
-   #---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
-   FIND_PACKAGE(ROOT REQUIRED COMPONENTS Gui Minuit ASImage HistPainter)
-   #---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
+# You need to tell CMake where to find the ROOT installation. This can be done in a number of ways:
+#   - ROOT built with classic configure/make use the provided $ROOTSYS/etc/cmake/FindROOT.cmake
+#   - ROOT built with CMake. Add in CMAKE_PREFIX_PATH the installation prefix for ROOT
+SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "$ENV{ROOTSYS}/etc/cmake")
+
+#---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
+FIND_PACKAGE(ROOT REQUIRED COMPONENTS Gui Minuit ASImage HistPainter)
+
+IF(NOT DEFINED ROOT_CONFIG_EXECUTABLE)
+   FIND_PACKAGE_MESSAGE(RootFound "Found ROOT: ${ROOT_INCLUDE_DIRS}" "[${ROOT_INCLUDE_DIRS}][${ROOT_LIBRARY_DIR}]")
+ENDIF()
+
+#---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
+IF(DEFINED ROOT_USE_FILE)
+   FIND_PACKAGE_MESSAGE(RootInclude "Setup ROOT: ${ROOT_USE_FILE}" "[${ROOT_USE_FILE}]")
    INCLUDE(${ROOT_USE_FILE})
 ELSE()
-   # You need to tell CMake where to find the ROOT installation. This can be done in a number of ways:
-   #   - ROOT built with classic configure/make use the provided $ROOTSYS/etc/cmake/FindROOT.cmake
-   #   - ROOT built with CMake. Add in CMAKE_PREFIX_PATH the installation prefix for ROOT
-   SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "$ENV{ROOTSYS}/etc/cmake")
-   #---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
-   FIND_PACKAGE(ROOT REQUIRED COMPONENTS Gui Minuit ASImage HistPainter)
    # From RootUseFile.cmake (root 6)
    INCLUDE_DIRECTORIES(${ROOT_INCLUDE_DIRS})
@@ -132,9 +132,4 @@
    SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${ROOT_fortran_FLAGS}")
 ENDIF()
-
-IF(NOT DEFINED ROOT_CONFIG_EXECUTABLE)
-   FIND_PACKAGE_MESSAGE(RootInc "Found ROOT: ${ROOT_INCLUDE_DIRS}" "[${ROOT_INCLUDE_DIRS}][${ROOT_LIBRARY_DIR}]")
-ENDIF()
-
 
 # -lGui -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree
