If defined, the installation will use CMAKE_INSTALL_PREFIX, if not it will default to ALICE_INSTALL.
If ALICE_INSTALL is not defined it will default to the source directory ALICE_ROOT
if(${ALICE_INSTALL} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "Install dir should be different from build dir")
endif()
-set(CMAKE_INSTALL_PREFIX ${ALICE_INSTALL})
+
+# If CMAKE_INSTALL_PREFIX was not set than we set it to ALICE_INSTALL.
+# If ALICE_INSTALL was not defined than it will default to source directory
+if(NOT CMAKE_INSTALL_PREFIX)
+ set(CMAKE_INSTALL_PREFIX ${ALICE_INSTALL})
+endif()
# Environment for SHUTTLE
set(DIMDIR $ENV{DIMDIR})