-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor the build system -- use exported cmake targets instead of ma… #35
base: devel
Are you sure you want to change the base?
Conversation
…nually setting headers and libs for the dependencies
|
||
add_library(xest STATIC | ||
add_library(xest SHARED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason for building a shared library instead of a static library?
${PROJECT_SOURCE_DIR}/thirdparty/pnp/build | ||
${PROJECT_SOURCE_DIR}/thirdparty/ceres-solver/lib | ||
/usr/local/lib | ||
find_package(OpenCV REQUIRED PATHS ${THIRD_PARTY_DIR}/opencv/install) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add the following above this block so that CMake doesn't accidentally link to a version that was installed onto the OS or exported from another project:
+set(Eigen3_DIR ${THIRD_PARTY_DIR}/eigen/share/eigen3/cmake)
+set(Ceres_DIR ${THIRD_PARTY_DIR}/ceres-solver/lib/cmake/Ceres)
+set(gflags_DIR ${THIRD_PARTY_DIR}/gflags/lib/cmake/gflags)
+set(glog_DIR ${THIRD_PARTY_DIR}/glog/lib/cmake/glog)
+set(gtest_DIR ${THIRD_PARTY_DIR}/googletest/lib/cmake/GTest)
+set(jsoncpp_DIR ${THIRD_PARTY_DIR}/jsoncpp/lib/cmake/jsoncpp)
+set(Pangolin_DIR ${THIRD_PARTY_DIR}/Pangolin/lib/cmake/Pangolin)
+set(DBoW2_DIR ${THIRD_PARTY_DIR}/DBoW2/lib/cmake/DBoW2)
At the moment, I'm getting the following linker error on Ubuntu 20.04 (lab machine):
On my laptop (Manjaro Linux), I get a segmentation fault at a matrix multiplication. It seems to be something related to data alignment at the processor level, but I haven't found a fix yet. gdb gives me this backtrace:
|
The current build system manually specifies path to the include/library directories. This is not portable.
For instance, on Fedora, the shared libraries (of the 3rd dependencies) will be installed in directory lib64 instead of lib.
In this PR, I removed some of the hardcoded paths, and used find_package and linked XIVO's targets against targets exported by the installed third-party libraries.