Skip to content

Commit

Permalink
Replace boost system and filesystem libraries with std17
Browse files Browse the repository at this point in the history
  • Loading branch information
hrobeers committed Mar 20, 2020
1 parent 66a0edf commit a495370
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ endif()
set(CMAKE_AUTOMOC ON)

# Boost
find_package(Boost COMPONENTS system filesystem iostreams REQUIRED)
find_package(Boost COMPONENTS iostreams REQUIRED)
if(Boost_FOUND)
message(STATUS "Including Boost from: ${Boost_INCLUDE_DIRS}")
include_directories(${Boost_INCLUDE_DIRS})
Expand Down
1 change: 0 additions & 1 deletion src/foillogic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ set_property(TARGET ${LIB_NAME} PROPERTY CXX_STANDARD 17)

target_link_libraries(${LIB_NAME}
finfoil_patheditor
${Boost_LIBRARIES}
)

install(TARGETS ${LIB_NAME}
Expand Down
2 changes: 1 addition & 1 deletion src/hrlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ file(GLOB_RECURSE SRC_C *.c *.h)
add_library(${LIB_NAME} ${FINFOIL_LIB_TYPE} ${SRC} ${SRC_C} ${HDR})
set_property(TARGET ${LIB_NAME} PROPERTY CXX_STANDARD 17)

target_link_libraries(${LIB_NAME} Qt5::Core)
target_link_libraries(${LIB_NAME} Qt5::Core ${Boost_LIBRARIES})

install(TARGETS ${LIB_NAME}
LIBRARY DESTINATION lib
Expand Down
4 changes: 2 additions & 2 deletions src/version_autogen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define MINOR_VERSION 2
#define REVISION 0

#define BUILD_NUMBER 606
#define COMMIT_HASH "04334e8591f2752dbeb12cd45b45d503d9f5d363"
#define BUILD_NUMBER 607
#define COMMIT_HASH "66a0edf269c739c6cbd0c798c8c7b3aeb2524a9a"

#endif // VERSION_AUTOGEN_H
3 changes: 1 addition & 2 deletions tests/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ file(GLOB_RECURSE HDR *.hpp)
#

add_executable(${TESTS_BINARY_NAME} WIN32 ${SRC} ${HDR} ${MOC_SRC} ${FORMS_HEADERS} ${RC_SRC} ${QM})
set_property(TARGET ${TESTS_BINARY_NAME} PROPERTY CXX_STANDARD 17)


#
Expand All @@ -32,6 +33,4 @@ target_link_libraries(${TESTS_BINARY_NAME}
finfoil_patheditor
finfoil_logic
jenson
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
)
6 changes: 4 additions & 2 deletions tests/unittests/foillogic-tests/foiltests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@

#include "foiltests.hpp"

#include <fstream>
#include <filesystem>

#include <boost/format.hpp>
#include <boost/filesystem.hpp>

#include "submodules/qtestrunner/qtestrunner.hpp"
#include "foillogic/foil.hpp"
Expand Down Expand Up @@ -109,7 +111,7 @@ std::unique_ptr<QImage> toImage(Path *path)
void FoilTests::testOutlineIO()
{
std::string path = "testdata/outlines/";
for (const boost::filesystem::directory_entry &p : boost::filesystem::directory_iterator(path))
for (const std::filesystem::directory_entry &p : std::filesystem::directory_iterator(path))
{
if (p.path().extension().string()!=".pdf")
// TODO error handling on non-pdf files
Expand Down
5 changes: 3 additions & 2 deletions tests/unittests/hrlib-tests/curvefittests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

#include "curvefittests.hpp"

#include <boost/filesystem.hpp>
#include <fstream>
#include <filesystem>

#include "submodules/qtestrunner/qtestrunner.hpp"
#include "hrlib/curvefit/curvefit.hpp"
Expand All @@ -34,7 +35,7 @@ using namespace std;
void CurveFitTests::testVertexReading()
{
std::string path = "testdata/profiles/";
for (auto & p : boost::filesystem::directory_iterator(path))
for (auto & p : std::filesystem::directory_iterator(path))
{
std::ifstream ifs;
ifs.open(p.path().string(), std::ifstream::in);
Expand Down

0 comments on commit a495370

Please sign in to comment.