1

I am facing issue on getting cmake work with custom boost libraries for my project (relate question here

Its failing in find_path step so to debug further i tried different combinations for this find_path all failed. Even the simple query below fails for me (complete-folder-path is complete path to the folder from root).

ls <complete-folder-path>
main.cpp

part of Cmake file

find_path(_TEST_Path "main.cpp" HINTS "<complete-folder-path>")
message(WARNING ${_TEST_Path})

This prints

 _TEST_Path-NOTFOUND

What am i missing here ?

user3279954
  • 556
  • 2
  • 7
  • 22
  • Did you try using `PATHS` instead? `find_path(_TEST_Path "main.cpp" PATHS "")` – Kevin Apr 30 '20 at 22:42
  • Still same error,https://cmake.org/cmake/help/latest/command/find_library.html from the doc only the order of when HINTS or PATHS gets used is different. – user3279954 Apr 30 '20 at 23:44
  • Yes, but the documentation also says "*`HINTS`: These should be paths computed by system introspection, such as a hint provided by the location of another item already found. Hard-coded guesses should be specified with the `PATHS` option.*" Yours is a hard-coded guess... Do you have any sym-links in the path? – Kevin Apr 30 '20 at 23:49
  • You are right `PATHS` seems more appropriate here, actually I was trying to fix another issue mentioned in the question, so tried to mimick the setup. There are no symlinks in this path this just sits under my home folder/test/ – user3279954 Apr 30 '20 at 23:55
  • The actual path you wrote into the `find_path` call can be significant as well. For example, if it's a path in your home directory, make sure you spell out the *entire* path, and do *not* use the `~` home directory shortcut. – Kevin Apr 30 '20 at 23:56
  • yes the one i use is full path, from root (/) no aliases/relative paths. – user3279954 May 01 '20 at 01:15
  • You may also consider trying a different variable name that doesn't start with an underscore (`_`), these are typically reserved for internal CMake use. – Kevin May 01 '20 at 01:20

0 Answers0