Skip to content

Commit 285c878

Browse files
committed
Add CMake buildsystem support.
新文件: CMakeLists.txt 重命名: LICENSE -> COPYING 修改: ChangeLog 修改: doc/platforms.md 修改: include/cppp/cppp-platform.h.in
1 parent 59f6a30 commit 285c878

File tree

5 files changed

+72
-1
lines changed

5 files changed

+72
-1
lines changed

CMakeLists.txt

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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 )

LICENSE renamed to COPYING

File renamed without changes.

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2023-08-08 ChenPi11 <wushengwuxi-msctinoulk@outlook.com>
2+
3+
Add CMake buildsystem support.
4+
15
2023-08-07 ChenPi11 <wushengwuxi-msctinoulk@outlook.com>
26

37
Update docs.

doc/platforms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,4 @@ int main(){}
7979
| Windows | \_\_has_windows\_\_ |
8080
| Windows CE | \_\_has_windows_ce\_\_ |
8181
| Wind/U Environment | \_\_has_windu\_\_ |
82-
| z/OS | \_\_has_zos\_\_ |
82+
| z/OS | \_\_has_zos\_\_ |

include/cppp/cppp-platform.h.in

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,21 @@
88
* @see https://sourceforge.net/p/predef/wiki/Home/
99
* @link https://github.com/cppp-project/cppp-platform
1010
*/
11+
/* Copyright (C) 2023 The C++ Plus Project
12+
This file is part of the cppp-platform library.
13+
14+
The cppp-platform library is free software; you can redistribute it
15+
and/or modify it under the terms of the The Unlicense as published
16+
by the unlicense.org
17+
18+
The cppp-platform library is distributed in the hope that it will be
19+
useful, but WITHOUT ANY WARRANTY; without even the implied warranty
20+
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the The
21+
Unlicense for more details.
22+
23+
You should have received a copy of the The Unlicense along with the
24+
cppp-platform library; see the file COPYING.
25+
If not, see <http://unlicense.org/>. */
1126

1227
#ifndef _CPPP_PLATFORM_H
1328
#define _CPPP_PLATFORM_H

0 commit comments

Comments
 (0)