Skip to content

Commit

Permalink
Merge pull request ceph#8916 from linuxbox2/xio-cmake
Browse files Browse the repository at this point in the history
cmake: <UPPERCASED_NAME>_FOUND in Findxio.cmake

Reviewed-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed May 4, 2016
2 parents 5f27957 + 4df918a commit 891082d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ endif(CRYPTOPP_FOUND)
option(WITH_XIO "Enable XIO messaging" OFF)
if(WITH_XIO)
find_package(xio REQUIRED)
set(HAVE_XIO ${Xio_FOUND})
set(HAVE_XIO ${XIO_FOUND})
endif(WITH_XIO)

#option for RGW
Expand Down
28 changes: 14 additions & 14 deletions cmake/modules/Findxio.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# - Find libxio
# Find libxio transport library
#
# Xio_INCLUDE_DIR - libxio include dir
# Xio_LIBRARIES - List of libraries
# Xio_FOUND - True if libxio found.
# XIO_INCLUDE_DIR - libxio include dir
# XIO_LIBRARIES - List of libraries
# XIO_FOUND - True if libxio found.

set(_xio_include_path ${HT_DEPENDENCY_INCLUDE_DIR})
set(_xio_lib_path ${HT_DEPENDENCY_LIB_DIR})
Expand All @@ -15,25 +15,25 @@ else()
list(APPEND _xio_lib_path /lib /usr/lib /usr/local/lib /opt/accelio/lib)
endif()

find_path(Xio_INCLUDE_DIR libxio.h NO_DEFAULT_PATH PATHS ${_xio_include_path})
find_path(XIO_INCLUDE_DIR libxio.h NO_DEFAULT_PATH PATHS ${_xio_include_path})

find_library(Xio_LIBRARY NO_DEFAULT_PATH NAMES xio PATHS ${_xio_lib_path})
set(Xio_LIBRARIES ${Xio_LIBRARY})
find_library(XIO_LIBRARY NO_DEFAULT_PATH NAMES xio PATHS ${_xio_lib_path})
set(XIO_LIBRARIES ${XIO_LIBRARY})

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(xio DEFAULT_MSG Xio_LIBRARY Xio_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(xio DEFAULT_MSG XIO_LIBRARY XIO_INCLUDE_DIR)

if (Xio_FOUND)
message(STATUS "Found Xio: ${Xio_INCLUDE_DIR} ${Xio_LIBRARY}")
if (XIO_FOUND)
message(STATUS "Found Xio: ${XIO_INCLUDE_DIR} ${XIO_LIBRARY}")
else ()
message(STATUS "Not Found Xio: ${Xio_INCLUDE_DIR} ${Xio_LIBRARY}")
if (Xio_FIND_REQUIRED)
message(STATUS "Looked for Xio libraries named ${Xio_NAMES}.")
message(STATUS "Not Found Xio: ${XIO_INCLUDE_DIR} ${XIO_LIBRARY}")
if (XIO_FIND_REQUIRED)
message(STATUS "Looked for Xio libraries named ${XIO_NAMES}.")
message(FATAL_ERROR "Could NOT find Xio library")
endif ()
endif ()

mark_as_advanced(
Xio_LIBRARY
Xio_INCLUDE_DIR
XIO_LIBRARY
XIO_INCLUDE_DIR
)
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE)

if(HAVE_XIO)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${Xio_INCLUDE_DIR}")
list(APPEND EXTRALIBS ${Xio_LIBRARY} pthread rt)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${XIO_INCLUDE_DIR}")
list(APPEND EXTRALIBS ${XIO_LIBRARY} pthread rt)
endif(HAVE_XIO)

# sort out which allocator to use
Expand Down
4 changes: 2 additions & 2 deletions src/test/messenger/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if(HAVE_XIO)
)
target_link_libraries(xio_server
os global common ${Boost_REGEX_LIBRARY}
${Xio_LIBRARY} pthread rt
${XIO_LIBRARY} pthread rt
${EXTRALIBS}
${CMAKE_DL_LIBS}
)
Expand All @@ -36,7 +36,7 @@ if(HAVE_XIO)
)
target_link_libraries(xio_client
os global common ${Boost_REGEX_LIBRARY}
${Xio_LIBRARY} pthread rt
${XIO_LIBRARY} pthread rt
${EXTRALIBS}
${CMAKE_DL_LIBS}
)
Expand Down

0 comments on commit 891082d

Please sign in to comment.