set the docroot to the current working directory if none is specified, fixes random...
[project/uhttpd.git] / CMakeLists.txt
index 0d9dcd4..cd22fc7 100644 (file)
@@ -1,6 +1,9 @@
 cmake_minimum_required(VERSION 2.6)
 
 PROJECT(uhttpd C)
+
+INCLUDE (CheckFunctionExists)
+
 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
 ADD_DEFINITIONS(-Os -Wall -Werror -Wmissing-declarations --std=gnu99 -g3)
 
@@ -24,6 +27,11 @@ IF(TLS_SUPPORT)
        ADD_DEFINITIONS(-DHAVE_TLS)
 ENDIF()
 
+CHECK_FUNCTION_EXISTS(getspnam HAVE_SHADOW)
+IF(HAVE_SHADOW)
+    ADD_DEFINITIONS(-DHAVE_SHADOW)
+ENDIF()
+
 ADD_EXECUTABLE(uhttpd ${SOURCES})
 TARGET_LINK_LIBRARIES(uhttpd ubox dl ${LIBS})