summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortastytea2020-01-03 16:27:59 +0100
committertastytea2020-01-03 16:27:59 +0100
commit8c2d4c8b9752763438b5f91943899c445fe23903 (patch)
treef806a07737f3b2d0a70a8efdb568a5860cef1af0
parenta7fe14da27ca6badcdbe6d2e81f20a8298bd7aeb (diff)
downloadmastodonpp-8c2d4c8b9752763438b5f91943899c445fe23903.tar
mastodonpp-8c2d4c8b9752763438b5f91943899c445fe23903.tar.gz
mastodonpp-8c2d4c8b9752763438b5f91943899c445fe23903.zip
Generate and install mastodonpp.pc.
-rw-r--r--CMakeLists.txt2
-rw-r--r--pkg-config/CMakeLists.txt7
-rw-r--r--pkg-config/mastodonpp.pc.in11
3 files changed, 20 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f71128a..e64a888 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,7 +31,9 @@ include(debug_flags)
add_subdirectory(src)
add_subdirectory(include)
+
add_subdirectory(cmake)
+add_subdirectory(pkg-config)
if(WITH_TESTS)
add_subdirectory(tests)
diff --git a/pkg-config/CMakeLists.txt b/pkg-config/CMakeLists.txt
new file mode 100644
index 0000000..4640f17
--- /dev/null
+++ b/pkg-config/CMakeLists.txt
@@ -0,0 +1,7 @@
+include(GNUInstallDirs)
+
+configure_file("${PROJECT_NAME}.pc.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" @ONLY)
+
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
diff --git a/pkg-config/mastodonpp.pc.in b/pkg-config/mastodonpp.pc.in
new file mode 100644
index 0000000..06429dd
--- /dev/null
+++ b/pkg-config/mastodonpp.pc.in
@@ -0,0 +1,11 @@
+name=@PROJECT_NAME@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
+
+Name: ${name}
+Description: @PROJECT_DESCRIPTION@
+Version: @PROJECT_VERSION@
+Cflags: -I${includedir}
+Libs: -L${libdir} -l${name}