diff options
Diffstat (limited to 'cmake/Modules')
-rw-r--r-- | cmake/Modules/FindAVCodec.cmake | 47 | ||||
-rw-r--r-- | cmake/Modules/FindAVUtil.cmake | 47 | ||||
-rw-r--r-- | cmake/Modules/FindFfmpeg.cmake | 22 | ||||
-rw-r--r-- | cmake/Modules/FindGMP.cmake | 47 | ||||
-rw-r--r-- | cmake/Modules/FindGmp.cmake | 17 | ||||
-rw-r--r-- | cmake/Modules/FindIconv.cmake | 66 | ||||
-rw-r--r-- | cmake/Modules/FindNettle.cmake | 70 | ||||
-rw-r--r-- | cmake/Modules/FindPAM.cmake | 47 | ||||
-rw-r--r-- | cmake/Modules/FindPWQuality.cmake | 47 | ||||
-rw-r--r-- | cmake/Modules/FindPixman.cmake | 56 | ||||
-rw-r--r-- | cmake/Modules/FindSELinux.cmake | 47 | ||||
-rw-r--r-- | cmake/Modules/FindSWScale.cmake | 47 | ||||
-rw-r--r-- | cmake/Modules/FindSystemd.cmake | 47 |
13 files changed, 478 insertions, 129 deletions
diff --git a/cmake/Modules/FindAVCodec.cmake b/cmake/Modules/FindAVCodec.cmake new file mode 100644 index 00000000..9667160f --- /dev/null +++ b/cmake/Modules/FindAVCodec.cmake @@ -0,0 +1,47 @@ +#[=======================================================================[.rst: +FindAVCodec +----------- + +Find the FFmpeg avcodec library + +Result variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables if found: + +``AVCODEC_INCLUDE_DIRS`` + where to find libavcodec/avcodec.h, etc. +``AVCODEC_LIBRARIES`` + the libraries to link against to use avcodec. +``AVCODEC_FOUND`` + TRUE if found + +#]=======================================================================] + +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_AVCodec QUIET libavcodec) +endif() + +find_path(AVCodec_INCLUDE_DIR NAMES libavcodec/avcodec.h + HINTS + ${PC_AVCodec_INCLUDE_DIRS} +) +mark_as_advanced(AVCodec_INCLUDE_DIR) + +find_library(AVCodec_LIBRARY NAMES avcodec + HINTS + ${PC_AVCodec_LIBRARY_DIRS} +) +mark_as_advanced(AVCodec_LIBRARY) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(AVCodec + REQUIRED_VARS + AVCodec_LIBRARY AVCodec_INCLUDE_DIR +) + +if(AVCodec_FOUND) + set(AVCODEC_INCLUDE_DIRS ${AVCodec_INCLUDE_DIR}) + set(AVCODEC_LIBRARIES ${AVCodec_LIBRARY}) +endif() diff --git a/cmake/Modules/FindAVUtil.cmake b/cmake/Modules/FindAVUtil.cmake new file mode 100644 index 00000000..4b7e17cc --- /dev/null +++ b/cmake/Modules/FindAVUtil.cmake @@ -0,0 +1,47 @@ +#[=======================================================================[.rst: +FindAVUtil +---------- + +Find the FFmpeg avutil library + +Result variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables if found: + +``AVUTIL_INCLUDE_DIRS`` + where to find libavutil/avutil.h, etc. +``AVUTIL_LIBRARIES`` + the libraries to link against to use avutil. +``AVUTIL_FOUND`` + TRUE if found + +#]=======================================================================] + +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_AVUtil QUIET libavutil) +endif() + +find_path(AVUtil_INCLUDE_DIR NAMES libavutil/avutil.h + HINTS + ${PC_AVUtil_INCLUDE_DIRS} +) +mark_as_advanced(AVUtil_INCLUDE_DIR) + +find_library(AVUtil_LIBRARY NAMES avutil + HINTS + ${PC_AVUtil_LIBRARY_DIRS} +) +mark_as_advanced(AVUtil_LIBRARY) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(AVUtil + REQUIRED_VARS + AVUtil_LIBRARY AVUtil_INCLUDE_DIR +) + +if(AVUtil_FOUND) + set(AVUTIL_INCLUDE_DIRS ${AVUtil_INCLUDE_DIR}) + set(AVUTIL_LIBRARIES ${AVUtil_LIBRARY}) +endif() diff --git a/cmake/Modules/FindFfmpeg.cmake b/cmake/Modules/FindFfmpeg.cmake deleted file mode 100644 index 1a082449..00000000 --- a/cmake/Modules/FindFfmpeg.cmake +++ /dev/null @@ -1,22 +0,0 @@ -find_package(PkgConfig) - -if (PKG_CONFIG_FOUND) - pkg_check_modules(AVCODEC libavcodec) - pkg_check_modules(AVUTIL libavutil) - pkg_check_modules(SWSCALE libswscale) -else() - find_path(AVCODEC_INCLUDE_DIRS NAMES avcodec.h PATH_SUFFIXES libavcodec) - find_library(AVCODEC_LIBRARIES NAMES avcodec) - find_package_handle_standard_args(AVCODEC DEFAULT_MSG AVCODEC_LIBRARIES AVCODEC_INCLUDE_DIRS) - find_path(AVUTIL_INCLUDE_DIRS NAMES avutil.h PATH_SUFFIXES libavutil) - find_library(AVUTIL_LIBRARIES NAMES avutil) - find_package_handle_standard_args(AVUTIL DEFAULT_MSG AVUTIL_LIBRARIES AVUTIL_INCLUDE_DIRS) - find_path(SWSCALE_INCLUDE_DIRS NAMES swscale.h PATH_SUFFIXES libswscale) - find_library(SWSCALE_LIBRARIES NAMES swscale) - find_package_handle_standard_args(SWSCALE DEFAULT_MSG SWSCALE_LIBRARIES SWSCALE_INCLUDE_DIRS) -endif() - -if(Ffmpeg_FIND_REQUIRED AND - (NOT AVCODEC_FOUND OR NOT AVUTIL_FOUND OR NOT SWSCALE_FOUND)) - message(FATAL_ERROR "Could not find FFMPEG") -endif() diff --git a/cmake/Modules/FindGMP.cmake b/cmake/Modules/FindGMP.cmake new file mode 100644 index 00000000..956d3f19 --- /dev/null +++ b/cmake/Modules/FindGMP.cmake @@ -0,0 +1,47 @@ +#[=======================================================================[.rst: +FindGMP +------- + +Find the GNU MP bignum library + +Result variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables if found: + +``GMP_INCLUDE_DIRS`` + where to find gmp.h, etc. +``GMP_LIBRARIES`` + the libraries to link against to use GMP. +``GMP_FOUND`` + TRUE if found + +#]=======================================================================] + +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_GMP QUIET gmp) +endif() + +find_path(GMP_INCLUDE_DIR NAMES gmp.h + HINTS + ${PC_GMP_INCLUDE_DIRS} +) +mark_as_advanced(GMP_INCLUDE_DIR) + +find_library(GMP_LIBRARY NAMES gmp + HINTS + ${PC_GMP_LIBRARY_DIRS} +) +mark_as_advanced(GMP_LIBRARY) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GMP + REQUIRED_VARS + GMP_LIBRARY GMP_INCLUDE_DIR +) + +if(GMP_FOUND) + set(GMP_INCLUDE_DIRS ${GMP_INCLUDE_DIR}) + set(GMP_LIBRARIES ${GMP_LIBRARY}) +endif() diff --git a/cmake/Modules/FindGmp.cmake b/cmake/Modules/FindGmp.cmake deleted file mode 100644 index 8711d68e..00000000 --- a/cmake/Modules/FindGmp.cmake +++ /dev/null @@ -1,17 +0,0 @@ -find_package(PkgConfig) - -if (PKG_CONFIG_FOUND) - pkg_check_modules(GMP gmp) -endif() - -# Only very recent versions of gmp has pkg-config support, so we have to -# fall back on a more classical search -if(NOT GMP_FOUND) - find_path(GMP_INCLUDE_DIRS NAMES gmp.h PATH_SUFFIXES) - find_library(GMP_LIBRARIES NAMES gmp) - find_package_handle_standard_args(GMP DEFAULT_MSG GMP_LIBRARIES GMP_INCLUDE_DIRS) -endif() - -if(Gmp_FIND_REQUIRED AND NOT GMP_FOUND) - message(FATAL_ERROR "Could not find GMP") -endif() diff --git a/cmake/Modules/FindIconv.cmake b/cmake/Modules/FindIconv.cmake deleted file mode 100644 index cf268ea0..00000000 --- a/cmake/Modules/FindIconv.cmake +++ /dev/null @@ -1,66 +0,0 @@ -# From: http://gitorious.org/gammu/mainline/blobs/master/cmake/FindIconv.cmake - -# - Try to find Iconv -# Once done this will define -# -# ICONV_FOUND - system has Iconv -# ICONV_INCLUDE_DIR - the Iconv include directory -# ICONV_LIBRARIES - Link these to use Iconv -# ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const -# -include(CheckCCompilerFlag) -include(CheckCXXSourceCompiles) - -IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) - # Already in cache, be silent - SET(ICONV_FIND_QUIETLY TRUE) -ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) - -FIND_PATH(ICONV_INCLUDE_DIR iconv.h) - -FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv c) - -IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) - SET(ICONV_FOUND TRUE) -ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) - -set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) -set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES}) -IF(ICONV_FOUND) - check_c_compiler_flag("-Werror" ICONV_HAVE_WERROR) - set (CMAKE_C_FLAGS_BACKUP "${CMAKE_C_FLAGS}") - if(ICONV_HAVE_WERROR) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") - endif(ICONV_HAVE_WERROR) - check_c_source_compiles(" - #include <iconv.h> - int main(){ - iconv_t conv = 0; - const char* in = 0; - size_t ilen = 0; - char* out = 0; - size_t olen = 0; - iconv(conv, &in, &ilen, &out, &olen); - return 0; - } -" ICONV_SECOND_ARGUMENT_IS_CONST ) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}") -ENDIF(ICONV_FOUND) -set(CMAKE_REQUIRED_INCLUDES) -set(CMAKE_REQUIRED_LIBRARIES) - -IF(ICONV_FOUND) - IF(NOT ICONV_FIND_QUIETLY) - MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}") - ENDIF(NOT ICONV_FIND_QUIETLY) -ELSE(ICONV_FOUND) - IF(Iconv_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find Iconv") - ENDIF(Iconv_FIND_REQUIRED) -ENDIF(ICONV_FOUND) - -MARK_AS_ADVANCED( - ICONV_INCLUDE_DIR - ICONV_LIBRARIES - ICONV_SECOND_ARGUMENT_IS_CONST -) diff --git a/cmake/Modules/FindNettle.cmake b/cmake/Modules/FindNettle.cmake index f5acf6ac..cdad9754 100644 --- a/cmake/Modules/FindNettle.cmake +++ b/cmake/Modules/FindNettle.cmake @@ -1,21 +1,63 @@ -find_package(Gmp) -find_package(PkgConfig) +#[=======================================================================[.rst: +FindNettle +---------- -if (PKG_CONFIG_FOUND) - pkg_check_modules(NETTLE nettle>=3.0) - pkg_check_modules(HOGWEED hogweed) +Find the Nettle and Hogweed libraries + +Result variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables if found: + +``NETTLE_INCLUDE_DIRS`` + where to find nettle/eax.h, etc. +``NETTLE_LIBRARIES`` + the libraries to link against to use Nettle. +``HOGWEED_LIBRARIES`` + the libraries to link against to use Hogweed. +``NETTLE_FOUND`` + TRUE if found + +#]=======================================================================] + +if(Nettle_FIND_REQUIRED) + find_package(GMP QUIET REQUIRED) else() - find_path(NETTLE_INCLUDE_DIRS NAMES eax.h PATH_SUFFIXES nettle) - find_library(NETTLE_LIBRARIES NAMES nettle) - find_package_handle_standard_args(NETTLE DEFAULT_MSG NETTLE_LIBRARIES NETTLE_INCLUDE_DIRS) - find_library(HOGWEED_LIBRARIES NAMES hogweed) - find_package_handle_standard_args(HOGWEED DEFAULT_MSG HOGWEED_LIBRARIES) + find_package(GMP QUIET) endif() -if (NOT HOGWEED_FOUND OR NOT GMP_FOUND) - set(NETTLE_FOUND 0) +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_Nettle QUIET nettle) + pkg_check_modules(PC_Hogweed QUIET hogweed) endif() -if(Nettle_FIND_REQUIRED AND NOT NETTLE_FOUND) - message(FATAL_ERROR "Could not find Nettle") +find_path(Nettle_INCLUDE_DIR NAMES nettle/eax.h + HINTS + ${PC_Nettle_INCLUDE_DIRS} +) +mark_as_advanced(Nettle_INCLUDE_DIR) + +find_library(Nettle_LIBRARY NAMES nettle + HINTS + ${PC_Nettle_LIBRARY_DIRS} +) +mark_as_advanced(Nettle_LIBRARY) + +find_library(Hogweed_LIBRARY NAMES hogweed + HINTS + ${PC_Hogweed_LIBRARY_DIRS} +) +mark_as_advanced(Hogweed_LIBRARY) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Nettle + REQUIRED_VARS + Nettle_LIBRARY Nettle_INCLUDE_DIR Hogweed_LIBRARY +) + +if(Nettle_FOUND) + set(NETTLE_INCLUDE_DIRS ${Nettle_INCLUDE_DIR} ${GMP_INCLUDE_DIRS}) + set(NETTLE_LIBRARIES ${Nettle_LIBRARY}) + set(HOGWEED_LIBRARIES ${Hogweed_LIBRARY} ${GMP_LIBRARIES}) endif() diff --git a/cmake/Modules/FindPAM.cmake b/cmake/Modules/FindPAM.cmake new file mode 100644 index 00000000..a41cb421 --- /dev/null +++ b/cmake/Modules/FindPAM.cmake @@ -0,0 +1,47 @@ +#[=======================================================================[.rst: +FindPAM +------- + +Find the Pluggable Authentication Modules library + +Result variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables if found: + +``PAM_INCLUDE_DIRS`` + where to find security/pam_appl.h, etc. +``PAM_LIBRARIES`` + the libraries to link against to use PAM. +``PAM_FOUND`` + TRUE if found + +#]=======================================================================] + +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_PAM QUIET pam) +endif() + +find_path(PAM_INCLUDE_DIR NAMES security/pam_appl.h + HINTS + ${PC_PAM_INCLUDE_DIRS} +) +mark_as_advanced(PAM_INCLUDE_DIR) + +find_library(PAM_LIBRARY NAMES pam + HINTS + ${PC_PAM_LIBRARY_DIRS} +) +mark_as_advanced(PAM_LIBRARY) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PAM + REQUIRED_VARS + PAM_LIBRARY PAM_INCLUDE_DIR +) + +if(PAM_FOUND) + set(PAM_INCLUDE_DIRS ${PAM_INCLUDE_DIR}) + set(PAM_LIBRARIES ${PAM_LIBRARY}) +endif() diff --git a/cmake/Modules/FindPWQuality.cmake b/cmake/Modules/FindPWQuality.cmake new file mode 100644 index 00000000..a1e5c1ff --- /dev/null +++ b/cmake/Modules/FindPWQuality.cmake @@ -0,0 +1,47 @@ +#[=======================================================================[.rst: +FindPWQuality +------------- + +Find the password quality library + +Result variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables if found: + +``PWQUALITY_INCLUDE_DIRS`` + where to find pwquality.h, etc. +``PWQUALITY_LIBRARIES`` + the libraries to link against to use pwquality. +``PWQUALITY_FOUND`` + TRUE if found + +#]=======================================================================] + +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_PWQuality QUIET pwquality) +endif() + +find_path(PWQuality_INCLUDE_DIR NAMES pwquality.h + HINTS + ${PC_PWQuality_INCLUDE_DIRS} +) +mark_as_advanced(PWQuality_INCLUDE_DIR) + +find_library(PWQuality_LIBRARY NAMES pwquality + HINTS + ${PC_PWQuality_LIBRARY_DIRS} +) +mark_as_advanced(PWQuality_LIBRARY) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PWQuality + REQUIRED_VARS + PWQuality_LIBRARY PWQuality_INCLUDE_DIR +) + +if(PWQuality_FOUND) + set(PWQUALITY_INCLUDE_DIRS ${PWQuality_INCLUDE_DIR}) + set(PWQUALITY_LIBRARIES ${PWQuality_LIBRARY}) +endif() diff --git a/cmake/Modules/FindPixman.cmake b/cmake/Modules/FindPixman.cmake index f024b71a..a6f2fad2 100644 --- a/cmake/Modules/FindPixman.cmake +++ b/cmake/Modules/FindPixman.cmake @@ -1,13 +1,49 @@ -find_package(PkgConfig) - -if (PKG_CONFIG_FOUND) - pkg_check_modules(PIXMAN pixman-1) -else() - find_path(PIXMAN_INCLUDE_DIRS NAMES pixman.h PATH_SUFFIXES pixman-1) - find_library(PIXMAN_LIBRARIES NAMES pixman-1) - find_package_handle_standard_args(PIXMAN DEFAULT_MSG PIXMAN_LIBRARIES PIXMAN_INCLUDE_DIRS) +#[=======================================================================[.rst: +FindPixman +---------- + +Find the Pixman library + +Result variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables if found: + +``PIXMAN_INCLUDE_DIRS`` + where to find pixman.h, etc. +``PIXMAN_LIBRARIES`` + the libraries to link against to use Pixman. +``PIXMAN_FOUND`` + TRUE if found + +#]=======================================================================] + +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_Pixman QUIET pixman-1) endif() -if(Pixman_FIND_REQUIRED AND NOT PIXMAN_FOUND) - message(FATAL_ERROR "Could not find Pixman") +find_path(Pixman_INCLUDE_DIR NAMES pixman.h + PATH_SUFFIXES + pixman-1 + HINTS + ${PC_Pixman_INCLUDE_DIRS} +) +mark_as_advanced(Pixman_INCLUDE_DIR) + +find_library(Pixman_LIBRARY NAMES pixman-1 + HINTS + ${PC_Pixman_LIBRARY_DIRS} +) +mark_as_advanced(Pixman_LIBRARY) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Pixman + REQUIRED_VARS + Pixman_LIBRARY Pixman_INCLUDE_DIR +) + +if(Pixman_FOUND) + set(PIXMAN_INCLUDE_DIRS ${Pixman_INCLUDE_DIR}) + set(PIXMAN_LIBRARIES ${Pixman_LIBRARY}) endif() diff --git a/cmake/Modules/FindSELinux.cmake b/cmake/Modules/FindSELinux.cmake new file mode 100644 index 00000000..10be6736 --- /dev/null +++ b/cmake/Modules/FindSELinux.cmake @@ -0,0 +1,47 @@ +#[=======================================================================[.rst: +FindSELinux +----------- + +Find the SELinux library + +Result variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables if found: + +``SELINUX_INCLUDE_DIRS`` + where to find selinux/selinux.h, etc. +``SELINUX_LIBRARIES`` + the libraries to link against to use libselinux. +``SELINUX_FOUND`` + TRUE if found + +#]=======================================================================] + +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_SELinux QUIET libselinux) +endif() + +find_path(SELinux_INCLUDE_DIR NAMES selinux/selinux.h + HINTS + ${PC_SELinux_INCLUDE_DIRS} +) +mark_as_advanced(SELinux_INCLUDE_DIR) + +find_library(SELinux_LIBRARY NAMES selinux + HINTS + ${PC_SELinux_LIBRARY_DIRS} +) +mark_as_advanced(SELinux_LIBRARY) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(SELinux + REQUIRED_VARS + SELinux_LIBRARY SELinux_INCLUDE_DIR +) + +if(SELinux_FOUND) + set(SELINUX_INCLUDE_DIRS ${SELinux_INCLUDE_DIR}) + set(SELINUX_LIBRARIES ${SELinux_LIBRARY}) +endif() diff --git a/cmake/Modules/FindSWScale.cmake b/cmake/Modules/FindSWScale.cmake new file mode 100644 index 00000000..61edb595 --- /dev/null +++ b/cmake/Modules/FindSWScale.cmake @@ -0,0 +1,47 @@ +#[=======================================================================[.rst: +FindSWScale +----------- + +Find the FFmpeg swscale library + +Result variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables if found: + +``SWSCALE_INCLUDE_DIRS`` + where to find libswscale/swscale.h, etc. +``SWSCALE_LIBRARIES`` + the libraries to link against to use swscale. +``SWSCALE_FOUND`` + TRUE if found + +#]=======================================================================] + +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_SWScale QUIET libswscale) +endif() + +find_path(SWScale_INCLUDE_DIR NAMES libswscale/swscale.h + HINTS + ${PC_SWScale_INCLUDE_DIRS} +) +mark_as_advanced(SWScale_INCLUDE_DIR) + +find_library(SWScale_LIBRARY NAMES swscale + HINTS + ${PC_SWScale_LIBRARY_DIRS} +) +mark_as_advanced(SWScale_LIBRARY) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(SWScale + REQUIRED_VARS + SWScale_LIBRARY SWScale_INCLUDE_DIR +) + +if(SWScale_FOUND) + set(SWSCALE_INCLUDE_DIRS ${SWScale_INCLUDE_DIR}) + set(SWSCALE_LIBRARIES ${SWScale_LIBRARY}) +endif() diff --git a/cmake/Modules/FindSystemd.cmake b/cmake/Modules/FindSystemd.cmake new file mode 100644 index 00000000..1a3e40f5 --- /dev/null +++ b/cmake/Modules/FindSystemd.cmake @@ -0,0 +1,47 @@ +#[=======================================================================[.rst: +FindSystemd +----------- + +Find the systemd library + +Result variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables if found: + +``SYSTEMD_INCLUDE_DIRS`` + where to find systemd/sd-daemon.h, etc. +``SYSTEMD_LIBRARIES`` + the libraries to link against to use libsystemd. +``SYSTEMD_FOUND`` + TRUE if found + +#]=======================================================================] + +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_Systemd QUIET libsystemd) +endif() + +find_path(Systemd_INCLUDE_DIR NAMES systemd/sd-daemon.h + HINTS + ${PC_Systemd_INCLUDE_DIRS} +) +mark_as_advanced(Systemd_INCLUDE_DIR) + +find_library(Systemd_LIBRARY NAMES systemd + HINTS + ${PC_Systemd_LIBRARY_DIRS} +) +mark_as_advanced(Systemd_LIBRARY) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Systemd + REQUIRED_VARS + Systemd_LIBRARY Systemd_INCLUDE_DIR +) + +if(Systemd_FOUND) + set(SYSTEMD_INCLUDE_DIRS ${Systemd_INCLUDE_DIR}) + set(SYSTEMD_LIBRARIES ${Systemd_LIBRARY}) +endif() |