Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
try to compile mpi.mod even if the config was run previously
[simgrid.git] / CMakeLists.txt
index d2a9568..d930151 100644 (file)
@@ -81,7 +81,8 @@ if ((NOT DEFINED enable_smpi) OR enable_smpi)
       set(SMPI_FLANG 1)
     endif()
 
-    set(SMPI_FORTRAN 1)
+    set(SMPI_FORTRAN 1 CACHE BOOL "Whether SMPI Fortran code can be compiled")
+    mark_as_advanced(SMPI_FORTRAN)
   endif(CMAKE_Fortran_COMPILER)
 
 endif()
@@ -285,8 +286,6 @@ endif()
 
 # Checks for header libraries functions.
 CHECK_LIBRARY_EXISTS(rt      clock_gettime           "" HAVE_POSIX_GETTIME)
-
-set(HAVE_PTHREAD_SETAFFINITY 0)
 CHECK_LIBRARY_EXISTS(pthread pthread_setaffinity_np  "" HAVE_PTHREAD_SETAFFINITY)
 
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
@@ -515,8 +514,10 @@ endif()
 
 # Avoid triggering a (full) rebuild by touching the files if they did not really change
 configure_file("${CMAKE_HOME_DIRECTORY}/src/internal_config.h.in"    "${CMAKE_BINARY_DIR}/src/internal_config.h.generated"    @ONLY IMMEDIATE)
+configure_file("${CMAKE_HOME_DIRECTORY}/src/simgrid/version.h.in"    "${CMAKE_BINARY_DIR}/src/simgrid/version.h.generated" @ONLY IMMEDIATE)
 configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid/config.h.in" "${CMAKE_BINARY_DIR}/include/simgrid/config.h.generated" @ONLY IMMEDIATE)
 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/src/internal_config.h.generated ${CMAKE_BINARY_DIR}/src/internal_config.h)
+execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/src/simgrid/version.h.generated ${CMAKE_BINARY_DIR}/src/simgrid/version.h)
 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/simgrid/config.h.generated ${CMAKE_BINARY_DIR}/include/simgrid/config.h)
 file(REMOVE ${CMAKE_BINARY_DIR}/src/internal_config.h.generated)
 file(REMOVE ${CMAKE_BINARY_DIR}/include/simgrid/config.h.generated)
@@ -768,7 +769,6 @@ if(enable_java)
 endif()
 
 # Python binding, generated with pybind11
-set(PYBIND11_CPP_STANDARD -std=c++11)
 find_package(pybind11 2.2.0)
 if(NOT PYTHONLIBS_FOUND)
   set(pybind11_FOUND OFF)
@@ -783,7 +783,7 @@ endif()
 if(enable_python)
   if(pybind11_FOUND)
     pybind11_add_module(python-bindings src/bindings/python/simgrid_python.cpp)
-    set_source_files_properties(src/bindings/python/simgrid_python.cpp PROPERTIES COMPILE_FLAGS -std=c++14)
+    target_compile_features(python-bindings PRIVATE cxx_std_14)
     target_link_libraries(python-bindings PUBLIC simgrid)
     set_target_properties(python-bindings PROPERTIES LIBRARY_OUTPUT_NAME simgrid)
     set_property(TARGET python-bindings