summaryrefslogtreecommitdiff
path: root/EdebugConfig.cmake.in
blob: 302753e2e93eee393cd4c5b8b7f619413edad4c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# - Try to find edebug
# Once done this will define
#  EDEBUG_FOUND - System has edebug
#  EDEBUG_INCLUDE_DIRS - The edebug include directories
#  EDEBUG_LIBRARIES - The libraries needed to use edebug
#  EDEBUG_DEFINITIONS - Compiler switches required for using edebug

set(MY_PKG edebug)

find_package(PkgConfig)
if ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER "2.8.1")
   # "QUIET" was introduced in 2.8.2
   set(_QUIET QUIET)
endif ()
pkg_check_modules(PC_LIBEDEBUG ${_QUIET} ${MY_PKG})

find_library(EDEBUG_LIBRARY
             NAMES ${PC_LIBEDEBUG_LIBRARIES}
             HINTS ${PC_LIBEDEBUG_LIBDIR} ${PC_LIBEDEBUG_LIBRARY_DIRS} )

set(EDEBUG_DEFINITIONS ${PC_LIBEDEBUG_CFLAGS_OTHER})
set(EDEBUG_LIBRARIES ${PC_LIBEDEBUG_LIBRARIES})
set(EDEBUG_INCLUDE_DIRS ${PC_LIBEDEBUG_INCLUDE_DIRS})

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set EDEBUG_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(${MY_PKG} DEFAULT_MSG
   EDEBUG_LIBRARIES EDEBUG_INCLUDE_DIRS)

mark_as_advanced(EDEBUG_INCLUDE_DIRS EDEBUG_LIBRARY EDEBUG_LIBRARIES EDEBUG_DEFINITIONS)