Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PC files for library #517

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@ if(NOT EXISTS "${CMAKE_SOURCE_DIR}/configure")
configure_file(${CMAKE_SOURCE_DIR}/src/odbc/version.rc.in ${CMAKE_SOURCE_DIR}/src/odbc/version.rc)
endif(NOT EXISTS "${CMAKE_SOURCE_DIR}/configure")

configure_file(ctlib.pc.in ctlib.pc @ONLY)
configure_file(dblib.pc.in dblib.pc @ONLY)

set(FREETDS_PUBLIC_INCLUDE
${CMAKE_SOURCE_DIR}/include/bkpublic.h
Expand All @@ -510,3 +512,5 @@ set(FREETDS_CONF_FILES
install(FILES ${FREETDS_PUBLIC_INCLUDE} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES ${FREETDS_PUBLIC_INCLUDE_2} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/freetds)
install(FILES ${FREETDS_CONF_FILES} DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ctlib.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dblib.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
21 changes: 21 additions & 0 deletions ctlib.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# pkg_config.pc.in
#
# pkg_config configuration file
# For a detailed description of options, please visit
# Dan Nicholson’s Guide to pkg-config (http://www.freedesktop.org/wiki/Software/pkg-config/)
#

prefix="@CMAKE_INSTALL_PREFIX@"
includedir=${prefix}/include
libdir=${prefix}/lib/

Name: CT-library
Version: @VERSION@
Description: A free implementation of TDS protocol
URL: https://github.com/FreeTDS/freetds
Requires:
Requires.private: libssl, libcrypto libiconv
Cflags: -I${includedir}/freetds
Libs: -L${libdir} -lct
Libs.private: -ladvapi32 -lkernel32 -lshell32 -lcrypt32 -lws2_32 -lsecur32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would put these files in CMakeLists.txt within a if(WIN32)...endif(WIN32) condition, they are only useful and working for Windows.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the pkg-config file works for Linux/macOS/MINGW(Windows), not windows only.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the Libs.private should update with the build tool, because it will change with the operating system.

21 changes: 21 additions & 0 deletions dblib.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# pkg_config.pc.in
#
# pkg_config configuration file
# For a detailed description of options, please visit
# Dan Nicholson’s Guide to pkg-config (http://www.freedesktop.org/wiki/Software/pkg-config/)
#

prefix="@CMAKE_INSTALL_PREFIX@"
includedir=${prefix}/include
libdir=${prefix}/lib/

Name: DB-library
Version: @VERSION@
Description: A free implementation of TDS protocol
URL: https://github.com/FreeTDS/freetds
Requires:
Requires.private: libssl, libcrypto libiconv
Cflags: -I${includedir}/freetds
Libs: -L${libdir} -lsybdb
Libs.private: -ladvapi32 -lkernel32 -lshell32 -lcrypt32 -lws2_32 -lsecur32