Skip to content

Commit

Permalink
Updated pkgconfig
Browse files Browse the repository at this point in the history
(Closes #944)
  • Loading branch information
Nightwalker-87 committed Apr 23, 2020
1 parent 39f2263 commit 3e3f782
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ endif ()
find_package(libusb REQUIRED)

if (NOT WIN32 AND NOT CMAKE_CROSSCOMPILING)
add_subdirectory(cmake/pkgconfig)
find_package(PkgConfig)
pkg_check_modules(GTK3 gtk+-3.0)
endif ()
Expand Down Expand Up @@ -269,7 +270,6 @@ add_subdirectory(tests)
add_subdirectory(cmake/packaging)
include(cmake/packaging/cpack_config.cmake)


###
# Uninstall target
###
Expand Down
15 changes: 15 additions & 0 deletions cmake/pkgconfig/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
set(PKG_CONFIG_LIBDIR "\${prefix}/lib/\${deb_host_multiarch}")
set(PKG_CONFIG_INCLUDEDIR "\${prefix}/include/\${deb_host_multiarch}/${PROJECT_NAME}")
set(PKG_CONFIG_LIBS "-L\${libdir} -l:libstlink.so.${PROJECT_VERSION_MAJOR}")
set(PKG_CONFIG_CFLAGS "-I\${includedir}")
set(PKG_CONFIG_REQUIRES "libusb-1.0")

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig.pc.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
)

install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
DESTINATION ${STLINK_LIBRARY_PATH}/pkgconfig
)
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
prefix=${CMAKE_INSTALL_PREFIX}
deb_host_multiarch=${CMAKE_LIBRARY_PATH}
libdir=${PKG_CONFIG_LIBDIR}
includedir=${PKG_CONFIG_INCLUDEDIR}

Name: ${PROJECT_NAME}
Description: ${PROJECT_DESCRIPTION}
Version: ${PROJECT_VERSION}
Requires: ${PKG_CONFIG_REQUIRES}
prefix=${CMAKE_INSTALL_PREFIX}
includedir=${PKG_CONFIG_INCLUDEDIR}
libdir=${PKG_CONFIG_LIBDIR}
Libs: ${PKG_CONFIG_LIBS}
Cflags: ${PKG_CONFIG_CFLAGS}
Requires: ${PKG_CONFIG_REQUIRES}
15 changes: 0 additions & 15 deletions debian/pkg-config/CMakeLists.txt

This file was deleted.

0 comments on commit 3e3f782

Please sign in to comment.