Skip to content

[#11,#35,irods/irods#8102,irods/irods#8330] Update for new CMake, bump fuse minimum version #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 33 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,38 @@
cmake_minimum_required(VERSION 3.5.0 FATAL_ERROR) #CPACK_DEBIAN_<COMPONENT>_PACKAGE_NAME
cmake_minimum_required(VERSION 3.12...3.18 FATAL_ERROR)
if (POLICY CMP0109)
# find_program requires permission to execute but not to read
cmake_policy(SET CMP0109 NEW)
endif()
if (POLICY CMP0121)
# Detect invalid indices in list()
cmake_policy(SET CMP0121 NEW)
endif()
if (POLICY CMP0125)
# Consistent behavior for cache variables managed by find_*()
cmake_policy(SET CMP0125 NEW)
endif()
if (POLICY CMP0130)
# Diagnose condition evaluation errors in while()
cmake_policy(SET CMP0130 NEW)
endif()
if (POLICY CMP0132)
# Consistent handling of compiler environment variables
cmake_policy(SET CMP0132 NEW)
endif()
if (POLICY CMP0140)
# Check validity of return() params
cmake_policy(SET CMP0140 NEW)
endif()
if (POLICY CMP0167)
# Bypass FindBoost module
cmake_policy(SET CMP0167 NEW)
endif()

list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

set(MUNGEFS_VERSION_MAJOR "1")
set(MUNGEFS_VERSION_MINOR "0")
set(MUNGEFS_VERSION_PATCH "7")
set(MUNGEFS_VERSION_PATCH "8")
set(MUNGEFS_VERSION "${MUNGEFS_VERSION_MAJOR}.${MUNGEFS_VERSION_MINOR}.${MUNGEFS_VERSION_PATCH}")

set(MUNGEFS_CXX_STANDARD 14)
Expand Down Expand Up @@ -36,7 +64,7 @@ find_package(Boost REQUIRED
COMPONENTS system filesystem program_options)

find_package(LibArchive REQUIRED)
find_package(FUSE 2.6 REQUIRED)
find_package(FUSE 2.9 REQUIRED)
find_package(AvroCpp REQUIRED)
find_package(cppzmq REQUIRED)

Expand All @@ -50,7 +78,7 @@ add_executable(
target_link_libraries(
mungefs
PRIVATE
${FUSE_LIBRARIES}
FUSE::FUSE
cppzmq::cppzmq
Avro::AvroCpp
Boost::system
Expand All @@ -62,7 +90,6 @@ target_include_directories(
mungefs
PRIVATE
"${CMAKE_CURRENT_BINARY_DIR}/include"
${FUSE_INCLUDE_DIRS}
)

target_compile_definitions(mungefs PRIVATE ${MUNGEFS_COMPILE_DEFINITIONS})
Expand All @@ -77,7 +104,7 @@ add_executable(
target_link_libraries(
mungefsctl
PRIVATE
${FUSE_LIBRARIES}
FUSE::FUSE
cppzmq::cppzmq
Avro::AvroCpp
Boost::system
Expand Down
12 changes: 10 additions & 2 deletions cmake/FindAvroCpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,23 @@ TODO
#]=======================================================================]

cmake_policy(PUSH)
cmake_policy(SET CMP0054 NEW) # Only interpret if() arguments as variables or keywords when unquoted
cmake_minimum_required(VERSION 3.12...3.18 FATAL_ERROR)
if (POLICY CMP0125)
# Consistent behavior for cache variables managed by find_*()
cmake_policy(SET CMP0125 NEW)
endif()
if (POLICY CMP0132)
# Consistent handling of compiler environment variables
cmake_policy(SET CMP0132 NEW)
endif()

find_path(AVROCPP_INCLUDE_DIR NAMES avro/AvroParse.hh)
find_library(AVROCPP_LIBRARY NAMES avrocpp libavrocpp)
find_program(AVROCPP_AVROGEN_EXECUTABLE NAMES avrogencpp)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(AvroCpp
REQUIRED_VARS AVROCPP_INCLUDE_DIR AVROCPP_LIBRARY AVROCPP_AVROGEN_EXECUTABLE)
REQUIRED_VARS AVROCPP_LIBRARY AVROCPP_INCLUDE_DIR AVROCPP_AVROGEN_EXECUTABLE)

if (AvroCpp_FOUND)
if (NOT TARGET Avro::AvroCpp)
Expand Down
Loading