Skip to content

Commit ba74457

Browse files
czurniedensjaeckel
authored andcommitted
Build and install libtommath.pc
1 parent cb8f212 commit ba74457

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,19 @@ install(FILES ${HEADERS}
171171
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
172172
)
173173

174+
# Install libtommath.pc for pkg-config if we build a shared library
175+
if(BUILD_SHARED_LIBS)
176+
configure_file(
177+
${CMAKE_CURRENT_SOURCE_DIR}/lib${PROJECT_NAME}.pc.in
178+
${CMAKE_CURRENT_BINARY_DIR}/lib${PROJECT_NAME}.pc
179+
@ONLY
180+
)
181+
182+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${PROJECT_NAME}.pc
183+
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig
184+
)
185+
endif()
186+
174187
# generate package version file
175188
write_basic_package_version_file(
176189
${PROJECT_VERSION_FILE}

libtommath.pc.in

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
prefix=@to-be-replaced@
2-
exec_prefix=${prefix}
3-
libdir=${exec_prefix}/lib
4-
includedir=${prefix}/include
1+
prefix=@CMAKE_INSTALL_PREFIX@
2+
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
3+
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/@PROJECT_NAME@
54

65
Name: LibTomMath
76
Description: public domain library for manipulating large integer numbers
8-
Version: @to-be-replaced@
7+
Version: @PROJECT_VERSION@
98
Libs: -L${libdir} -ltommath
109
Cflags: -I${includedir}

0 commit comments

Comments
 (0)