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

Use CMAKE_INSTALL_FULL_LIBDIR, CMAKE_INSTALL_FULL_INCLUDEDIR #1124

Draft
wants to merge 2 commits into
base: c_master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
34 changes: 1 addition & 33 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ if(${CMAKE_VERSION} VERSION_GREATER "3.4")
CMAKE_MINIMUM_REQUIRED (VERSION 3.5)
else()
CMAKE_MINIMUM_REQUIRED (VERSION 2.8.12)
CMAKE_POLICY(SET CMP0042 NEW)
IF ((CMAKE_VERSION VERSION_GREATER 3.1) OR
(CMAKE_VERSION VERSION_EQUAL 3.1))
CMAKE_POLICY(SET CMP0054 NEW)
Expand All @@ -28,19 +29,6 @@ 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})
IF (IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})
SET (libdir ${CMAKE_INSTALL_LIBDIR})
ELSE ()
SET (libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
ENDIF ()
IF (IS_ABSOLUTE ${CMAKE_INSTALL_INCLUDEDIR})
SET (includedir ${CMAKE_INSTALL_INCLUDEDIR})
ELSE ()
SET (includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
ENDIF ()

OPTION (MSGPACK_32BIT "32bit compile" OFF)

INCLUDE(TestBigEndian)
Expand All @@ -65,18 +53,6 @@ CONFIGURE_FILE (
@ONLY
)

IF (APPLE)
SET(CMAKE_MACOSX_RPATH ON)
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
IF ("${isSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
ENDIF ()
ENDIF ()

IF (MSGPACK_32BIT)
IF ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
SET (CMAKE_C_FLAGS "-m32 ${CMAKE_C_FLAGS}")
Expand Down Expand Up @@ -245,14 +221,6 @@ IF ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "sparc")
SET (CMAKE_C_FLAGS "-DMSGPACK_ZONE_ALIGN=8 ${CMAKE_C_FLAGS}")
ENDIF ()

IF (NOT DEFINED CMAKE_INSTALL_BINDIR)
SET(CMAKE_INSTALL_BINDIR bin)
ENDIF ()

IF (NOT DEFINED CMAKE_INSTALL_LIBDIR)
SET(CMAKE_INSTALL_LIBDIR lib)
ENDIF ()

IF (MSGPACK_BUILD_EXAMPLES)
ADD_SUBDIRECTORY (example)
ENDIF ()
Expand Down
9 changes: 2 additions & 7 deletions msgpack-c.pc.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: MessagePack
Description: Binary-based efficient object serialization library
Version: @VERSION@
Libs: -L${libdir} -lmsgpack-c
Cflags: -I${includedir}
Libs: -L@CMAKE_INSTALL_FULL_LIBDIR@ -lmsgpack-c
Cflags: -I@CMAKE-INSTALL_FULL_INCLUDEDIR@
Loading