improved build instructions

This commit is contained in:
Martin Brodbeck 2019-10-11 10:01:21 +02:00
parent f37cd75502
commit b9d4375f5a
5 changed files with 18 additions and 14 deletions

View file

@ -3,6 +3,11 @@ set(Boost_USE_STATIC_LIBS ON)
find_package(Boost 1.62 COMPONENTS date_time REQUIRED)
find_package(SQLite3 REQUIRED)
# Because csv-parser needs threads:
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
if (MINGW)
find_package(XLNT REQUIRED STATIC)
else (MINGW)
@ -27,13 +32,12 @@ set(CORE_SOURCES
add_library(core STATIC ${CORE_SOURCES})
target_include_directories(core PRIVATE ${PROJECT_SOURCE_DIR}/3rdparty/csv-parser/include)
target_include_directories(core PRIVATE ${PROJECT_SOURCE_DIR}/subprojects/csv-parser/single_include)
if (WIN32)
target_link_libraries(core PRIVATE Boost::boost Boost::date_time sqlite3 nlohmann_json::nlohmann_json ${XLNT_LIBRARY} csv)
target_link_libraries(core PRIVATE Boost::boost Boost::date_time sqlite3 nlohmann_json::nlohmann_json ${XLNT_LIBRARY} Threads::Threads)
target_link_libraries(core PRIVATE bcrypt)
else()
target_link_libraries(core PRIVATE Boost::boost Boost::date_time sqlite3 nlohmann_json::nlohmann_json ${XLNT_LIBRARIES} csv)
target_link_libraries(core PRIVATE Boost::boost Boost::date_time sqlite3 nlohmann_json::nlohmann_json ${XLNT_LIBRARIES} Threads::Threads)
endif()
#target_include_directories(core PRIVATE ${PROJECT_SOURCE_DIR}/3rdparty/csv-parser)
target_include_directories(core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)

View file

@ -2,8 +2,8 @@
#include "utils.h"
#include <fstream>
#include "../../subprojects/csv-parser/single_include/csv.hpp"
//#include <csv.hpp>
#include <csv.hpp>
namespace fs = std::filesystem;

View file

@ -8,6 +8,6 @@ src = ['database.cpp', 'entity.cpp', 'entityint.cpp', 'entityuuid.cpp',
core_inc = include_directories('..')
core_lib = static_library('core', src, dependencies :[boost, xlnt, sqlite, nlohmann_lib])
core_lib = static_library('core', src, dependencies :[boost, xlnt, sqlite, nlohmann_lib, csv_dep])
core_dep = declare_dependency(link_with : core_lib, include_directories : core_inc)