summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Keeler <jacob.keeler@livioradio.com>2016-07-26 10:30:15 -0400
committerJacob Keeler <jacob.keeler@livioradio.com>2016-07-26 10:32:54 -0400
commitfdf308beee4f25b4b883194dd5c9c2ad0f46b904 (patch)
tree19beb0e27d26d592beb5eacd87024b62447a613f
parent0843cf4323fe0c177fb9b211357c6c35112e1147 (diff)
downloadsdl_core-hotfix/cmake_check_for_udev_openssl.tar.gz
Check for OpenSSL and UDev while running cmakehotfix/cmake_check_for_udev_openssl
-rw-r--r--CMakeLists.txt2
-rw-r--r--cmake/Modules/FindUDev.cmake53
2 files changed, 55 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1d63531e75..c42cf545b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -199,6 +199,7 @@ endif()
if (BUILD_USB_SUPPORT)
add_definitions(-DUSB_SUPPORT)
+ find_package(UDev REQUIRED)
message(STATUS "USB support is enabled")
endif()
@@ -614,6 +615,7 @@ add_custom_target(install-3rd_party
WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY}
)
+find_package(OpenSSL REQUIRED)
if(ENABLE_LOG)
include_directories ( ${LOG4CXX_INCLUDE_DIRECTORY} )
endif()
diff --git a/cmake/Modules/FindUDev.cmake b/cmake/Modules/FindUDev.cmake
new file mode 100644
index 0000000000..cdc8743777
--- /dev/null
+++ b/cmake/Modules/FindUDev.cmake
@@ -0,0 +1,53 @@
+# razor-de: Configure libudev environment
+#
+# UDEV_FOUND - system has a libudev
+# UDEV_INCLUDE_DIR - where to find header files
+# UDEV_LIBRARIES - the libraries to link against udev
+# UDEV_STABLE - it's true when is the version greater or equals to 143 - version when the libudev was stabilized in its API
+#
+# copyright (c) 2011 Petr Vanek <petr@scribus.info>
+# Redistribution and use is allowed according to the terms of the BSD license.
+#
+
+FIND_PATH(
+ UDEV_INCLUDE_DIR
+ libudev.h
+ /usr/include
+ /usr/local/include
+ ${UDEV_PATH_INCLUDES}
+)
+
+FIND_LIBRARY(
+ UDEV_LIBRARIES
+ NAMES udev libudev
+ PATHS
+ /usr/lib${LIB_SUFFIX}
+ /usr/local/lib${LIB_SUFFIX}
+ ${UDEV_PATH_LIB}
+)
+
+IF (UDEV_LIBRARIES AND UDEV_INCLUDE_DIR)
+ SET(UDEV_FOUND "YES")
+ execute_process(COMMAND pkg-config --atleast-version=143 libudev RESULT_VARIABLE UDEV_STABLE)
+ # retvale is 0 of the condition is "true" so we need to negate the value...
+ if (UDEV_STABLE)
+set(UDEV_STABLE 0)
+ else (UDEV_STABLE)
+set(UDEV_STABLE 1)
+ endif (UDEV_STABLE)
+ message(STATUS "libudev stable: ${UDEV_STABLE}")
+ENDIF (UDEV_LIBRARIES AND UDEV_INCLUDE_DIR)
+
+IF (UDEV_FOUND)
+ MESSAGE(STATUS "Found UDev: ${UDEV_LIBRARIES}")
+ MESSAGE(STATUS " include: ${UDEV_INCLUDE_DIR}")
+ELSE (UDEV_FOUND)
+ MESSAGE(STATUS "UDev not found.")
+ MESSAGE(STATUS "UDev: You can specify includes: -DUDEV_PATH_INCLUDES=/opt/udev/include")
+ MESSAGE(STATUS " currently found includes: ${UDEV_INCLUDE_DIR}")
+ MESSAGE(STATUS "UDev: You can specify libs: -DUDEV_PATH_LIB=/opt/udev/lib")
+ MESSAGE(STATUS " currently found libs: ${UDEV_LIBRARIES}")
+ IF (UDev_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find UDev library")
+ ENDIF (UDev_FIND_REQUIRED)
+ENDIF (UDEV_FOUND) \ No newline at end of file