From dab127b85d1b4c88a1a729b1cd6f9000ab25eb77 Mon Sep 17 00:00:00 2001 From: Choe Hwanjin Date: Tue, 28 Sep 2021 22:30:52 +0900 Subject: cmake: Add hangul-config.cmake.in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 실수로 파일을 add하지 않았다. 추가한다. 추가로 cmake 디렉토리 이름을 하드코딩하지 않고 CMAKE_PROJECT_NAME 변수를 사용하도록 변경한다. https://github.com/libhangul/libhangul/issues/56 --- CMakeLists.txt | 4 ++-- hangul-config.cmake.in | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 hangul-config.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c66ad2..b31d0e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,7 @@ include(CMakePackageConfigHelpers) configure_package_config_file(hangul-config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/hangul-config.cmake" INSTALL_DESTINATION - "${CMAKE_INSTALL_LIBDIR}/cmake/hangul" + "${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME}" PATH_VARS LIBHANGUL_INCLUDE_DIR LIBHANGUL_LIBRARY_DIR @@ -67,7 +67,7 @@ install( "${CMAKE_CURRENT_BINARY_DIR}/hangul-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/hangul-config-version.cmake" DESTINATION - "${CMAKE_INSTALL_LIBDIR}/cmake/hangul" + "${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME}" COMPONENT dev ) diff --git a/hangul-config.cmake.in b/hangul-config.cmake.in new file mode 100644 index 0000000..ea67762 --- /dev/null +++ b/hangul-config.cmake.in @@ -0,0 +1,36 @@ +# libhangul +# Copyright 2021 Choe Hwanjin +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +include("${CMAKE_CURRENT_LIST_DIR}/hangul-config-version.cmake") + +@PACKAGE_INIT@ + +message("LIBHANGUL_INCLUDE_DIR: @PACKAGE_LIBHANGUL_INCLUDE_DIR@") +message("LIBHANGUL_LIBRARY_DIR: @PACKAGE_LIBHANGUL_LIBRARY_DIR@") + +set_and_check(LIBHANGUL_INCLUDE_DIR "@PACKAGE_LIBHANGUL_INCLUDE_DIR@") +set_and_check(LIBHANGUL_LIBRARY_DIR "@PACKAGE_LIBHANGUL_LIBRARY_DIR@") + +set(LIBHANGUL_INCLUDE_DIR2 "@LIBHANGUL_INCLUDE_DIR@") +set(LIBHANGUL_LIBRARY_DIR2 "@LIBHANGUL_LIBRARY_DIR@") + + +add_library(hangul SHARED IMPORTED) +set_target_properties(hangul PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${LIBHANGUL_INCLUDE_DIR}" + IMPORTED_LOCATION "${LIBHANGUL_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}hangul${CMAKE_SHARED_LIBRARY_SUFFIX}" +) -- cgit v1.2.1