Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't need this variable now.
[simgrid.git] / buildtools / Cmake / CompleteInFiles.cmake
index 31e0860..a43c745 100644 (file)
@@ -87,14 +87,12 @@ if(enable_lua)
                SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${LUA_INCLUDE_DIR} ")
                foreach(path_lua ${LUA_LIBRARIES})
                string(REGEX REPLACE "liblua.*" "" path_lua_to_use ${path_lua})
-               string(REGEX MATCH "-L${path_lua_to_use}" operation "${CMAKE_EXE_LINKER_FLAGS}")
-               string(REGEX MATCH ".*lua.*" operation2 "${path_lua}")
-               if(NOT operation AND operation2)
+               string(REGEX MATCH ".*lua.*" operation "${path_lua}")
+               if(NOT operation)
                        string(REGEX REPLACE "${path_lua_to_use}" "" liblua ${path_lua})
                        string(REPLACE "lib" "" liblua "${liblua}")
                        string(REGEX REPLACE "[.][^.]*$" "" liblua "${liblua}")                 
-                       SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}-L${path_lua_to_use} ")
-               endif(NOT operation AND operation2)
+               endif(NOT operation)
                endforeach(path_lua ${LUA_LIBRARIES})
        else(LUA51_FOUND)
                message("Lua binding need version 5.1 and cmake version 2.8")
@@ -112,7 +110,6 @@ if(enable_ruby)
                                set(RUBY_LIBRARY_NAME ruby)
                        endif(NOT RUBY_LIBRARY_NAME)
                        string(REGEX REPLACE "/libruby.*$" "" RUBY_LIBRARY ${RUBY_LIBRARY})
-                       SET(CMAKE_EXE_LINKER_FLAGS "-L${RUBY_LIBRARY} ")
                        SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${RUBY_CONFIG_INCLUDE_DIR} ") #path to config.h
                        string(COMPARE EQUAL "${RUBY_INCLUDE_DIR}" "${RUBY_CONFIG_INCLUDE_DIR}" operation)
                        if(NOT operation)
@@ -166,11 +163,12 @@ else(NOT enable_gtnets OR enable_supernovae)
                SET(HAVE_GTNETS 0)
        else(COMPILE_GTNETS_VAR)
                SET(HAVE_GTNETS 1)
-               SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}${GTNETS_CPPFLAGS} ")
-               SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}${GTNETS_CPPFLAGS} ")
-               string(REGEX MATCH "${GTNETS_LDFLAGS}" operation "${CMAKE_EXE_LINKER_FLAGS}")
+               SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}${GTNETS_CPPFLAGS} ${GTNETS_LDFLAGS} ")
+               SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}${GTNETS_CPPFLAGS} ${GTNETS_LDFLAGS} ")
+               string(REGEX MATCH "${gtnets_path}/lib" operation "$ENV{LD_LIBRARY_PATH}")
                if(NOT operation)
-               SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}${GTNETS_LDFLAGS} ")
+                       message("Don't forget to set LD_LIBRARY_PATH")
+                       message("export LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${gtnets_path}/lib")
                endif(NOT operation)
        endif(COMPILE_GTNETS_VAR)
 endif(NOT enable_gtnets OR enable_supernovae)
@@ -183,12 +181,7 @@ mark_as_advanced(HAVE_CGRAPH_H)
 if(HAVE_CGRAPH_LIB AND HAVE_CGRAPH_H)
        string(REGEX REPLACE "/libcgraph.*" "" lib_cgraph ${HAVE_CGRAPH_LIB})
        string(REPLACE "/cgraph.h" "" file_cgraph_h ${HAVE_CGRAPH_H})
-       
-       string(REGEX MATCH "-L${lib_cgraph} " operation "${CMAKE_EXE_LINKER_FLAGS}")
-       if(NOT operation)
-               SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}-L${lib_cgraph} ")
-       endif(NOT operation)
-       
+               
        string(REGEX MATCH "-I${file_cgraph_h} " operation "${CMAKE_C_FLAGS}")
        if(NOT operation)
                SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${file_cgraph_h} ")
@@ -722,6 +715,8 @@ set(CMAKE_LINKARGS "${CMAKE_CURRENT_BINARY_DIR}/lib")
 
 configure_file(${PROJECT_DIRECTORY}/src/smpi/smpicc.in ${CMAKE_CURRENT_BINARY_DIR}/bin/smpicc @ONLY)
 configure_file(${PROJECT_DIRECTORY}/src/smpi/smpirun.in ${CMAKE_CURRENT_BINARY_DIR}/bin/smpirun @ONLY)
+configure_file(${PROJECT_DIRECTORY}/examples/smpi/hostfile ${CMAKE_CURRENT_BINARY_DIR}/examples/smpi/hostfile COPYONLY)
+configure_file(${PROJECT_DIRECTORY}/examples/msg/small_platform.xml ${CMAKE_CURRENT_BINARY_DIR}/examples/msg/small_platform.xml COPYONLY)
 
 exec_program("chmod a=rwx ${CMAKE_CURRENT_BINARY_DIR}/bin/smpicc" OUTPUT_VARIABLE OKITOKI)
 exec_program("chmod a=rwx ${CMAKE_CURRENT_BINARY_DIR}/bin/smpirun" OUTPUT_VARIABLE OKITOKI)