Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

cmake not prioritising user installation of FlyCapture2 #14

Open
Georacer opened this issue Feb 22, 2017 · 6 comments
Open

cmake not prioritising user installation of FlyCapture2 #14

Georacer opened this issue Feb 22, 2017 · 6 comments

Comments

@Georacer
Copy link

Hello Chao,

After our yesterday's chat, I delved a little deeper into FindFlyCapture2.cmake.
I saw that there should be a priority to the user installation of the library, which in fact you include inside the files of this repo.

However, each time I compile, I get the message

-- flycapture include dir found: /usr/include
-- flycapture library dir found: /usr/lib/

probably because I had already an active installation of PtGrey's SDK in my system.

I tried enforcing the local path by using the NO_DEFAULT_PATH option in the find_path and find_library commands, but it didn't seem to do anything.

In the end, I commented out all the conditional code and set the paths manually to local, e.g.

set(FlyCapture2_INCLUDE_DIR ${FlyCapture2_CHECK_INCLUDE_DIRS})

It's not a function-breaking bug, but it doesn't allow you to NOT use the system libraries for this package.

Looking forward to hearing what you think of this.

@versatran01
Copy link
Collaborator

Remove your build folder and do it again?
That might be a cmake cache issue.

@Georacer
Copy link
Author

After deleting catkin_ws/devel I ran catkin_make --pkg flea3.

Snippet of the result is:

-- ==> add_subdirectory(flea3)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- flycapture include dir found: /usr/include
-- flycapture library dir found: /usr/lib/
-- Found FlyCapture2: /usr/include  

From what I get, it wasn't a cache issue.

@versatran01
Copy link
Collaborator

did you also delete the build folder?

@Georacer
Copy link
Author

I hadn't previously. Did now. Same result.

Do you want me to provide you with some output for bug tracking?

@versatran01
Copy link
Collaborator

I tried myself, got the same result. For now you can just add NO_DEFAULT_PATH to find_path call in FindFlyCapture2.cmake to force local flycapture

@Georacer
Copy link
Author

Thanks for confirming it. I tried NO_DEFAULT_PATH and it doesn't seem to do anything, but I don't believe it's your fault.
I worked around find_path and used the current path to assign the library directory.

get_filename_component(FLYCAPTURE_DIR ${CMAKE_CURRENT_SOURCE_DIR} REALPATH)
list(APPEND FlyCapture2_CHECK_INCLUDE_DIRS
    ${FLYCAPTURE_DIR}/flycapture/include
    )

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

No branches or pull requests

2 participants