File: dashelConfig.cmake.in

package info (click to toggle)
dashel 1.3.3-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,208 kB
  • sloc: cpp: 3,196; ansic: 181; makefile: 10
file content (49 lines) | stat: -rw-r--r-- 1,705 bytes parent folder | download
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# - Config file for the dashel package
# It defines the following variables
# dashel_INCLUDE_DIRS - include directories for dashel
# dashel_LIBRARIES - libraries to link against

# Dependencies of Dashel
if (WIN32)
	set(EXTRA_LIBS winspool ws2_32 setupapi)
else (WIN32)
	# only if we build static library we need to link the add_dependencies
	# of Dashel to the final versions
	set (NO_LINK_DASHEL_DEPS @BUILD_SHARED_LIBS@)
	if (NOT NO_LINK_DASHEL_DEPS)
		if (APPLE)
			find_library(COREFOUNDATION_LIBRARY CoreFoundation)
			find_library(IOKIT_LIBRARY IOKit)
			mark_as_advanced(COREFOUNDATION_LIBRARY)
			mark_as_advanced(IOKIT_LIBRARY)
			find_library(POLL_LIBRARY poll)
			set(EXTRA_LIBS ${COREFOUNDATION_LIBRARY} ${IOKIT_LIBRARY} ${POLL_LIBRARY})
		else (APPLE)
			# look for libudev
			find_path(UDEV_INCLUDE_DIR libudev.h)
			find_library(UDEV_LIBS udev)
			if (UDEV_INCLUDE_DIR AND UDEV_LIBS)
				message(STATUS "libudev found")
				include_directories(${UDEV_INCLUDE_DIR})
				set(EXTRA_LIBS ${UDEV_LIBS})
				add_definitions(-DUSE_LIBUDEV)
			else ()
				find_package(PkgConfig)
				pkg_check_modules(HAL hal)
				if (${HAL_FOUND})
					message(STATUS "hal found")
					include_directories(${HAL_INCLUDE_DIRS})
					set(EXTRA_LIBS ${HAL_LIBRARIES})
					add_definitions(-DUSE_HAL)
				endif (${HAL_FOUND})
			endif ()
		endif (APPLE)
	endif ()
endif (WIN32)

# Standard search
find_path(dashel_INCLUDE_DIRS dashel/dashel.h CMAKE_FIND_ROOT_PATH_BOTH)
find_library(dashel_LIBRARY dashel CMAKE_FIND_ROOT_PATH_BOTH)
set(dashel_LIBRARIES ${dashel_LIBRARY} ${EXTRA_LIBS})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(dashel DEFAULT_MSG dashel_LIBRARIES dashel_INCLUDE_DIRS)