Skip to content

Commit

Permalink
cmake: Create a cmake config file
Browse files Browse the repository at this point in the history
This way other cmake project can find the library using:

  find_package(piper_phonemize)
  • Loading branch information
cryptomilk committed Mar 13, 2024
1 parent 5199b4e commit 90bbaa2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ project(

option(BUILD_EXTERNAL "Build external dependencies" OFF)

include(CMakePackageConfigHelpers)
write_basic_package_version_file(piper_phonemize-config-version.cmake
VERSION ${piper_phonemize_VERSION}
COMPATIBILITY SameMajorVersion)

if(MSVC)
# Force compiler to use UTF-8 for IPA constants
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
Expand Down Expand Up @@ -263,8 +268,12 @@ include(GNUInstallDirs)

install(
TARGETS piper_phonemize
EXPORT piper_phonemize-config
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

install(EXPORT piper_phonemize-config
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/piper_phonemize)

install(
DIRECTORY ${piper_phonemize_SOURCE_DIR}/src/
DESTINATION include/piper-phonemize
Expand Down

0 comments on commit 90bbaa2

Please sign in to comment.