Skip to content

Commit

Permalink
CMake Updates for Boost Versioning Fix (#945)
Browse files Browse the repository at this point in the history
* cmake updates

* behavior put in cmake function

* usFunctionBoostPath update
  • Loading branch information
tcormackMW authored and insi-eb committed Oct 24, 2023
1 parent 82e4703 commit 12135eb
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ include(usFunctionGenerateBundleInit)
include(usMacroCreateBundle)
include(usFunctionCreateTestBundle)
include(usFunctionCreateDSTestBundle)
include(usFunctionBoostPath)

if (US_COMPILER_CLANG OR US_COMPILER_APPLE_CLANG)
check_cxx_compiler_flag(-Wno-missing-braces HAS_MISSING_BRACES_FLAG)
Expand Down Expand Up @@ -879,6 +880,7 @@ install(EXPORT ${PROJECT_NAME}Targets
${US_CMAKE_DIR}/usFunctionGetResourceSource.cmake
${US_CMAKE_DIR}/usFunctionCheckResourceLinking.cmake
${US_CMAKE_DIR}/usFunctionCheckCompilerFlags.cmake
${US_CMAKE_DIR}/usFunctionBoostPath.cmake
)

install(FILES ${_install_cmake_scripts}
Expand Down
1 change: 1 addition & 0 deletions CppMicroServicesConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ include("@PACKAGE_CONFIG_CMAKE_DIR@/usFunctionGenerateBundleInit.cmake")
include("@PACKAGE_CONFIG_CMAKE_DIR@/usFunctionAddResources.cmake")
include("@PACKAGE_CONFIG_CMAKE_DIR@/usFunctionCheckCompilerFlags.cmake")
include("@PACKAGE_CONFIG_CMAKE_DIR@/usFunctionEmbedResources.cmake")
include("@PACKAGE_CONFIG_CMAKE_DIR@/usFunctionBoostPath.cmake")
include("@PACKAGE_CONFIG_CMAKE_DIR@/usFunctionCheckResourceLinking.cmake")
include("@PACKAGE_CONFIG_CMAKE_DIR@/usFunctionGetResourceSource.cmake")

Expand Down
17 changes: 17 additions & 0 deletions cmake/usFunctionBoostPath.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#
# Helper macro allowing to return path to boost library
#
# Usage:
# usFunctionBoostPath(USE_SYSTEM ${US_USE_SYSTEM_BOOST} CPPMS_SOURCE_DIR ${CppMicroServices_SOURCE_DIR}
# BOOST_DIR ${BOOST_INCLUDEDIR})


function(usFunctionBoostPath)
cmake_parse_arguments(Boost_Path "" "BOOST_SYSTEM;CPPMS_SOURCE_DIR;BOOST_DIR" "" ${ARGN})

if (Boost_Path_BOOST_SYSTEM)
set(_boost_library ${Boost_Path_BOOST_DIR} PARENT_SCOPE)
else()
set(_boost_library ${Boost_Path_CPPMS_SOURCE_DIR}/third_party/boost/include PARENT_SCOPE)
endif()
endfunction()
4 changes: 3 additions & 1 deletion compendium/ConfigurationAdmin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ target_include_directories(ConfigurationAdmin PRIVATE
${CppMicroServices_SOURCE_DIR}/third_party/googletest/googlemock/include
)

usFunctionBoostPath(BOOST_SYSTEM ${US_USE_SYSTEM_BOOST} CPPMS_SOURCE_DIR ${CppMicroServices_SOURCE_DIR} BOOST_DIR ${BOOST_INCLUDEDIR})

# There are warnings in the boost asio headers which are flagged as errors. Include the boost
# asio headers as system headers to ignore these warnings and not treat them as errors.
include_directories(SYSTEM ${CppMicroServices_SOURCE_DIR}/third_party/boost/include)
include_directories(SYSTEM ${_boost_library})
4 changes: 3 additions & 1 deletion compendium/ConfigurationAdmin/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ target_include_directories(ConfigurationAdminObjs PRIVATE
${CppMicroServices_SOURCE_DIR}/third_party/googletest/googlemock/include
)

usFunctionBoostPath(BOOST_SYSTEM ${US_USE_SYSTEM_BOOST} CPPMS_SOURCE_DIR ${CppMicroServices_SOURCE_DIR} BOOST_DIR ${BOOST_INCLUDEDIR})

# There are warnings in the boost asio headers which are flagged as errors. Include the boost
# asio headers as system headers to ignore these warnings and not treat them as errors.
include_directories(SYSTEM ${CppMicroServices_SOURCE_DIR}/third_party/boost/include)
include_directories(SYSTEM ${_boost_library})
4 changes: 3 additions & 1 deletion compendium/ConfigurationAdmin/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ include_directories(
${GMOCK_INCLUDE_DIRS}
)

usFunctionBoostPath(BOOST_SYSTEM ${US_USE_SYSTEM_BOOST} CPPMS_SOURCE_DIR ${CppMicroServices_SOURCE_DIR} BOOST_DIR ${BOOST_INCLUDEDIR})

# There are warnings in the boost asio headers which are flagged as errors. Include the boost
# asio headers as system headers to ignore these warnings and not treat them as errors.
include_directories(SYSTEM ${CppMicroServices_SOURCE_DIR}/third_party/boost/include)
include_directories(SYSTEM ${_boost_library})

if (US_COMPILER_CLANG OR US_COMPILER_APPLE_CLANG)
check_cxx_compiler_flag(-Wno-inconsistent-missing-override HAS_MISSING_OVERRIDE_FLAG)
Expand Down
4 changes: 3 additions & 1 deletion compendium/DeclarativeServices/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ include_directories(${CppMicroServices_SOURCE_DIR}/framework/include
${CppMicroServices_SOURCE_DIR}/cppmicroservices/cm/include
)

usFunctionBoostPath(BOOST_SYSTEM ${US_USE_SYSTEM_BOOST} CPPMS_SOURCE_DIR ${CppMicroServices_SOURCE_DIR} BOOST_DIR ${BOOST_INCLUDEDIR})

# There are warnings in the boost asio headers which are flagged as errors. Include the boost
# asio headers as system headers to ignore these warnings and not treat them as errors.
include_directories(SYSTEM ${CppMicroServices_SOURCE_DIR}/third_party/boost/include)
include_directories(SYSTEM ${_boost_library})
4 changes: 3 additions & 1 deletion compendium/DeclarativeServices/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ include_directories(${CppMicroServices_SOURCE_DIR}/framework/include
${CppMicroServices_SOURCE_DIR}/third_party/googletest/googlemock/include
)

usFunctionBoostPath(BOOST_SYSTEM ${US_USE_SYSTEM_BOOST} CPPMS_SOURCE_DIR ${CppMicroServices_SOURCE_DIR} BOOST_DIR ${BOOST_INCLUDEDIR})

# There are warnings in the boost asio headers which are flagged as errors. Include the boost
# asio headers as system headers to ignore these warnings and not treat them as errors.
include_directories(SYSTEM ${CppMicroServices_SOURCE_DIR}/third_party/boost/include)
include_directories(SYSTEM ${_boost_library})
4 changes: 3 additions & 1 deletion compendium/DeclarativeServices/test/bench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ include_directories(
${CMAKE_SOURCE_DIR}/third_party/benchmark/include
)

usFunctionBoostPath(BOOST_SYSTEM ${US_USE_SYSTEM_BOOST} CPPMS_SOURCE_DIR ${CppMicroServices_SOURCE_DIR} BOOST_DIR ${BOOST_INCLUDEDIR})

# There are warnings in the boost asio headers which are flagged as errors. Include the boost
# asio headers as system headers to ignore these warnings and not treat them as errors.
include_directories(SYSTEM ${CppMicroServices_SOURCE_DIR}/third_party/boost/include)
include_directories(SYSTEM ${_boost_library})


if (US_COMPILER_CLANG OR US_COMPILER_APPLE_CLANG)
Expand Down
4 changes: 3 additions & 1 deletion compendium/DeclarativeServices/test/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ include_directories(
${GMOCK_INCLUDE_DIRS}
)

usFunctionBoostPath(BOOST_SYSTEM ${US_USE_SYSTEM_BOOST} CPPMS_SOURCE_DIR ${CppMicroServices_SOURCE_DIR} BOOST_DIR ${BOOST_INCLUDEDIR})

# There are warnings in the boost asio headers which are flagged as errors. Include the boost
# asio headers as system headers to ignore these warnings and not treat them as errors.
include_directories(SYSTEM ${CppMicroServices_SOURCE_DIR}/third_party/boost/include)
include_directories(SYSTEM ${_boost_library})


if (US_COMPILER_CLANG OR US_COMPILER_APPLE_CLANG)
Expand Down

0 comments on commit 12135eb

Please sign in to comment.