Skip to content

Commit 56bb0d1

Browse files
committed
build: CPM is disabled by default
Signed-off-by: ComixHe <ComixHe1895@outlook.com>
1 parent 72ca241 commit 56bb0d1

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

CMakeLists.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ set(linyaps-box_ACTIVE_LOG_LEVEL
9191
)
9292

9393
set(linyaps-box_ENABLE_CPM
94-
ON
94+
OFF
9595
CACHE BOOL "enable CPM")
9696

9797
if(CMAKE_VERSION VERSION_LESS "3.14")
@@ -105,11 +105,6 @@ set(linyaps-box_CPM_LOCAL_PACKAGES_ONLY
105105
OFF
106106
CACHE BOOL "use local packages only")
107107

108-
if(linyaps-box_CPM_LOCAL_PACKAGES_ONLY)
109-
message(STATUS "CPM is disabled")
110-
set(linyaps-box_ENABLE_CPM OFF)
111-
endif()
112-
113108
# ==============================================================================
114109

115110
set(linyaps-box_LIBRARY linyaps-box)
@@ -228,6 +223,10 @@ if(linyaps-box_ENABLE_CPM)
228223
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
229224
include(CPM)
230225

226+
if (linyaps-box_CPM_LOCAL_PACKAGES_ONLY)
227+
set(CPM_USE_LOCAL_PACKAGES ON)
228+
endif()
229+
231230
CPMFindPackage(
232231
NAME nlohmann_json
233232
VERSION 3.11.3

CMakePresets.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": 6,
2+
"version": 10,
33
"cmakeMinimumRequired": {
44
"major": 3,
55
"minor": 25,
@@ -21,7 +21,8 @@
2121
"linyaps-box_CPACK_PACKAGING_INSTALL_PREFIX": "",
2222
"linyaps-box_ENABLE_SMOKE_TESTS": true,
2323
"linyaps-box_DEFAULT_LOG_LEVEL": "7",
24-
"linyaps-box_ACTIVE_LOG_LEVEL": "7"
24+
"linyaps-box_ACTIVE_LOG_LEVEL": "7",
25+
"linyaps-box_ENABLE_CPM": "ON"
2526
}
2627
},
2728
{
@@ -47,7 +48,9 @@
4748
"CMAKE_COLOR_DIAGNOSTICS": true,
4849
"CMAKE_CXX_FLAGS": "-fno-asynchronous-unwind-tables -fdata-sections -ffunction-sections -flto=auto $env{CXXFLAGS}",
4950
"CMAKE_EXE_LINKER_FLAGS_INIT": "-Wl,--gc-sections,--strip-all,--exclude-libs,ALL -flto=auto",
50-
"linyaps-box_STATIC": true
51+
"linyaps-box_STATIC": true,
52+
"linyaps-box_ENABLE_CPACK": "ON",
53+
"linyaps-box_MAKE_RELEASE": "ON"
5154
}
5255
},
5356
{

0 commit comments

Comments
 (0)