Skip to content

Commit

Permalink
Merge pull request #581 from norlab-ulaval/leave-boost-filesystem
Browse files Browse the repository at this point in the history
Leave boost filesystem
  • Loading branch information
boxanm authored Aug 16, 2024
2 parents bafdda9 + 1b37e6f commit 9bc74b9
Show file tree
Hide file tree
Showing 19 changed files with 135 additions and 181 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ jobs:
libopenmpt:x64-windows `
boost-mpi:x64-windows-static `
boost-thread:x64-windows-static `
boost-filesystem:x64-windows-static `
boost-system:x64-windows-static `
boost-program-options:x64-windows-static `
boost-date-time:x64-windows-static `
Expand All @@ -185,7 +184,7 @@ jobs:
if: ${{ steps.cache-boost.outputs.cache-hit != 'true' && runner.os == 'Linux' }}
working-directory: ${{ env.BOOST_SRC_DIR }}/${{ env.BOOST_DIR }}
run: |
./bootstrap.sh --with-libraries=thread,filesystem,system,program_options,date_time,chrono --with-icu --prefix=${{ env.BOOST_INSTALL_PATH }}
./bootstrap.sh --with-libraries=thread,system,program_options,date_time,chrono --with-icu --prefix=${{ env.BOOST_INSTALL_PATH }}
./b2 cxxflags=-fPIC cflags=-fPIC link=static install
- name: Download source code libnabo ${{ env.LIBNABO_VERSION }}
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ endif()
#--------------------
# DEPENDENCY: boost
#--------------------
find_package(Boost REQUIRED COMPONENTS thread filesystem system program_options date_time)
find_package(Boost REQUIRED COMPONENTS thread system program_options date_time)
if (Boost_MINOR_VERSION GREATER 47)
find_package(Boost REQUIRED COMPONENTS thread filesystem system program_options date_time chrono)
find_package(Boost REQUIRED COMPONENTS thread system program_options date_time chrono)
endif ()

#--------------------
Expand Down
11 changes: 5 additions & 6 deletions doc/LinkingProjects.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ A working example of how to link to an external project can be found in [./examp

## Option 2: Using Eclipse

We will demonstrate how to create an Eclipse project containing a simple executable which depends on libpointmatcher. You must have [Eclipse CDT](http://www.eclipse.org/cdt/) installed to develop with libpointmatcher in Eclipse.
We will demonstrate how to create an Eclipse project containing a simple executable which depends on libpointmatcher. You must have [Eclipse CDT](http://www.eclipse.org/cdt/) installed to develop with libpointmatcher in Eclipse.

Create a new C++ project by clicking `File > New > C++ Project`. You can name your project "PointmatcherEclipseDemo" and in toolchains select the default toolchain for your system (most likely Linux GCC). Click `Finish` to add your project to your Eclipse workspace.
Create a new C++ project by clicking `File > New > C++ Project`. You can name your project "PointmatcherEclipseDemo" and in toolchains select the default toolchain for your system (most likely Linux GCC). Click `Finish` to add your project to your Eclipse workspace.

You must then configure the project by going to `Project > Properties > C/C++Build > Settings`. Navigate to `C++ Compiler > Includes` and add the libpointmatcher (e.g. ~/Libraries/libpointmatcher) and eigen (e.g. /usr/include/eigen3) include path to the `Include paths (-I)` list. Next, go to `C++ Linker/Libraries` and add the the following three dependencies to the "Libraries (-l)" list:
You must then configure the project by going to `Project > Properties > C/C++Build > Settings`. Navigate to `C++ Compiler > Includes` and add the libpointmatcher (e.g. ~/Libraries/libpointmatcher) and eigen (e.g. /usr/include/eigen3) include path to the `Include paths (-I)` list. Next, go to `C++ Linker/Libraries` and add the the following three dependencies to the "Libraries (-l)" list:

* pointmatcher
* boost_system
* nabo

Click `Ok` to save the configuration. Create a new source file by clicking `File > New > Source File` and name it "Demo.cpp". In this file you can type the following:

```cpp
#include <pointmatcher/PointMatcher.h>
#include <iostream>
Expand Down Expand Up @@ -74,7 +74,6 @@ CONFIG += c++11
#QMAKE_LFLAGS += -mmacosx-version-min=10.7

LIBS += /usr/local/lib/libboost_thread-mt.dylib \
/usr/local/lib/libboost_filesystem-mt.dylib \
/usr/local/lib/libboost_system-mt.dylib \
/usr/local/lib/libboost_program_options-mt.dylib \
/usr/local/lib/libboost_date_time-mt.dylib \
Expand All @@ -97,7 +96,7 @@ g++ -I/usr/local/include/pointmatcher -o myProgram.o -c myProgram.cpp
You can then link to the pointmatcher library using:

