Skip to content

Commit

Permalink
Add support for absolute CMAKE_INSTALL_*DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
otegami committed Apr 24, 2024
1 parent 5ab83b1 commit 27e4695
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,16 @@ SET (VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION})

LIST (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
include(GNUInstallDirs)
SET (prefix ${CMAKE_INSTALL_PREFIX})
SET (exec_prefix ${CMAKE_INSTALL_PREFIX})
SET (libdir ${CMAKE_INSTALL_LIBDIR})
SET (includedir ${CMAKE_INSTALL_INCLUDEDIR})
if(IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}")
set(MSGPACK_PKG_CONFIG_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
else()
set(MSGPACK_PKG_CONFIG_LIBDIR "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
endif()
if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}")
set(MSGPACK_PKG_CONFIG_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}")
else()
set(MSGPACK_PKG_CONFIG_INCLUDEDIR "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
endif()

OPTION (MSGPACK_32BIT "32bit compile" OFF)

Expand Down
7 changes: 3 additions & 4 deletions msgpack-c.pc.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
prefix=@CMAKE_INSTALL_PREFIX@
includedir=@MSGPACK_PKG_CONFIG_INCLUDEDIR@
libdir=@MSGPACK_PKG_CONFIG_INCLUDEDIR@

Name: MessagePack
Description: Binary-based efficient object serialization library
Expand Down

0 comments on commit 27e4695

Please sign in to comment.