From 61567f4c579aeb2ec1ab8f6bc285de461c7149a8 Mon Sep 17 00:00:00 2001 From: Austin McCartney Date: Sat, 15 Jun 2019 09:31:54 -0600 Subject: [PATCH] Fixed CMake prefix generator bug --- CMakeLists.txt | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 103ad9a..54f8768 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,9 @@ cmake_minimum_required(VERSION 3.8) # if(DEFINED PROJECT_NAME) 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() set(subproject OFF) set_property(GLOBAL PROPERTY USE_FOLDERS ON) @@ -51,7 +53,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # CMAKE_DEPENDENT_OPTION(mio.tests "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 @@ -104,7 +106,7 @@ add_library(mio::mio ALIAS mio) # string(CONCAT prefix "$" - "$") + "$") target_include_directories(mio INTERFACE ${prefix}) @@ -199,15 +201,6 @@ if(mio.installation) # RPM Package Manager files, Windows NSIS installation wizards, # 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 ) - # ``` - # # A packaged installation can be generated by calling # # ```sh @@ -221,7 +214,7 @@ if(mio.installation) set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Cross-platform C++11 header-only library for memory mapped file IO") 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_MINOR "${PROJECT_VERSION_MINOR}") set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")