diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2ee897922e654c5241b30e00302150149528a9c4..64c6ac8cddd2f6809e79c5dac610df1a0c9a6c7c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -86,7 +86,7 @@ install(DIRECTORY ${MOOSE_EXAMPLE_DIR}/
     )
 
 # Copy the command to launch moose.
-file(COPY ${CMAKE_SOURCE_DIR}/moose DESTINATION ${CMAKE_BINARY_DIR})
+configure_file(${CMAKE_SOURCE_DIR}/cmake/moose.in ${CMAKE_BINARY_DIR}/moose)
 
 install(PROGRAMS ${CMAKE_BINARY_DIR}/moose DESTINATION bin)