From 83e50f4008fdbff653c63d2021f5df358b12ea8d Mon Sep 17 00:00:00 2001 From: Joshua Saxby Date: Fri, 28 Oct 2016 21:39:50 +0100 Subject: [PATCH 1/2] Update CMake script to install headers to version-dependent place Also, improved the warning message given if we suspect the target does not support at least 64-bit's worth of integers. --- CMakeLists.txt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75b33cb..b8cadcc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,9 @@ if(CMAKE_SIZEOF_VOID_P LESS 8) message( WARNING "It looks like this system's architecture is not at least 64-bit.\n" - "libsaxbospiral requires a system with an architecture of at least 64 bits!") + "libsaxbospiral requires a system with an architecture of at least 64 bits!\n" + "We'll continue trying to compile anyway, be sure to run the unit tests after." + ) endif() # pass in version of library as preprocessor definitions @@ -123,15 +125,22 @@ install( LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) + +# Generate version-dependent header installation folder +set( + LIBSAXBOSPIRAL_HEADER_DESTINATION + "saxbospiral-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}" +) + # Install main library header files install( FILES ${LIB_SAXBOSPIRAL_HEADERS} - DESTINATION include/saxbospiral + DESTINATION "include/${LIBSAXBOSPIRAL_HEADER_DESTINATION}" ) # Install render_backends header files install( FILES ${LIB_SAXBOSPIRAL_RENDER_BACKENDS_HEADERS} - DESTINATION include/saxbospiral/render_backends + DESTINATION "include/${LIBSAXBOSPIRAL_HEADER_DESTINATION}/render_backends" ) enable_testing() From d50cb2f79899074dd5908a17512bb492257e1062 Mon Sep 17 00:00:00 2001 From: Joshua Saxby Date: Fri, 28 Oct 2016 21:45:26 +0100 Subject: [PATCH 2/2] Install to locations based on major and major.minor versions --- CMakeLists.txt | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b8cadcc..cd29952 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,21 +126,36 @@ install( RUNTIME DESTINATION bin ) -# Generate version-dependent header installation folder +# Generate rough (nearest major) version-dependent header installation folder set( - LIBSAXBOSPIRAL_HEADER_DESTINATION + LIBSAXBOSPIRAL_ROUGH_HEADER_DESTINATION + "saxbospiral-${PROJECT_VERSION_MAJOR}" +) +# Generate precise (major and minor) version-dependent header installation folder +set( + LIBSAXBOSPIRAL_PRECISE_HEADER_DESTINATION "saxbospiral-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}" ) -# Install main library header files +# Install main library header files, both to rough and precise install locations +install( + FILES ${LIB_SAXBOSPIRAL_HEADERS} + DESTINATION "include/${LIBSAXBOSPIRAL_ROUGH_HEADER_DESTINATION}" +) +# Install render_backends header files +install( + FILES ${LIB_SAXBOSPIRAL_RENDER_BACKENDS_HEADERS} + DESTINATION "include/${LIBSAXBOSPIRAL_ROUGH_HEADER_DESTINATION}/render_backends" +) + install( FILES ${LIB_SAXBOSPIRAL_HEADERS} - DESTINATION "include/${LIBSAXBOSPIRAL_HEADER_DESTINATION}" + DESTINATION "include/${LIBSAXBOSPIRAL_PRECISE_HEADER_DESTINATION}" ) # Install render_backends header files install( FILES ${LIB_SAXBOSPIRAL_RENDER_BACKENDS_HEADERS} - DESTINATION "include/${LIBSAXBOSPIRAL_HEADER_DESTINATION}/render_backends" + DESTINATION "include/${LIBSAXBOSPIRAL_PRECISE_HEADER_DESTINATION}/render_backends" ) enable_testing()