Commit fcb9e453 authored by Ronan Trépos's avatar Ronan Trépos
Browse files

switch to vle 2.0

parent 4013ed9a
......@@ -40,17 +40,31 @@ endif ()
## Modules
##
INCLUDE(CheckIncludeFileCXX)
INCLUDE(CheckIncludeFile)
INCLUDE(CheckLibraryExists)
INCLUDE(CMakeDetermineCCompiler)
include(CheckIncludeFileCXX)
include(CheckIncludeFile)
include(CheckLibraryExists)
include(CMakeDetermineCCompiler)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
CHECK_CXX_COMPILER_FLAG("-std=c++1y" COMPILER_SUPPORTS_CXX1Y)
if (COMPILER_SUPPORTS_CXX14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
elseif(COMPILER_SUPPORTS_CXX1Y)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++14/1y support.
Please use a different C++ compiler.")
endif()
##
## Check VLE and package dependencies
##
set(VLE_DEBUG 0)
set(VLE_ABI_VERSION 1.3)
set(VLE_ABI_VERSION 2.0)
find_package(VLE REQUIRED)
set (VleUtils_DIR "${VLE_SHARE_DIR}/cmake")
find_package(VleUtils REQUIRED)
......
......@@ -12,6 +12,7 @@
#include <vector>
#include <vle/utils/DateTime.hpp>
#include <vle/utils/Tools.hpp>
#include <vle/DiscreteTime.hpp>
#include <ConduiteCulture.hpp>
#include <sunflo_utils.hpp>
......@@ -144,8 +145,10 @@ public :
} else if (events.exist("apport_irrig_1") && events.exist("date_irrig_1")){
for (unsigned int i=6; i!=0; i--) {
std::string event_apport((vle::fmt("apport_irrig_%1%") % i).str());
std::string event_date((vle::fmt("date_irrig_%1%") % i).str());
std::string event_apport(
vle::utils::format("apport_irrig_%i", i).c_str());
std::string event_date(
vle::utils::format("date_irrig_%i", i).c_str());
if (events.exist(event_apport) && events.exist(event_date)) {
lesApportsIrrigation[events.getString(event_date)] = events.getDouble(event_apport);
......@@ -168,8 +171,10 @@ public :
} else if (events.exist("apport_ferti_1") && events.exist("date_ferti_1")) {
for (unsigned int i=4; i!=0; i--) {
std::string event_apport((vle::fmt("apport_ferti_%1%") % i).str());
std::string event_date((vle::fmt("date_ferti_%1%") % i).str());
std::string event_apport(
vle::utils::format("apport_ferti_%i", i));
std::string event_date(
vle::utils::format("date_ferti_%i", i));
if (events.exist(event_apport) && events.exist(event_date)) {
lesApportsFertilisation[events.getString(event_date)] = events.getDouble(event_apport);
}
......
......@@ -12,6 +12,7 @@
#define SUNFLO_SUNFLO_UTILS_HPP
#include <string>
#include <sstream>
#include <vle/utils/DateTime.hpp>
#define VALEURDOUBLENONSIGNIFIANTE (-777.0)
......
......@@ -40,17 +40,31 @@ endif ()
## Modules
##
INCLUDE(CheckIncludeFileCXX)
INCLUDE(CheckIncludeFile)
INCLUDE(CheckLibraryExists)
INCLUDE(CMakeDetermineCCompiler)
include(CheckIncludeFileCXX)
include(CheckIncludeFile)
include(CheckLibraryExists)
include(CMakeDetermineCCompiler)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
CHECK_CXX_COMPILER_FLAG("-std=c++1y" COMPILER_SUPPORTS_CXX1Y)
if (COMPILER_SUPPORTS_CXX14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
elseif(COMPILER_SUPPORTS_CXX1Y)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++14/1y support.
Please use a different C++ compiler.")
endif()
##
## Check VLE and package dependencies
##
set(VLE_DEBUG 0)
set(VLE_ABI_VERSION 1.3)
set(VLE_ABI_VERSION 2.0)
find_package(VLE REQUIRED)
set (VleUtils_DIR "${VLE_SHARE_DIR}/cmake")
find_package(VleUtils REQUIRED)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment