diff --git a/CMakeLists.txt b/CMakeLists.txt index 03d76d8b8..cb21a37de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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) @@ -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}") @@ -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 () diff --git a/msgpack-c.pc.in b/msgpack-c.pc.in index 208066252..1f4e1db06 100644 --- a/msgpack-c.pc.in +++ b/msgpack-c.pc.in @@ -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@