Skip to content

Commit ec1efe0

Browse files
committed
Optimize the way to import build-aux.
修改: CMakeLists.txt 修改: ChangeLog
1 parent c000804 commit ec1efe0

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,20 @@ option(ENABLE_EXTRA "Enable extra encodings and features." OFF)
2424
# Set C++ standard
2525
set(CMAKE_CXX_STANDARD 11)
2626

27+
# ----------------------------------------------------------------------------------
28+
# Import build-aux subdirectory.
2729
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/build-aux")
2830
set(BUILD_AUX "${CMAKE_CURRENT_SOURCE_DIR}/build-aux")
31+
add_subdirectory("${BUILD_AUX}")
32+
message(STATUS "Using '${BUILD_AUX}' for C++ Plus build-aux directory.")
2933
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../build-aux")
3034
set(BUILD_AUX "${CMAKE_CURRENT_SOURCE_DIR}/../build-aux")
3135
else()
3236
message(FATAL_ERROR "CMake build-aux directory is not exists, try to execute 'setup.cmd' or './setup.sh' to get it.")
3337
endif()
34-
set(AUX_DIR "${BUILD_AUX}/cmake")
35-
36-
message(STATUS "Using '${BUILD_AUX}' for C++ Plus build-aux directory.")
37-
add_subdirectory("${BUILD_AUX}" "${CMAKE_CURRENT_SOURCE_DIR}")
38-
39-
include("${AUX_DIR}/cppp.cmake")
38+
get_filename_component(BUILD_AUX "${BUILD_AUX}" ABSOLUTE)
39+
include("${BUILD_AUX}/cmake/cppp.cmake")
40+
# ----------------------------------------------------------------------------------
4041

4142
check_have_visibility()
4243

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
2023-08-24 ChenPi11 <wushengwuxi-msctinoulk@outlook.com>
22

33
Fix subdirectory import bug.
4+
Optimize the way to import build-aux.
45

56
2023-08-23 ChenPi11 <wushengwuxi-msctinoulk@outlook.com>
67

0 commit comments

Comments
 (0)