mirror of
https://github.com/boostorg/mqtt5.git
synced 2025-07-31 21:14:49 +02:00
Add Jamfile, make CMake scripts Boost compliant
Summary: related to T15996 Reviewers: ivica, korina Reviewed By: ivica Subscribers: iljazovic, miljen Differential Revision: https://repo.mireo.local/D33480
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
include(CTest)
|
||||
if(BUILD_TESTING)
|
||||
add_subdirectory(test)
|
||||
endif()
|
@@ -1,4 +0,0 @@
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(Boost 1.82)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/async-mqtt5Targets.cmake")
|
@@ -1,66 +0,0 @@
|
||||
if(PROJECT_IS_TOP_LEVEL)
|
||||
set(
|
||||
CMAKE_INSTALL_INCLUDEDIR "/async-mqtt5-${PROJECT_VERSION}"
|
||||
CACHE STRING ""
|
||||
)
|
||||
set_property(CACHE CMAKE_INSTALL_INCLUDEDIR PROPERTY TYPE PATH)
|
||||
endif()
|
||||
|
||||
# Project is configured with no languages, so tell GNUInstallDirs the lib dir
|
||||
set(CMAKE_INSTALL_LIBDIR lib CACHE PATH "")
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# find_package(<package>) call for consumers to find this project
|
||||
set(package async-mqtt5)
|
||||
|
||||
install(
|
||||
DIRECTORY include/
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
COMPONENT async-mqtt5_Development
|
||||
)
|
||||
|
||||
install(
|
||||
TARGETS async_mqtt5
|
||||
EXPORT async-mqtt5Targets
|
||||
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
)
|
||||
|
||||
write_basic_package_version_file(
|
||||
"${package}ConfigVersion.cmake"
|
||||
COMPATIBILITY SameMajorVersion
|
||||
ARCH_INDEPENDENT
|
||||
)
|
||||
|
||||
# Allow package maintainers to freely override the path for the configs
|
||||
set(
|
||||
async-mqtt5_INSTALL_CMAKEDIR "${CMAKE_INSTALL_DATADIR}/${package}"
|
||||
CACHE STRING "CMake package config location relative to the install prefix"
|
||||
)
|
||||
set_property(CACHE async-mqtt5_INSTALL_CMAKEDIR PROPERTY TYPE PATH)
|
||||
mark_as_advanced(async-mqtt5_INSTALL_CMAKEDIR)
|
||||
|
||||
install(
|
||||
FILES cmake/install-config.cmake
|
||||
DESTINATION "${async-mqtt5_INSTALL_CMAKEDIR}"
|
||||
RENAME "${package}Config.cmake"
|
||||
COMPONENT async-mqtt5_Development
|
||||
)
|
||||
|
||||
install(
|
||||
FILES "${PROJECT_BINARY_DIR}/${package}ConfigVersion.cmake"
|
||||
DESTINATION "${async-mqtt5_INSTALL_CMAKEDIR}"
|
||||
COMPONENT async-mqtt5_Development
|
||||
)
|
||||
|
||||
install(
|
||||
EXPORT async-mqtt5Targets
|
||||
NAMESPACE Async::
|
||||
DESTINATION "${async-mqtt5_INSTALL_CMAKEDIR}"
|
||||
COMPONENT async-mqtt5_Development
|
||||
)
|
||||
|
||||
if(PROJECT_IS_TOP_LEVEL)
|
||||
include(CPack)
|
||||
endif()
|
@@ -1,28 +0,0 @@
|
||||
# ---- Developer mode ----
|
||||
|
||||
# Developer mode enables targets and code paths in the CMake scripts that are
|
||||
# only relevant for the developer(s) of async-mqtt5
|
||||
# Targets necessary to build the project must be provided unconditionally, so
|
||||
# consumers can trivially build and package the project
|
||||
if(PROJECT_IS_TOP_LEVEL)
|
||||
option(async-mqtt5_DEVELOPER_MODE "Enable developer mode" OFF)
|
||||
endif()
|
||||
|
||||
# ---- Warning guard ----
|
||||
|
||||
# target_include_directories with the SYSTEM modifier will request the compiler
|
||||
# to omit warnings from the provided paths, if the compiler supports that
|
||||
# This is to provide a user experience similar to find_package when
|
||||
# add_subdirectory or FetchContent is used to consume this project
|
||||
set(warning_guard "")
|
||||
if(NOT PROJECT_IS_TOP_LEVEL)
|
||||
option(
|
||||
async-mqtt5_INCLUDES_WITH_SYSTEM
|
||||
"Use SYSTEM modifier for async-mqtt5's includes, disabling warnings"
|
||||
ON
|
||||
)
|
||||
mark_as_advanced(async-mqtt5_INCLUDES_WITH_SYSTEM)
|
||||
if(async-mqtt5_INCLUDES_WITH_SYSTEM)
|
||||
set(warning_guard SYSTEM)
|
||||
endif()
|
||||
endif()
|
Reference in New Issue
Block a user