|
| 1 | +# Copyright (C) 2023 The C++ Plus Project. |
| 2 | +# This file is part of the cppp-platform library. |
| 3 | +# |
| 4 | +# The cppp-platform library is free software; you can redistribute it |
| 5 | +# and/or modify it under the terms of the The Unlicense as published |
| 6 | +# by the unlicense.org |
| 7 | +# |
| 8 | +# The cppp-platform library is distributed in the hope that it will be |
| 9 | +# useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
| 10 | +# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the The |
| 11 | +# Unlicense for more details. |
| 12 | +# |
| 13 | +# You should have received a copy of the The Unlicense along with the |
| 14 | +# cppp-platform library; see the file COPYING. |
| 15 | +# If not, see <http://unlicense.org/>. |
| 16 | + |
| 17 | +cmake_minimum_required(VERSION 3.12) |
| 18 | +project(cppp-platform VERSION 1.3.0) |
| 19 | + |
| 20 | +# Set C++ standard |
| 21 | +set(CMAKE_CXX_STANDARD 11) |
| 22 | + |
| 23 | +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/build-aux") |
| 24 | + set(BUILD_AUX "${CMAKE_CURRENT_SOURCE_DIR}/build-aux") |
| 25 | +elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../build-aux") |
| 26 | + set(BUILD_AUX "${CMAKE_CURRENT_SOURCE_DIR}/../build-aux") |
| 27 | +else() |
| 28 | + message(FATAL_ERROR "CMake build-aux directory is not exists, try to execute 'setup.cmd' or './setup.sh' to get it.") |
| 29 | +endif() |
| 30 | +set(AUX_DIR "${BUILD_AUX}/cmake") |
| 31 | + |
| 32 | +message(STATUS "Using '${BUILD_AUX}' for C++ Plus build-aux directory.") |
| 33 | +add_subdirectory("${BUILD_AUX}") |
| 34 | + |
| 35 | +include("${AUX_DIR}/cppp.cmake") |
| 36 | + |
| 37 | +# Read source files |
| 38 | +file(READ "${srcdir}/src/architectures.h" ARCHITECTURES) |
| 39 | +file(READ "${srcdir}/src/compilers.h" COMPILERS) |
| 40 | +file(READ "${srcdir}/src/languagestandards.h" LANGUAGESTANDARDS) |
| 41 | +file(READ "${srcdir}/src/platforms.h" PLATFORMS) |
| 42 | + |
| 43 | +# Genetate header |
| 44 | +configure_file("${srcdir}/include/cppp/cppp-platform.h.in" "${output_includedir}/cppp/cppp-platform.h") |
| 45 | + |
| 46 | +# Install |
| 47 | +# Includes |
| 48 | +# PERMISSIONS 0644 |
| 49 | +install(FILES "${output_includedir}/cppp/cppp-platform.h" |
| 50 | + DESTINATION "${install_includedir}" |
| 51 | + RENAME "cppp/cppp-platform.h" |
| 52 | + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ ) |
0 commit comments