Update CMake environment and add new tool
[umurmur.git] / cmake / Modules / Tools.cmake
1 function(EnableSHMAPI)
2   if(NOT USE_SHAREDMEMORY_API)
3     message(STATUS "Enabling shared memory API")
4     set(USE_SHAREDMEMORY_API ON CACHE BOOL "" FORCE)
5   endif()
6 endfunction()
7
8 set(TOOLS_DIR "${PROJECT_SOURCE_DIR}/tools")
9
10 if(EXISTS "${TOOLS_DIR}/umurmur-monitor/CMakeLists.txt")
11   set(UMURMUR_MONITOR_DIR "${TOOLS_DIR}/umurmur-monitor")
12   option(BUILD_UMURMUR_MONITOR "Build the umurmur-monitor utility" OFF)
13 endif()
14
15 if(EXISTS "${TOOLS_DIR}/numurmon/CMakeLists.txt")
16   set(NUMURMON_DIR "${TOOLS_DIR}/numurmon")
17   option(BUILD_NUMURMON "Build the numurmon utility" OFF)
18 endif()
19
20 if(BUILD_UMURMUR_MONITOR OR BUILD_NUMURMON)
21   set(UMURMUR_ROOT_PATH "${PROJECT_SOURCE_DIR}")
22   EnableSHMAPI()
23 endif()
24
25 if(BUILD_UMURMUR_MONITOR)
26   add_subdirectory(${UMURMUR_MONITOR_DIR})
27 endif()
28
29 if(BUILD_NUMURMON)
30   add_subdirectory(${NUMURMON_DIR})
31 endif()