Skip to content

Commit 9f7bfcc

Browse files
committed
Optimize the way to import build-aux.
修改: CMakeLists.txt 修改: ChangeLog
1 parent 22a8105 commit 9f7bfcc

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,20 @@ project(cppp-platform VERSION 1.3.0)
2020
# Set C++ standard
2121
set(CMAKE_CXX_STANDARD 11)
2222

23+
# ----------------------------------------------------------------------------------
24+
# Import build-aux subdirectory.
2325
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/build-aux")
2426
set(BUILD_AUX "${CMAKE_CURRENT_SOURCE_DIR}/build-aux")
27+
add_subdirectory("${BUILD_AUX}")
28+
message(STATUS "Using '${BUILD_AUX}' for C++ Plus build-aux directory.")
2529
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../build-aux")
2630
set(BUILD_AUX "${CMAKE_CURRENT_SOURCE_DIR}/../build-aux")
2731
else()
2832
message(FATAL_ERROR "CMake build-aux directory is not exists, try to execute 'setup.cmd' or './setup.sh' to get it.")
2933
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")
34+
get_filename_component(BUILD_AUX "${BUILD_AUX}" ABSOLUTE)
35+
include("${BUILD_AUX}/cmake/cppp.cmake")
36+
# ----------------------------------------------------------------------------------
3637

3738
# Read source files
3839
file(READ "${srcdir}/src/architectures.h" ARCHITECTURES)

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2023-08-24 ChenPi11 <wushengwuxi-msctinoulk@outlook.com>
2+
3+
Optimize the way to import build-aux.
4+
15
2023-08-09 ChenPi11 <wushengwuxi-msctinoulk@outlook.com>
26

37
Add C++ Plus package infomation.

0 commit comments

Comments
 (0)