1919
2020include (LibFindMacros)
2121
22- find_path (Gphoto2_INCLUDE_DIR gphoto2/gphoto2.h)
23- mark_as_advanced (Gphoto2_INCLUDE_DIR)
24-
25- set (Gphoto2_NAMES ${Gphoto2_NAMES} gphoto2 libgphoto2)
26- set (Gphoto2_PORT_NAMES ${Gphoto2_PORT_NAMES} gphoto2_port libgphoto2_port)
27- find_library (Gphoto2_LIBRARY NAMES ${Gphoto2_NAMES} )
28- find_library (Gphoto2_PORT_LIBRARY NAMES ${Gphoto2_PORT_NAMES} )
29- mark_as_advanced (Gphoto2_LIBRARY)
30- mark_as_advanced (Gphoto2_PORT_LIBRARY)
31-
3222# Detect libgphoto2 version
3323libfind_pkg_check_modules(Gphoto2_PKGCONF libgphoto2)
3424if (Gphoto2_PKGCONF_FOUND)
@@ -41,10 +31,20 @@ if(Gphoto2_PORT_PKGCONF_FOUND)
4131 set (Gphoto2_PORT_VERSION_STRING "${Gphoto2_PORT_PKGCONF_VERSION} " )
4232endif ()
4333
34+ find_path (Gphoto2_INCLUDE_DIR NAMES gphoto2/gphoto2.h HINTS ${Gphoto2_PKGCONF_INCLUDE_DIRS} )
35+ mark_as_advanced (Gphoto2_INCLUDE_DIR)
36+
37+ set (Gphoto2_NAMES ${Gphoto2_NAMES} gphoto2 libgphoto2)
38+ set (Gphoto2_PORT_NAMES ${Gphoto2_PORT_NAMES} gphoto2_port libgphoto2_port)
39+ find_library (Gphoto2_LIBRARY NAMES ${Gphoto2_NAMES} HINTS ${Gphoto2_PKGCONF_LIBRARY_DIRS} )
40+ find_library (Gphoto2_PORT_LIBRARY NAMES ${Gphoto2_PORT_NAMES} HINTS ${Gphoto2_PORT_PKGCONF_LIBRARY_DIRS} )
41+ mark_as_advanced (Gphoto2_LIBRARY)
42+ mark_as_advanced (Gphoto2_PORT_LIBRARY)
43+
4444# handle the QUIETLY and REQUIRED arguments and set Gphoto2_FOUND to TRUE if
4545# all listed variables are TRUE
4646include (FindPackageHandleStandardArgs)
47- find_package_handle_standard_args(Gphoto2 DEFAULT_MSG Gphoto2_LIBRARY Gphoto2_INCLUDE_DIR)
47+ find_package_handle_standard_args(Gphoto2 DEFAULT_MSG Gphoto2_LIBRARY Gphoto2_PORT_LIBRARY Gphoto2_INCLUDE_DIR)
4848
4949IF (Gphoto2_FOUND)
5050 SET (Gphoto2_LIBRARIES ${Gphoto2_LIBRARY} ${Gphoto2_PORT_LIBRARY} )
0 commit comments