p9y
[awesomized/libmemcached] / src / p9y / CMakeLists.txt
diff --git a/src/p9y/CMakeLists.txt b/src/p9y/CMakeLists.txt
new file mode 100644 (file)
index 0000000..1734f0b
--- /dev/null
@@ -0,0 +1,36 @@
+add_library(p9y STATIC
+    getopt.hpp
+    libgen.hpp
+    realpath.hpp
+    socket.hpp
+    poll.hpp
+    random.hpp
+    index.hpp
+    p9y.cpp
+    )
+
+target_include_directories(p9y PRIVATE
+    .
+    ${CMAKE_SOURCE_DIR}/include
+    ${CMAKE_BINARY_DIR}
+    ${CMAKE_BINARY_DIR}/include
+    )
+
+if(NOT HAVE_GETOPT_H)
+    target_sources(p9y PRIVATE getopt.c)
+endif()
+if(NOT HAVE_LIBGEN_H)
+    target_sources(p9y PRIVATE libgen.c)
+endif()
+if(NOT HAVE_REALPATH)
+    target_sources(p9y PRIVATE realpath.c)
+endif()
+if(WIN32)
+    target_sources(p9y PRIVATE socket.c)
+endif()
+if(NOT HAVE_POLL_H AND NOT HAVE_SYS_POLL_H AND NOT WIN32)
+    target_sources(p9y PRIVATE poll.c)
+endif()
+if(NOT HAVE_GETTIMEOFDAY)
+    target_sources(p9y PRIVATE gettimeofday.cpp)
+endif()