Index: trunk/Mars/CMakeLists.txt
===================================================================
--- trunk/Mars/CMakeLists.txt	(revision 19755)
+++ trunk/Mars/CMakeLists.txt	(revision 19756)
@@ -129,16 +129,16 @@
 
 #---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
+#SET(ROOT_CONFIG_DEBUG 1)
 FIND_PACKAGE(ROOT REQUIRED COMPONENTS ${ROOT_PACKAGES})
 
 IF(NOT DEFINED ROOT_CONFIG_EXECUTABLE)
-   FIND_PACKAGE_MESSAGE(RootFound "Found ROOT: ${ROOT_INCLUDE_DIRS} [${ROOT_VERSION}]" "[${ROOT_INCLUDE_DIRS}][${ROOT_LIBRARY_DIR}][${ROOT_VERSION}]")
+   FIND_PACKAGE_MESSAGE(RootFound "Found ROOT: ${ROOT_INCLUDE_DIRS}" "[${ROOT_INCLUDE_DIRS}][${ROOT_LIBRARY_DIR}][${ROOT_VERSION}]")
 ENDIF()
 
 #---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
+FIND_PACKAGE_MESSAGE(RootInclude "Setup ROOT: [${ROOT_VERSION}] ${ROOT_USE_FILE}" "[${ROOT_VERSION}][${ROOT_USE_FILE}]")
 IF(DEFINED ROOT_USE_FILE)
-   FIND_PACKAGE_MESSAGE(RootInclude "Setup ROOT: ${ROOT_USE_FILE}" "[${ROOT_USE_FILE}]")
    INCLUDE(${ROOT_USE_FILE})
 ELSE()
-   FIND_PACKAGE_MESSAGE(RootInclude "Setup ROOT: ${ROOT_VERSION}" "[${ROOT_VERSION}]")
    # From RootUseFile.cmake (root 6)
    INCLUDE_DIRECTORIES(${ROOT_INCLUDE_DIRS})
@@ -149,4 +149,5 @@
    SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${ROOT_fortran_FLAGS}")
 ENDIF()
+
 
 # -lGui -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree
@@ -240,4 +241,15 @@
 
         INSTALL(DIRECTORY ${subdir}/ DESTINATION "include" FILES_MATCHING PATTERN "*.h")
+
+        # This is a hack if somebody tries to run root from
+        # the compile directory rather than from a package
+        # install directory. In this case, the pcm files
+        # are not where the library is where they should be
+    	ADD_CUSTOM_COMMAND(
+            OUTPUT  lib/${_CINT}_rdict.pcm
+            COMMAND ln -s ../dictionary/${_CINT}_rdict.pcm ${_CINT}_rdict.pcm
+            WORKING_DIRECTORY lib
+        VERBATIM)
+   	ADD_CUSTOM_TARGET(${_CINT}.p ALL DEPENDS lib/${_CINT}_rdict.pcm)
 
 ENDMACRO()
@@ -309,4 +321,16 @@
 SET_SOURCE_FILES_PROPERTIES(dictionary/Core.cxx PROPERTIES COMPILE_FLAGS "-Wno-deprecated-register")
 
+# This is a hack if somebody tries to run root from
+# the compile directory rather than from a package
+# install directory. In this case, the pcm files
+# are not where the library is where they should be
+ADD_CUSTOM_COMMAND(
+    OUTPUT  lib/Core_rdict.pcm
+    COMMAND ln -s ../dictionary/Core_rdict.pcm Core_rdict.pcm
+    WORKING_DIRECTORY lib
+VERBATIM)
+ADD_CUSTOM_TARGET(Core.p ALL DEPENDS lib/Core_rdict.pcm)
+
+
 TARGET_LINK_LIBRARIES(mars
         ZLIB::ZLIB
