Minor fixes for MSVC
This commit is contained in:
@@ -46,6 +46,13 @@ FILE(GLOB SOURCES
|
||||
)
|
||||
|
||||
|
||||
if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
|
||||
add_definitions(
|
||||
-D_USE_MATH_DEFINES
|
||||
-DUNICODE
|
||||
-D_UNICODE
|
||||
)
|
||||
else()
|
||||
# system specific compiler flags
|
||||
ADD_DEFINITIONS(
|
||||
|
||||
@@ -61,14 +68,15 @@ ADD_DEFINITIONS(
|
||||
-g3
|
||||
#-O2
|
||||
-march=native
|
||||
)
|
||||
endif()
|
||||
|
||||
-DWITH_TESTS
|
||||
add_definitions(
|
||||
# -DWITH_TESTS
|
||||
-DWITH_ASSERTIONS
|
||||
# -DWITH_DEBUG_LOG
|
||||
# -DWITH_DEBUG_PLOT
|
||||
# -D_GLIBCXX_DEBUG
|
||||
|
||||
|
||||
)
|
||||
|
||||
# allow OMP
|
||||
@@ -89,8 +97,8 @@ ADD_EXECUTABLE(
|
||||
# needed external libraries
|
||||
TARGET_LINK_LIBRARIES(
|
||||
${PROJECT_NAME}
|
||||
gtest
|
||||
pthread
|
||||
# gtest
|
||||
# pthread
|
||||
)
|
||||
|
||||
SET(CMAKE_C_COMPILER ${CMAKE_CXX_COMPILER})
|
||||
|
||||
21
main.cpp
21
main.cpp
@@ -1,4 +1,4 @@
|
||||
#include "main.h"
|
||||
//#include "main.h"
|
||||
|
||||
#include "navMesh/mesh.h"
|
||||
#include "navMesh/filter.h"
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
#include <thread>
|
||||
#include <experimental/filesystem>
|
||||
|
||||
#include <Indoor/floorplan/v2/FloorplanReader.h>
|
||||
#include <Indoor/sensors/radio/model/WiFiModelLogDistCeiling.h>
|
||||
@@ -24,7 +25,6 @@
|
||||
|
||||
#include <Indoor/smc/filtering/resampling/ParticleFilterResamplingSimpleImpoverishment.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
Stats::Statistics<float> run(Settings::DataSetup setup, int numFile, std::string folder) {
|
||||
|
||||
@@ -42,16 +42,15 @@ Stats::Statistics<float> run(Settings::DataSetup setup, int numFile, std::string
|
||||
|
||||
// error file
|
||||
const long int t = static_cast<long int>(time(NULL));
|
||||
const std::string evalDir = Settings::errorDir + folder;
|
||||
struct stat statStruct;
|
||||
stat(evalDir.c_str(), &statStruct);
|
||||
if(!S_ISDIR(statStruct.st_mode)){
|
||||
if(mkdir(evalDir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) == -1){
|
||||
Assert::doThrow("Eval folder couldn't be created!");
|
||||
}
|
||||
auto evalDir = std::experimental::filesystem::path(Settings::errorDir);
|
||||
evalDir.append(folder);
|
||||
|
||||
if (!std::experimental::filesystem::exists(evalDir)) {
|
||||
std::experimental::filesystem::create_directory(evalDir);
|
||||
}
|
||||
|
||||
std::ofstream errorFile;
|
||||
errorFile.open (evalDir + "/" + std::to_string(numFile) + "_" + std::to_string(t) + ".csv");
|
||||
errorFile.open (evalDir.string() + "/" + std::to_string(numFile) + "_" + std::to_string(t) + ".csv");
|
||||
|
||||
|
||||
// wifi
|
||||
@@ -219,7 +218,7 @@ Stats::Statistics<float> run(Settings::DataSetup setup, int numFile, std::string
|
||||
|
||||
if(ts.ms() == 13410 || ts.ms() == 20802){
|
||||
std::ofstream plotFile;
|
||||
plotFile.open(evalDir + "/" + std::to_string(numFile) + "_" + std::to_string(t) + "_plot_zwischendrin_" + std::to_string(ts.ms()) + ".gp");
|
||||
plotFile.open(evalDir.string() + "/" + std::to_string(numFile) + "_" + std::to_string(t) + "_plot_zwischendrin_" + std::to_string(ts.ms()) + ".gp");
|
||||
plot.saveToFile(plotFile);
|
||||
plotFile.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user