diff options
author | Naios <naios-dev@live.de> | 2015-10-08 03:22:47 +0200 |
---|---|---|
committer | Naios <naios-dev@live.de> | 2016-03-24 13:53:10 +0100 |
commit | 46daaf768911f91a9a65bebc7e3fa62400c4ccad (patch) | |
tree | 88dccde4aaf6d619f2e88614fbd4ff055ab4918b /dep/efsw/CMakeLists.txt | |
parent | d024314b1393b65f264da8ca591bd53e90873828 (diff) |
Dep: Add efsw (entropia file system watcher)
* Uses system API's which reduces the overhead
instead of checking periodically for changes.
* Will be used in the hotswap system to reload
shared libraries on changes.
Diffstat (limited to 'dep/efsw/CMakeLists.txt')
-rw-r--r-- | dep/efsw/CMakeLists.txt | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/dep/efsw/CMakeLists.txt b/dep/efsw/CMakeLists.txt new file mode 100644 index 00000000000..81a1d20b204 --- /dev/null +++ b/dep/efsw/CMakeLists.txt @@ -0,0 +1,85 @@ +if (WITH_DYNAMIC_LINKING) + set(SRCS + src/efsw/DirectorySnapshot.cpp + src/efsw/DirectorySnapshotDiff.cpp + src/efsw/DirWatcherGeneric.cpp + src/efsw/FileInfo.cpp + src/efsw/FileSystem.cpp + src/efsw/FileWatcher.cpp + src/efsw/FileWatcherCWrapper.cpp + src/efsw/FileWatcherGeneric.cpp + src/efsw/FileWatcherImpl.cpp + src/efsw/Log.cpp + src/efsw/Mutex.cpp + src/efsw/String.cpp + src/efsw/System.cpp + src/efsw/Thread.cpp + src/efsw/Watcher.cpp + src/efsw/WatcherGeneric.cpp) + + if(WIN32) + list(APPEND SRCS + src/efsw/platform/win/FileSystemImpl.cpp + src/efsw/platform/win/MutexImpl.cpp + src/efsw/platform/win/SystemImpl.cpp + src/efsw/platform/win/ThreadImpl.cpp) + else() + list(APPEND SRCS + src/efsw/platform/posix/FileSystemImpl.cpp + src/efsw/platform/posix/MutexImpl.cpp + src/efsw/platform/posix/SystemImpl.cpp + src/efsw/platform/posix/ThreadImpl.cpp) + endif() + + if (WIN32) + list(APPEND SRCS + src/efsw/WatcherWin32.cpp + src/efsw/FileWatcherWin32.cpp) + elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") + list(APPEND SRCS + src/efsw/FileWatcherInotify.cpp + src/efsw/WatcherInotify.cpp) + + if (NOT EXISTS "/usr/include/sys/inotify.h" AND NOT EXISTS "/usr/local/include/sys/inotify.h") + add_definitions(-DEFSW_INOTIFY_NOSYS) + endif() + elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR APPLE) + list(APPEND SRCS + src/efsw/FileWatcherKqueue.cpp + src/efsw/WatcherKqueue.cpp) + + if (APPLE) + list(APPEND SRCS + src/efsw/FileWatcherFSEvents.cpp + src/efsw/WatcherFSEvents.cpp) + + exec_program(uname ARGS -v OUTPUT_VARIABLE OSX_VERSION) + string(REGEX MATCH "[0-9]+" OSX_VERSION ${OSX_VERSION}) + if (NOT OSX_VERSION GREATER 9) + add_definitions(-DEFSW_FSEVENTS_NOT_SUPPORTED) + endif() + + set(OPTIONAL_MAC_LINK_LIBRARIES "-framework CoreFoundation" "-framework CoreServices") + endif() + endif() + + add_library(efsw STATIC ${SRCS}) + + target_include_directories(efsw + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/src) + + target_link_libraries(efsw + PUBLIC + threads + ${OPTIONAL_MAC_LINK_LIBRARIES}) + + set_target_properties(efsw + PROPERTIES + FOLDER + "dep") +else() + add_library(efsw INTERFACE) +endif() |