haampie / libtree

ldd as a tree
MIT License
2.67k stars 60 forks source link

Add USE_SYSTEM_DEPS flag and install target #8

Closed otreblan closed 4 years ago

otreblan commented 4 years ago

If its -DUSE_SYSTEM_DEPS=ON the deps folder is ignored and only cppglob is linked. Else the libraries at deps are build and linked.

Also added the deps/cxxopts/include to the include directories because in Arch linux, cxxopts puts the cxxopts.hpp header in /usr/include/

otreblan commented 4 years ago

This PR is needed to build the aur package. https://aur.archlinux.org/packages/libtree-git/ (The PKGBUILD is using my fork as source)

maxice8 commented 4 years ago

Please add fixes #5 to your Add install target commit

maxice8 commented 4 years ago

With this patch i get the following:

[ 14%] Building CXX object CMakeFiles/libtree.dir/src/main.cpp.o
/home/builder/aports/testing/libtree/src/libtree-1.0.0/src/main.cpp:3:10: fatal error: cxxopts.hpp: No such file or directory
    3 | #include <cxxopts.hpp>
      |          ^~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/libtree.dir/build.make:83: CMakeFiles/libtree.dir/src/main.cpp.o] Error 1
make[2]: Leaving directory '/home/builder/aports/testing/libtree/src/libtree-1.0.0/build'
make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/libtree.dir/all] Error 2
make[1]: Leaving directory '/home/builder/aports/testing/libtree/src/libtree-1.0.0/build'
make: *** [Makefile:150: all] Error 2
make: Leaving directory '/home/builder/aports/testing/libtree/src/libtree-1.0.0/build'
>>> ERROR: libtree: build failed
otreblan commented 4 years ago

Closes #5

haampie commented 4 years ago

Thanks a lot, this is very useful. I've removed the cppglob targets from installing as well. I think the CMakeLists.txt could be simplified a bit if upstream they remove the BUILD_SHARED / BUILD_STATIC options and instead use smth like BUILD_SHARED_LIBS=ON/OFF with a single target.

haampie commented 4 years ago

@otreblan could you maybe update the URL of your AUR package? :)

otreblan commented 4 years ago

@otreblan could you maybe update the URL of your AUR package? :)

Done

haampie commented 4 years ago

Thanks!!