Skip to content

Commit

Permalink
Merge pull request #116 from PJungkamp/pkgconfig
Browse files Browse the repository at this point in the history
Generate and install a pkg-config file
  • Loading branch information
mzillgith authored Aug 12, 2022
2 parents 6d8a918 + 9236a8c commit 63481bd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib60870-C/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ IF(UNIX)
-lm
)
ENDIF (CONFIG_SYSTEM_HAS_CLOCK_GETTIME)

configure_file(
${CMAKE_CURRENT_LIST_DIR}/lib60870.pc.in
${CMAKE_CURRENT_BINARY_DIR}/lib60870.pc @ONLY
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/lib60870.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/pkgconfig")
ENDIF(UNIX)
IF(MINGW)
target_link_libraries(lib60870-shared ws2_32 iphlpapi)
Expand Down
13 changes: 13 additions & 0 deletions lib60870-C/src/lib60870.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@/bin
libdir=@CMAKE_INSTALL_PREFIX@/lib
sharedlibdir=@CMAKE_INSTALL_PREFIX@/lib
includedir=@CMAKE_INSTALL_PREFIX@/include

Name: @PROJECT_NAME@
Description: @CPACK_PACKAGE_DESCRIPTION@
Version: @LIB_VERSION_MAJOR@.@LIB_VERSION_MINOR@.@LIB_VERSION_PATCH@

Requires:
Libs: -L${libdir} -L${sharedlibdir} -llib60870
Cflags: -I${includedir}

0 comments on commit 63481bd

Please sign in to comment.