diff options
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | hangul-config.cmake.in | 36 |
2 files changed, 38 insertions, 2 deletions
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}" +) |