```bash
g++ myProgram.o -o myProgram -lpointmatcher -lnabo -lboost_system -lyaml-cpp -lboost_filesystem -lrt
g++ myProgram.o -o myProgram -lpointmatcher -lnabo -lboost_system -lyaml-cpp -lrt
```

Nevertheless, it is always more convenient to use a builder such as CMake.
4 changes: 2 additions & 2 deletions evaluations/eval_solution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <ncurses.h>

#include <filesystem>
#include <boost/program_options.hpp>
#include <boost/filesystem.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/posix_time/posix_time_io.hpp>
#include <boost/thread/thread.hpp>
Expand All @@ -55,7 +55,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using namespace std;
using namespace PointMatcherSupport;
namespace po = boost::program_options;
namespace fs = boost::filesystem;
namespace fs = std::filesystem;
namespace pt = boost::posix_time;

typedef PointMatcher<float> PM;
Expand Down
3 changes: 0 additions & 3 deletions examples/align_sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <cassert>
#include <iostream>
#include <fstream>
#include <boost/format.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>


using namespace std;
Expand Down
7 changes: 2 additions & 5 deletions examples/build_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pointmatcher/IO.h"
#include <cassert>
#include <iostream>
#include <fstream>
#include <boost/format.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
#include <filesystem>
#include <boost/lexical_cast.hpp>

using namespace std;
Expand Down Expand Up @@ -210,7 +207,7 @@ int main(int argc, char *argv[])
}

stringstream outputFileNameIter;
outputFileNameIter << boost::filesystem::path(outputFileName).stem().c_str() << "_" << i << ".vtk";
outputFileNameIter << std::filesystem::path(outputFileName).stem().c_str() << "_" << i << ".vtk";

mapCloud.save(outputFileNameIter.str());
}
Expand Down
4 changes: 0 additions & 4 deletions examples/compute_overlap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pointmatcher/IO.h"
#include <cassert>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <boost/format.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/lexical_cast.hpp>

using namespace std;
Expand Down
1 change: 0 additions & 1 deletion examples/demo_Qt/demo.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ CONFIG += c++11
#QMAKE_LFLAGS += -mmacosx-version-min=10.7

LIBS += /usr/local/lib/libboost_thread-mt.dylib \
/usr/local/lib/libboost_filesystem-mt.dylib \
/usr/local/lib/libboost_system-mt.dylib \
/usr/local/lib/libboost_program_options-mt.dylib \
/usr/local/lib/libboost_date_time-mt.dylib \
Expand Down
2 changes: 1 addition & 1 deletion examples/demo_cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project(convert)
set(CMAKE_CXX_STANDARD 17)

find_package(libpointmatcher REQUIRED)
find_package(Boost REQUIRED COMPONENTS filesystem)
find_package(Boost REQUIRED)

include_directories(${CMAKE_CURRENT_BINARY_DIR} ${libpointmatcher_INCLUDE_DIRS} ${Boost_INCLUDE_DIR})

Expand Down
2 changes: 0 additions & 2 deletions examples/icp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pointmatcher/PointMatcher.h"
#include "pointmatcher/Bibliography.h"

#include "boost/filesystem.hpp"

#include <cassert>
#include <fstream>
#include <iostream>
Expand Down
2 changes: 0 additions & 2 deletions examples/icp_advance_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pointmatcher/PointMatcher.h"
#include "pointmatcher/Bibliography.h"

#include "boost/filesystem.hpp"

#include <cassert>
#include <fstream>
#include <iostream>
Expand Down
1 change: 0 additions & 1 deletion examples/icp_customized.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pointmatcher/PointMatcher.h"
#include <cassert>
#include <iostream>
#include "boost/filesystem.hpp"

using namespace std;

Expand Down
1 change: 0 additions & 1 deletion examples/icp_simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pointmatcher/PointMatcher.h"
#include <cassert>
#include <iostream>
#include "boost/filesystem.hpp"

using namespace std;

Expand Down
4 changes: 2 additions & 2 deletions libpointmatcherConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
include(CMakeFindDependencyMacro)
find_dependency(libnabo REQUIRED)
find_dependency(yaml-cpp REQUIRED)
find_package(Boost COMPONENTS thread filesystem system program_options date_time REQUIRED)
find_package(Boost COMPONENTS thread system program_options date_time REQUIRED)
if (Boost_MINOR_VERSION GREATER 47)
find_package(Boost COMPONENTS thread filesystem system program_options date_time chrono REQUIRED)
find_package(Boost COMPONENTS thread system program_options date_time chrono REQUIRED)
endif ()
include(${CMAKE_CURRENT_LIST_DIR}/libpointmatcher-config.cmake)

Expand Down
Loading

0 comments on commit 9bc74b9

Please sign in to comment.