diff --git a/CMakeLists.txt b/CMakeLists.txt index 77c539d..b9586d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -135,3 +135,17 @@ if (BUILD_TESTING) enable_testing() add_subdirectory(test) endif() + +# pkg-config support +include(GNUInstallDirs) +include(CMakePackageConfigHelpers) +set(PKGCONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig") +configure_file( + "${PROJECT_SOURCE_DIR}/mocr.pc.in" + "${CMAKE_BINARY_DIR}/mocr.pc" + @ONLY +) +install( + FILES "${CMAKE_BINARY_DIR}/mocr.pc" + DESTINATION "${PKGCONFIG_INSTALL_DIR}" +) diff --git a/mocr.pc.in b/mocr.pc.in new file mode 100644 index 0000000..535f6d9 --- /dev/null +++ b/mocr.pc.in @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: mocr +Description: C/C++ bindings for mangaocr +Version: @PROJECT_VERSION@ +Libs: -L${libdir} -lmocr -lmocr++ +Cflags: -I${includedir}