Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Patch for debian.
[simgrid.git] / buildtools / Cmake / src / CMakeDistrib.txt
index 2a70d52..b39f195 100644 (file)
@@ -56,21 +56,21 @@ string(REPLACE "./" "${prefix}/" uninstall_HEADERS "${install_HEADERS}")
 string(REPLACE "/usr/lib/ruby" "" install_link_ruby "${RUBY_INCLUDE_PATH}")
 
 add_custom_target(install-simgrid
-COMMAND mkdir -p ${prefix}
-COMMAND mkdir -p ${prefix}/bin
-COMMAND mkdir -p ${prefix}/lib
-COMMAND mkdir -p ${prefix}/include
-COMMAND mkdir -p ${prefix}/doc
-COMMAND mkdir -p ${prefix}/doc/simgrid
-COMMAND mkdir -p ${prefix}/doc/simgrid/html
-COMMAND cp ${install_bins} ${prefix}/bin
-COMMAND cp ${PROJECT_DIRECTORY}/tools/MSG_visualization/colorize.pl ${prefix}/bin/simgrid_colorizer.pl
+COMMAND mkdir -p $ENV{DESTDIR}${prefix}
+COMMAND mkdir -p $ENV{DESTDIR}${prefix}/bin
+COMMAND mkdir -p $ENV{DESTDIR}${prefix}/lib
+COMMAND mkdir -p $ENV{DESTDIR}${prefix}/include
+COMMAND mkdir -p $ENV{DESTDIR}${prefix}/doc
+COMMAND mkdir -p $ENV{DESTDIR}${prefix}/doc/simgrid
+COMMAND mkdir -p $ENV{DESTDIR}${prefix}/doc/simgrid/html
+COMMAND cp ${install_bins} $ENV{DESTDIR}${prefix}/bin
+COMMAND cp ${PROJECT_DIRECTORY}/tools/MSG_visualization/colorize.pl $ENV{DESTDIR}${prefix}/bin/simgrid_colorizer.pl
 COMMAND echo "install bin ok"
-COMMAND cp ${install_libs} ${prefix}/lib
+COMMAND cp ${install_libs} $ENV{DESTDIR}${prefix}/lib
 COMMAND echo "install lib ok"
-COMMAND cp --parent ${install_HEADERS} ${prefix}
+COMMAND cp --parent ${install_HEADERS} $ENV{DESTDIR}${prefix}
 COMMAND echo "install include ok"
-COMMAND cp -rf ${PROJECT_DIRECTORY}/doc/html/ ${prefix}/doc/simgrid
+COMMAND cp -rf ${PROJECT_DIRECTORY}/doc/html/ $ENV{DESTDIR}${prefix}/doc/simgrid
 COMMAND echo "install doc ok"
 WORKING_DIRECTORY "${PROJECT_DIRECTORY}/"
 )
@@ -93,8 +93,8 @@ WORKING_DIRECTORY "${prefix}"
 if(HAVE_JAVA)
        add_custom_command(TARGET install-simgrid
        COMMAND echo "install binding java"
-       COMMAND mkdir --parent ${prefix}/share/
-       COMMAND cp ${PROJECT_DIRECTORY}/src/simgrid.jar ${prefix}/share/simgrid.jar
+       COMMAND mkdir --parent $ENV{DESTDIR}${prefix}/share/
+       COMMAND cp ${PROJECT_DIRECTORY}/src/simgrid.jar $ENV{DESTDIR}${prefix}/share/simgrid.jar
        WORKING_DIRECTORY "${PROJECT_DIRECTORY}/"
        )
        add_custom_command(TARGET uninstall
@@ -107,8 +107,8 @@ endif(HAVE_JAVA)
 if(HAVE_LUA)
        add_custom_command(TARGET install-simgrid
        COMMAND echo "install binding lua"
-       COMMAND mkdir --parent ${prefix}/lib/lua/5.1/
-       COMMAND ln -sf ${prefix}/lib/libsimgrid.so ${prefix}/lib/lua/5.1/simgrid.so
+       COMMAND mkdir --parent $ENV{DESTDIR}${prefix}/lib/lua/5.1/
+       COMMAND ln -sf ${prefix}/lib/libsimgrid.so $ENV{DESTDIR}${prefix}/lib/lua/5.1/simgrid.so
        WORKING_DIRECTORY "${PROJECT_DIRECTORY}/"
        )
        add_custom_command(TARGET uninstall
@@ -121,15 +121,15 @@ endif(HAVE_LUA)
 if(HAVE_RUBY)
        add_custom_command(TARGET install-simgrid
        COMMAND echo "install binding ruby"
-       COMMAND mkdir --parent ${prefix}/lib/site_ruby${install_link_ruby}/
-       COMMAND ln -sf ${prefix}/lib/libsimgrid.so ${prefix}/lib/site_ruby${install_link_ruby}/libsimgrid.so
-       COMMAND cp ${PROJECT_DIRECTORY}/src/bindings/ruby/simgrid.rb ${prefix}/lib/site_ruby${install_link_ruby}/simgrid.rb
+       COMMAND mkdir --parent $ENV{DESTDIR}${prefix}/lib/ruby${install_link_ruby}/
+       COMMAND ln -sf ${prefix}/lib/libsimgrid.so $ENV{DESTDIR}${prefix}/lib/ruby${install_link_ruby}/libsimgrid.so
+       COMMAND cp ${PROJECT_DIRECTORY}/src/bindings/ruby/simgrid.rb $ENV{DESTDIR}${prefix}/lib/ruby${install_link_ruby}/simgrid.rb
        WORKING_DIRECTORY "${PROJECT_DIRECTORY}/"
        )
        add_custom_command(TARGET uninstall
        COMMAND echo "uninstall binding ruby"
-       COMMAND rm ${prefix}/lib/site_ruby${install_link_ruby}/libsimgrid.so
-       COMMAND rm ${prefix}/lib/site_ruby${install_link_ruby}/simgrid.rb
+       COMMAND rm ${prefix}/lib/ruby${install_link_ruby}/libsimgrid.so
+       COMMAND rm ${prefix}/lib/ruby${install_link_ruby}/simgrid.rb
        WORKING_DIRECTORY "${PROJECT_DIRECTORY}/"
        )
 endif(HAVE_RUBY)