Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Should fix GH-2

  • Loading branch information...
commit 630abfbc5b2cafc352fae4d93aebb5d25678fc64 1 parent ca31f83
@mkoppanen authored
Showing with 37 additions and 0 deletions.
  1. +4 −0 CMakeLists.txt
  2. +33 −0 cmake/FindLibuuid.cmake
View
4 CMakeLists.txt
@@ -19,20 +19,24 @@ ENDIF ()
FIND_PACKAGE(Boost COMPONENTS program_options thread REQUIRED)
FIND_PACKAGE(ZeroMQ REQUIRED)
FIND_PACKAGE(kyotocabinet REQUIRED)
+FIND_PACKAGE(libuuid REQUIRED)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${ZeroMQ_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${kyotocabinet_INCLUDE_DIRS})
+INCLUDE_DIRECTORIES(${libuuid_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(src/)
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
LINK_DIRECTORIES(${ZeroMQ_LIBRARY_DIRS})
LINK_DIRECTORIES(${kyotocabinet_LIBRARY_DIRS})
+LINK_DIRECTORIES(${libuuid_LIBRARY_DIRS})
ADD_EXECUTABLE(${MODULE_NAME} src/main.cpp src/manager.cpp src/store.cpp src/visitor.cpp src/reaper.cpp)
TARGET_LINK_LIBRARIES(${MODULE_NAME} ${Boost_LIBRARIES})
TARGET_LINK_LIBRARIES(${MODULE_NAME} ${ZeroMQ_LIBRARIES})
TARGET_LINK_LIBRARIES(${MODULE_NAME} ${kyotocabinet_LIBRARIES})
+TARGET_LINK_LIBRARIES(${MODULE_NAME} ${libuuid_LIBRARIES})
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
TARGET_LINK_LIBRARIES(${MODULE_NAME} uuid)
View
33 cmake/FindLibuuid.cmake
@@ -0,0 +1,33 @@
+# - Try to find libuuid
+# Once done, this will define
+#
+# libuuid_FOUND - system has libuuid
+# libuuid_INCLUDE_DIRS - the libuuid include directories
+# libuuid_LIBRARIES - link these to use libuuid
+
+include(LibFindMacros)
+
+IF (UNIX)
+ # Use pkg-config to get hints about paths
+ libfind_pkg_check_modules(libuuid_PKGCONF libuuid)
+
+ # Include dir
+ find_path(libuuid_INCLUDE_DIR
+ NAMES uuid/uuid.h
+ PATHS ${LIBUUID_ROOT}/include ${libuuid_PKGCONF_INCLUDE_DIRS}
+ )
+
+ # Finally the library itself
+ IF(NOT APPLE)
+ find_library(libuuid_LIBRARY
+ NAMES uuid
+ PATHS ${LIBUUID_ROOT}/lib ${libuuid_PKGCONF_LIBRARY_DIRS}
+ )
+ set(libuuid_PROCESS_LIBS libuuid_LIBRARY libuuid_LIBRARIES)
+ ENDIF(NOT APPLE)
+ENDIF()
+
+# Set the include dir variables and the libraries and let libfind_process do the rest.
+# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
+set(libuuid_PROCESS_INCLUDES libuuid_INCLUDE_DIR libuuid_INCLUDE_DIRS)
+libfind_process(libuuid)
Please sign in to comment.
Something went wrong with that request. Please try again.