Skip to content
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

DLib is manually installed to /usr/local/lib ... #26

Closed
jiapei100 opened this issue Aug 29, 2019 · 4 comments
Closed

DLib is manually installed to /usr/local/lib ... #26

jiapei100 opened this issue Aug 29, 2019 · 4 comments

Comments

@jiapei100
Copy link

Hi, I actually have manually installed DLib to /usr/local/lib, how should I define DLib_DIR ?

I don't have
DLibConfig.cmake
dlib-config.cmake

but with the following dlib.pc

% cat /usr/local/lib/pkgconfig/dlib.pc 
libdir=/usr/local/lib
includedir=/usr/local/include

Name: dlib
Description: Numerical and networking C++ library
Version: 19.17.0
Libs: -L${libdir} -ldlib
Cflags: -I${includedir}
Requires: libpng

The current ERROR is:

 CMake Error at applications/badslam/CMakeLists.txt:7 (find_package):
   By not providing "FindDLib.cmake" in CMAKE_MODULE_PATH this project has
   asked CMake to find a package configuration file provided by "DLib", but
   CMake did not find one.

   Could not find a package configuration file provided by "DLib" with any of
   the following names:

     DLibConfig.cmake
     dlib-config.cmake

   Add the installation prefix of "DLib" to CMAKE_PREFIX_PATH or set
   "DLib_DIR" to a directory containing one of the above files.  If "DLib"
   provides a separate development package or SDK, be sure it has been
   installed.

Can anybody help to fix this issue?

Thank you
Pei

@puzzlepaint
Copy link
Collaborator

Hi, does /usr/local/include/DLib/ contain a file DLibConfig.cmake? If yes, you could set DLib_DIR to this directory. Otherwise, it would be a possibility to write a custom DLibConfig.cmake that points to your installation directories. As an example, here is the content of /usr/local/include/DLib/DLibConfig.cmake on my system:

FIND_LIBRARY(DLib_LIBRARY DLib
    PATHS "/usr/local/lib"
)
FIND_PATH(DLib_INCLUDE_DIR DLibConfig.cmake
    PATHS "/usr/local/include/DLib" 
)
LIST(APPEND DLib_INCLUDE_DIR
  ${DLib_INCLUDE_DIR}/../ ${DLib_INCLUDE_DIR}/../DUtils
  ${DLib_INCLUDE_DIR}/../DUtilsCV ${DLib_INCLUDE_DIR}/../DVision)
SET(DLib_LIBRARIES ${DLib_LIBRARY})
SET(DLib_LIBS ${DLib_LIBRARY})
SET(DLib_INCLUDE_DIRS ${DLib_INCLUDE_DIR})

@brookman
Copy link

brookman commented Feb 11, 2020

@jiapei100 You have probably installed the wrong library. There are two unrelated libraries which have the same name (but different capitalization in the name):

I made the same mistake and lost a few hours because of it. ^^'

@puzzlepaint
Copy link
Collaborator

Indeed, the .pc file referenced above contains Description: Numerical and networking C++ library, which I overlooked when I first replied. I just added a warning about this to the Readme to hopefully prevent this from happening to more people.

@jiapei100
Copy link
Author

@brookman

Thank you @brookman . There are still compatibility issue:

dorian3d/DLib#23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants