From: Alexander Schaefer Date: Sat, 12 Mar 2016 20:35:51 +0000 (+0100) Subject: Define individual CMake variables for the different pigpio libraries. X-Git-Tag: archive/raspbian/1.68-2+rpi1~88^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e3243d34c1cb25f4cf67b268ce3935d710816486;p=pigpio.git Define individual CMake variables for the different pigpio libraries. The user has to specify which library he wants to link against, as all libraries define functions like gpio_write(). --- diff --git a/util/Findpigpio.cmake b/util/Findpigpio.cmake index 717699f..6c94ee0 100644 --- a/util/Findpigpio.cmake +++ b/util/Findpigpio.cmake @@ -1,5 +1,5 @@ ################################################################################ -### Find the pigpio includes and shared libraries. +### Find the pigpio shared libraries. ################################################################################ # Find the path to the pigpio includes. @@ -7,19 +7,24 @@ find_path(pigpio_INCLUDE_DIR NAMES pigpio.h pigpiod_if.h pigpiod_if2.h HINTS /usr/local/include) -# Find the path to the pigpio libraries. +# Find the pigpio libraries. find_library(pigpio_LIBRARY - NAMES libpigpio.so libpigpiod_if.so libpigpiod_if2.so + NAMES libpigpio.so + HINTS /usr/local/lib) +find_library(pigpiod_if_LIBRARY + NAMES libpigpiod_if.so + HINTS /usr/local/lib) +find_library(pigpiod_if2_LIBRARY + NAMES libpigpiod_if2.so HINTS /usr/local/lib) # Set the pigpio variables to plural form to make them accessible for # the paramount cmake modules. set(pigpio_INCLUDE_DIRS ${pigpio_INCLUDE_DIR}) set(pigpio_INCLUDES ${pigpio_INCLUDE_DIR}) -set(pigpio_LIBRARIES ${pigpio_LIBRARY}) # Handle REQUIRED, QUIET, and version arguments # and set the _FOUND variable. find_package_handle_standard_args(pigpio DEFAULT_MSG - pigpio_INCLUDE_DIR pigpio_LIBRARY) + pigpio_INCLUDE_DIR pigpio_LIBRARY pigpiod_if_LIBRARY pigpiod_if2_LIBRARY)