Skip to content

Commit

Permalink
This is to address relative and absolute installation folders
Browse files Browse the repository at this point in the history
  • Loading branch information
aous72 committed Jul 4, 2024
1 parent 61c05d0 commit 46da3dc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
15 changes: 11 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,17 @@ install(DIRECTORY src/core/common/
install(FILES "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)

set(PKG_CONFIG_INCLUDEDIR "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
set(PKG_CONFIG_LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}")
set(PKG_CONFIG_LIBS "-L\${libdir} -lopenjph")
set(PKG_CONFIG_CFLAGS "-I\${includedir}")
if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}")
set(PKG_CONFIG_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}")
else()
set(PKG_CONFIG_INCLUDEDIR "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
endif()

if(IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}")
set(PKG_CONFIG_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
else()
set(PKG_CONFIG_LIBDIR "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
endif()

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/src/pkg-config.pc.cmake"
Expand Down
2 changes: 1 addition & 1 deletion src/core/common/ojph_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@

#define OPENJPH_VERSION_MAJOR 0
#define OPENJPH_VERSION_MINOR 14
#define OPENJPH_VERSION_PATCH 1
#define OPENJPH_VERSION_PATCH 2
4 changes: 2 additions & 2 deletions src/pkg-config.pc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ Requires: @PKG_CONFIG_REQUIRES@
prefix=@CMAKE_INSTALL_PREFIX@
includedir=@PKG_CONFIG_INCLUDEDIR@
libdir=@PKG_CONFIG_LIBDIR@
Libs: @PKG_CONFIG_LIBS@
Cflags: @PKG_CONFIG_CFLAGS@
Libs: -L${libdir} -lopenjph
Cflags: -I${includedir}

0 comments on commit 46da3dc

Please sign in to comment.