File tree Expand file tree Collapse file tree 4 files changed +65
-0
lines changed Expand file tree Collapse file tree 4 files changed +65
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Debian pkg-config
2+
3+ on : [push, pull_request]
4+
5+ permissions :
6+ contents : read
7+
8+ jobs :
9+ pkg-config :
10+ runs-on : ubuntu-latest
11+ container :
12+ image : debian:12
13+
14+ steps :
15+ - uses : actions/checkout@v3
16+
17+ - name : Install dependencies
18+ run : |
19+ apt -y update
20+ apt -y --no-install-recommends install g++ cmake make pkg-config
21+
22+ - name : Build and install
23+ run : |
24+ cmake -B build
25+ cmake --build build
26+ cmake --install build
27+
28+ - name : Test pkg-config
29+ run : pkg-config --cflags --libs ada
Original file line number Diff line number Diff line change @@ -163,6 +163,18 @@ install(
163163 COMPONENT example_development
164164)
165165
166+
167+ # pkg-config
168+ include (cmake/JoinPaths.cmake)
169+ join_paths(PKGCONFIG_INCLUDEDIR "\$ {prefix}" "${CMAKE_INSTALL_INCLUDEDIR} " )
170+ join_paths(PKGCONFIG_LIBDIR "\$ {prefix}" "${CMAKE_INSTALL_LIBDIR} " )
171+
172+ configure_file ("ada.pc.in" "ada.pc" @ONLY)
173+ install (
174+ FILES "${CMAKE_CURRENT_BINARY_DIR} /ada.pc"
175+ DESTINATION "${CMAKE_INSTALL_LIBDIR} /pkgconfig"
176+ )
177+
166178if (is_top_project)
167179 set (CPACK_PACKAGE_VENDOR "Ada Authors" )
168180 set (CPACK_PACKAGE_CONTACT "yagiz@nizipli.com" )
Original file line number Diff line number Diff line change 1+ prefix=@CMAKE_INSTALL_PREFIX@
2+ includedir=@PKGCONFIG_INCLUDEDIR@
3+ libdir=@PKGCONFIG_LIBDIR@
4+
5+ Name: @PROJECT_NAME@
6+ Description: @PROJECT_DESCRIPTION@
7+ URL: @PROJECT_HOMEPAGE_URL@
8+ Version: @PROJECT_VERSION@
9+ Cflags: -I${includedir} @PKGCONFIG_CFLAGS@
10+ Libs: -L${libdir} -l@PROJECT_NAME@
11+ @PKGCONFIG_LIBS_PRIVATE@
Original file line number Diff line number Diff line change 1+ function (join_paths joined_path first_path_segment)
2+ set (temp_path "${first_path_segment} " )
3+ foreach (current_segment IN LISTS ARGN)
4+ if (NOT ("${current_segment} " STREQUAL "" ))
5+ if (IS_ABSOLUTE "${current_segment} " )
6+ set (temp_path "${current_segment} " )
7+ else ()
8+ set (temp_path "${temp_path} /${current_segment} " )
9+ endif ()
10+ endif ()
11+ endforeach ()
12+ set (${joined_path} "${temp_path} " PARENT_SCOPE)
13+ endfunction ()
You can’t perform that action at this time.
0 commit comments