Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Close file after use.
[simgrid.git] / CMakeLists.txt
index f3e237c..a628c91 100644 (file)
@@ -1,11 +1,9 @@
 # Build the version number
 
 set(SIMGRID_VERSION_MAJOR "3")
-set(SIMGRID_VERSION_MINOR "24")
+set(SIMGRID_VERSION_MINOR "25")
 set(SIMGRID_VERSION_PATCH "1") # odd => git branch; even => stable release or released snapshot
 
-set(SIMGRID_VERSION_DATE  "2019") # Year for copyright information
-
 if(${SIMGRID_VERSION_PATCH} EQUAL "0")
   set(release_version "${SIMGRID_VERSION_MAJOR}.${SIMGRID_VERSION_MINOR}")
 else()
@@ -21,10 +19,17 @@ set(libsimgrid-java_version "${release_version}")
 
 # Basic checks on cmake
 cmake_minimum_required(VERSION 3.5)
+#for lto, to avoid warning (should be removed when switching to requiring cmake >= 3.9)
+if(NOT CMAKE_VERSION VERSION_LESS "3.9")
+  cmake_policy(SET CMP0069 NEW)
+endif()
 message(STATUS "Cmake version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}")
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_HOME_DIRECTORY}/tools/cmake/Modules)
 
-project(SimGrid C CXX)
+project(simgrid C CXX)
+
+# customizable installation directories
+include(GNUInstallDirs)
 
 ## Save compiler flags preset with environment variables CFLAGS or CXXFLAGS;
 ## they will used within smpicc, smpicxx.
@@ -232,7 +237,7 @@ if(enable_ns3)
 endif()
 
 set(SIMGRID_HAVE_MSG 0)
-if(enable_MSG)
+if(enable_msg)
   set(SIMGRID_HAVE_MSG 1)
 endif()
 
@@ -412,8 +417,8 @@ endif()
 mark_as_advanced(PATH_LIBDW_H)
 mark_as_advanced(PATH_LIBDW_LIB)
 
-if(enable_java AND NOT enable_MSG)
-  message(FATAL_ERROR "Cannot activate the Java bindings without the MSG module. Either add -Denable_MSG=ON or -Denable_java=OFF")
+if(enable_java AND NOT enable_msg)
+  message(FATAL_ERROR "Cannot activate the Java bindings without the MSG module. Either add -Denable_msg=ON or -Denable_java=OFF")
 endif()
 
 if (enable_model-checking AND enable_ns3)
@@ -548,10 +553,10 @@ file(READ ${CMAKE_HOME_DIRECTORY}/src/smpi/smpitools.sh SMPITOOLS_SH) # Definiti
 
 ### SMPI script used when simgrid is installed
 set(exec_prefix ${CMAKE_INSTALL_PREFIX})
-set(includeflag "-I${CMAKE_INSTALL_PREFIX}/include -I${CMAKE_INSTALL_PREFIX}/include/smpi")
-set(includedir "${CMAKE_INSTALL_PREFIX}/include")
-set(libdir ${exec_prefix}/lib)
-set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=\"${CMAKE_INSTALL_PREFIX}/lib")
+set(includeflag "-I${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR} -I${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/smpi")
+set(includedir "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
+set(libdir "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
+set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=\"${CMAKE_INSTALL_LIBDIR}")
 if(NS3_LIBRARY_PATH)
   set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${NS3_LIBRARY_PATH}")
 endif()