From 83e26147e18d38623538236a566ea80c2f3bb165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 24 Apr 2019 18:53:31 +0200 Subject: [PATCH] Squashed 'cmake/cable/' changes from 1bcca8c..eb2188b eb2188b Cable 0.2.17 0db8383 buildinfo: Add option to install/export the building library git-subtree-dir: cmake/cable git-subtree-split: eb2188b4c2a5580bc41e546ca61238222cd1fd4f --- CableBuildInfo.cmake | 16 +++++++++++++--- bootstrap.cmake | 6 +++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CableBuildInfo.cmake b/CableBuildInfo.cmake index a03b481..51e27a3 100644 --- a/CableBuildInfo.cmake +++ b/CableBuildInfo.cmake @@ -1,18 +1,19 @@ # Cable: CMake Bootstrap Library. -# Copyright 2018 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. See the LICENSE file. +# Copyright 2019 Pawel Bylica. +# Licensed under the Apache License, Version 2.0. if(cable_build_info_included) return() endif() set(cable_build_info_included TRUE) +include(GNUInstallDirs) set(cable_buildinfo_template_dir ${CMAKE_CURRENT_LIST_DIR}/buildinfo) function(cable_add_buildinfo_library) - cmake_parse_arguments("" "" PROJECT_NAME "" ${ARGN}) + cmake_parse_arguments("" "" PROJECT_NAME;EXPORT "" ${ARGN}) if(NOT _PROJECT_NAME) message(FATAL_ERROR "The PROJECT_NAME argument missing") @@ -85,4 +86,13 @@ function(cable_add_buildinfo_library) LIBRARY_OUTPUT_DIRECTORY ${output_dir} ARCHIVE_OUTPUT_DIRECTORY ${output_dir} ) + + if(_EXPORT) + install(TARGETS ${name} EXPORT ${_EXPORT} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) + endif() + endfunction() diff --git a/bootstrap.cmake b/bootstrap.cmake index 554cd0b..ce2821c 100644 --- a/bootstrap.cmake +++ b/bootstrap.cmake @@ -1,6 +1,6 @@ # Cable: CMake Bootstrap Library. -# Copyright 2018 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. See the LICENSE file. +# Copyright 2019 Pawel Bylica. +# Licensed under the Apache License, Version 2.0. # Bootstrap the Cable - CMake Bootstrap Library by including this file. # e.g. include(cmake/cable/bootstrap.cmake). @@ -10,7 +10,7 @@ # # This is internal variable automatically updated with external tools. # Use CABLE_VERSION variable if you need this information. -set(version 0.2.16) +set(version 0.2.17) # For convenience, add the project CMake module dir to module path. set(module_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake)