Skip to content

Commit

Permalink
Ensure uuid-dev is present when building on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
zrax committed Jun 7, 2015
1 parent 974b971 commit a3ab76c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt
Expand Up @@ -10,6 +10,11 @@ if(WIN32)
endif(WIN32)

if(UNIX)
if(NOT APPLE)
find_package(Uuid REQUIRED)
include_directories(${Uuid_INCLUDE_DIR})
endif()

set(pnUUID_SOURCES ${pnUUID_SOURCES} pnUUID_Unix.cpp)
endif(UNIX)

Expand All @@ -23,7 +28,7 @@ if(WIN32)
target_link_libraries(pnUUID pnUtils)
target_link_libraries(pnUUID rpcrt4)
elseif(NOT APPLE)
target_link_libraries(pnUUID uuid)
target_link_libraries(pnUUID ${Uuid_LIBRARIES})
endif(WIN32)

source_group("Source Files" FILES ${pnUUID_SOURCES})
Expand Down
30 changes: 30 additions & 0 deletions cmake/FindUuid.cmake
@@ -0,0 +1,30 @@
if(Uuid_INCLUDE_DIR AND Uuid_LIBRARY)
set(Uuid_FIND_QUIETLY TRUE)
endif()


find_path(Uuid_INCLUDE_DIR uuid/uuid.h
/usr/local/include
/usr/include
)

find_library(Uuid_LIBRARY NAMES uuid
PATHS /usr/local/lib /usr/lib
)

set(Uuid_LIBRARIES ${Uuid_LIBRARY})


if(Uuid_INCLUDE_DIR AND Uuid_LIBRARY)
set(Uuid_FOUND TRUE)
endif()

if(Uuid_FOUND)
if(NOT Uuid_FIND_QUIETLY)
message(STATUS "Found libuuid: ${Uuid_INCLUDE_DIR}")
endif()
else()
if(Uuid_FIND_REQUIRED)
message(FATAL_ERROR "Could not find libuuid")
endif()
endif()

0 comments on commit a3ab76c

Please sign in to comment.