diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a1044db6..0c3cff8e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,8 +25,8 @@ cmake_minimum_required(VERSION 3.0) include("cmake/HunterGate.cmake") HunterGate( - URL "https://github.com/ruslo/hunter/archive/v0.12.7.tar.gz" - SHA1 "b5ae065573ea2706ae1389a9048f1cabb2451f23" + URL "https://github.com/ruslo/hunter/archive/v0.19.49.tar.gz" + SHA1 "dd8a16d1beeede2159c58f4cd478ac010545686b" ) project(spdlog VERSION 1.0.0) @@ -52,6 +52,11 @@ target_include_directories( "$" ) +if(ANDROID) + find_package(android_log REQUIRED) + target_link_libraries(spdlog INTERFACE android_log::android_log) +endif() + set(HEADER_BASE "${CMAKE_CURRENT_SOURCE_DIR}/include") if(SPDLOG_BUILD_EXAMPLES) @@ -82,10 +87,15 @@ write_basic_package_version_file( "${version_config}" COMPATIBILITY SameMajorVersion ) -# Note: use 'targets_export_name' -configure_file("cmake/Config.cmake.in" "${project_config}" @ONLY) configure_file("cmake/spdlog.pc.in" "${pkg_config}" @ONLY) +# Note: use 'targets_export_name' +configure_package_config_file( + "cmake/Config.cmake.in" + "${project_config}" + INSTALL_DESTINATION "${config_install_dir}" +) + install( TARGETS spdlog EXPORT "${targets_export_name}" diff --git a/cmake/Config.cmake.in b/cmake/Config.cmake.in index ba0b36f2b..80472019d 100644 --- a/cmake/Config.cmake.in +++ b/cmake/Config.cmake.in @@ -1,24 +1,31 @@ -# *************************************************************************/ -# * Copyright (c) 2015 Ruslan Baratov. */ -# * */ -# * Permission is hereby granted, free of charge, to any person obtaining */ -# * a copy of this software and associated documentation files (the */ -# * "Software"), to deal in the Software without restriction, including */ -# * without limitation the rights to use, copy, modify, merge, publish, */ -# * distribute, sublicense, and/or sell copies of the Software, and to */ -# * permit persons to whom the Software is furnished to do so, subject to */ -# * the following conditions: */ -# * */ -# * The above copyright notice and this permission notice shall be */ -# * included in all copies or substantial portions of the Software. */ -# * */ -# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -# * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -# * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -# * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -# * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -# * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -# * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -# *************************************************************************/ - -include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake") +# *************************************************************************/ +# * Copyright (c) 2015-2017 Ruslan Baratov. */ +# * */ +# * Permission is hereby granted, free of charge, to any person obtaining */ +# * a copy of this software and associated documentation files (the */ +# * "Software"), to deal in the Software without restriction, including */ +# * without limitation the rights to use, copy, modify, merge, publish, */ +# * distribute, sublicense, and/or sell copies of the Software, and to */ +# * permit persons to whom the Software is furnished to do so, subject to */ +# * the following conditions: */ +# * */ +# * The above copyright notice and this permission notice shall be */ +# * included in all copies or substantial portions of the Software. */ +# * */ +# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +# * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +# * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +# * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +# * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +# * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +# * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +# *************************************************************************/ + +@PACKAGE_INIT@ + +if(@ANDROID@) + find_package(android_log REQUIRED) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake") +check_required_components("@PROJECT_NAME@")