summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/CMakeLists.txt2
-rw-r--r--lib/compat/CMakeLists.txt12
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index ca08fd7..eacfb9c 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -1,6 +1,8 @@
file(GLOB SOURCES "*.c" "*.h")
file(GLOB HEADERS "../include/uvcgadget/*.h")
+add_subdirectory(compat)
+
add_library(uvcgadget ${SOURCES})
set_target_properties(uvcgadget PROPERTIES PUBLIC_HEADER "${HEADERS}")
diff --git a/lib/compat/CMakeLists.txt b/lib/compat/CMakeLists.txt
new file mode 100644
index 0000000..5fd6db4
--- /dev/null
+++ b/lib/compat/CMakeLists.txt
@@ -0,0 +1,12 @@
+include(CheckFunctionExists)
+include(CheckIncludeFile)
+
+check_include_file(dirent.h HAVE_DIRENT_H)
+
+check_function_exists(glob HAVE_GLOB)
+if(NOT HAVE_GLOB)
+ set(SOURCES "${SOURCES}"
+ "${CMAKE_CURRENT_SOURCE_DIR}/glob.c"
+ "${CMAKE_SOURCE_DIR}/include/compat/glob.h"
+ PARENT_SCOPE)
+endif()