Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't remove files from svn sources.
[simgrid.git] / buildtools / Cmake / CompleteInFiles.cmake
index 9683bdb..df02155 100644 (file)
@@ -31,11 +31,11 @@ if(enable_lua)
 endif(enable_lua)
 
 # Checks for header libraries functions.
-CHECK_LIBRARY_EXISTS(pthread   pthread_create          NO_DEFAULT_PATHS pthread)
-CHECK_LIBRARY_EXISTS(pthread   sem_init                NO_DEFAULT_PATHS HAVE_SEM_INIT_LIB)
-CHECK_LIBRARY_EXISTS(pthread   sem_timedwait           NO_DEFAULT_PATHS HAVE_SEM_TIMEDWAIT_LIB)
-CHECK_LIBRARY_EXISTS(pthread   pthread_mutex_timedlock NO_DEFAULT_PATHS HAVE_MUTEX_TIMEDLOCK_LIB)
-CHECK_LIBRARY_EXISTS(rt        clock_gettime           NO_DEFAULT_PATHS HAVE_POSIX_GETTIME)
+CHECK_LIBRARY_EXISTS(pthread   pthread_create                  "" pthread)
+CHECK_LIBRARY_EXISTS(pthread   sem_init                                "" HAVE_SEM_INIT_LIB)
+CHECK_LIBRARY_EXISTS(pthread   sem_timedwait                   "" HAVE_SEM_TIMEDWAIT_LIB)
+CHECK_LIBRARY_EXISTS(pthread   pthread_mutex_timedlock "" HAVE_MUTEX_TIMEDLOCK_LIB)
+CHECK_LIBRARY_EXISTS(rt                clock_gettime                   "" HAVE_POSIX_GETTIME)
 
 CHECK_INCLUDE_FILES("time.h;sys/time.h" TIME_WITH_SYS_TIME)
 CHECK_INCLUDE_FILES("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)
@@ -638,13 +638,11 @@ set(libdir ${exec_prefix}/lib)
 set(CMAKE_LINKARGS "${CMAKE_CURRENT_BINARY_DIR}/lib")
 set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=${CMAKE_CURRENT_BINARY_DIR}/lib:${GTNETS_LIB_PATH}:$LD_LIBRARY_PATH")
 
+configure_file(${CMAKE_HOME_DIRECTORY}/include/smpi/smpif.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/smpi/smpif.h @ONLY)
 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpicc.in ${CMAKE_CURRENT_BINARY_DIR}/bin/smpicc @ONLY)
 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpif2c.in ${CMAKE_CURRENT_BINARY_DIR}/bin/smpif2c @ONLY)
 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpiff.in ${CMAKE_CURRENT_BINARY_DIR}/bin/smpiff @ONLY)
 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpirun.in ${CMAKE_CURRENT_BINARY_DIR}/bin/smpirun @ONLY)
-configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/hostfile ${CMAKE_CURRENT_BINARY_DIR}/examples/smpi/hostfile COPYONLY)
-configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/small_platform.xml ${CMAKE_CURRENT_BINARY_DIR}/examples/msg/small_platform.xml COPYONLY)
-configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/small_platform_with_routers.xml ${CMAKE_CURRENT_BINARY_DIR}/examples/msg/small_platform_with_routers.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/smpif2c" OUTPUT_VARIABLE OKITOKI)
@@ -661,11 +659,22 @@ ${CMAKE_CURRENT_BINARY_DIR}/bin/smpiff
 ${CMAKE_CURRENT_BINARY_DIR}/bin/smpirun
 ${CMAKE_CURRENT_BINARY_DIR}/bin/colorize
 ${CMAKE_CURRENT_BINARY_DIR}/bin/simgrid_update_xml
-${CMAKE_CURRENT_BINARY_DIR}/examples/smpi/hostfile
 ${CMAKE_CURRENT_BINARY_DIR}/examples/smpi/smpi_traced.trace
-${CMAKE_CURRENT_BINARY_DIR}/examples/msg/small_platform.xml
-${CMAKE_CURRENT_BINARY_DIR}/examples/msg/small_platform_with_routers.xml
 )
 
+if("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_HOME_DIRECTORY}")
+else("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_HOME_DIRECTORY}")
+       configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/hostfile ${CMAKE_CURRENT_BINARY_DIR}/examples/smpi/hostfile COPYONLY)
+       configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/small_platform.xml ${CMAKE_CURRENT_BINARY_DIR}/examples/msg/small_platform.xml COPYONLY)
+       configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/small_platform_with_routers.xml ${CMAKE_CURRENT_BINARY_DIR}/examples/msg/small_platform_with_routers.xml COPYONLY)
+       
+       set(generate_files_to_clean
+               ${generate_files_to_clean}
+               ${CMAKE_CURRENT_BINARY_DIR}/examples/smpi/hostfile
+               ${CMAKE_CURRENT_BINARY_DIR}/examples/msg/small_platform.xml
+               ${CMAKE_CURRENT_BINARY_DIR}/examples/msg/small_platform_with_routers.xml
+               )
+endif("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_HOME_DIRECTORY}")
+
 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
-"${generate_files_to_clean}")
\ No newline at end of file
+"${generate_files_to_clean}")