Fixed CMake prefix generator bug

This commit is contained in:
Austin McCartney 2019-06-15 09:31:54 -06:00
parent 2bde42c3f2
commit 61567f4c57

View File

@ -10,7 +10,9 @@ cmake_minimum_required(VERSION 3.8)
# #
if(DEFINED PROJECT_NAME) if(DEFINED PROJECT_NAME)
set(subproject ON) set(subproject ON)
set(INSTALL_SUBPROJECTS ON CACHE BOOL "Install subproject dependencies") if(NOT DEFINED INSTALL_SUBPROJECTS)
set(INSTALL_SUBPROJECTS ON CACHE BOOL "Install subproject dependencies")
endif()
else() else()
set(subproject OFF) set(subproject OFF)
set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON)
@ -51,7 +53,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
# #
CMAKE_DEPENDENT_OPTION(mio.tests CMAKE_DEPENDENT_OPTION(mio.tests
"Build the mio tests and integrate with ctest" "Build the mio tests and integrate with ctest"
${BUILD_TESTING} "NOT subproject" OFF) ON "BUILD_TESTING; NOT subproject" OFF)
# #
# On Windows, so as to be a "good citizen", mio offers two mechanisms to control # On Windows, so as to be a "good citizen", mio offers two mechanisms to control
@ -104,7 +106,7 @@ add_library(mio::mio ALIAS mio)
# #
string(CONCAT prefix string(CONCAT prefix
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>" "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
"$<INSTALL_INTERFACE:include>") "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
target_include_directories(mio INTERFACE ${prefix}) target_include_directories(mio INTERFACE ${prefix})
@ -199,15 +201,6 @@ if(mio.installation)
# RPM Package Manager files, Windows NSIS installation wizards, # RPM Package Manager files, Windows NSIS installation wizards,
# Apple Disk Images (.dmg), etc. # Apple Disk Images (.dmg), etc.
# #
# Any system libraries required (runtimes, threading, etc) should be bundled
# with the project for this type of installation. The
# `InstallRequiredSystemLibraries` CMake module attempts to provide this
# functionality in an automated way. Additional libraries may be specified as
#
# ```cmake
# list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS <library>)
# ```
#
# A packaged installation can be generated by calling # A packaged installation can be generated by calling
# #
# ```sh # ```sh
@ -221,7 +214,7 @@ if(mio.installation)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
"Cross-platform C++11 header-only library for memory mapped file IO") "Cross-platform C++11 header-only library for memory mapped file IO")
set(CMAKE_PROJECT_HOMEPAGE_URL "https://github.com/mandreyel/mio") set(CMAKE_PROJECT_HOMEPAGE_URL "https://github.com/mandreyel/mio")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")