-
Notifications
You must be signed in to change notification settings - Fork 191
/
Copy pathpackage-lock_prettify.cmake
42 lines (38 loc) · 1.13 KB
/
package-lock_prettify.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
include(${CPM_PATH}/CPM.cmake)
include(${CPM_PATH}/testing.cmake)
# cmake-format: off
cpm_prettify_package_arguments(PRETTY_ARGN false
NAME Dependency
SOURCE_DIR ${CMAKE_SOURCE_DIR}/local_dependency/dependency
UPDATE_DISCONNECTED ON
TESTCUSTOMDATA TRUE
)
# cmake-format: on
set(EXPECTED_UNCOMMENTED
" NAME Dependency
SOURCE_DIR \${CMAKE_SOURCE_DIR}/local_dependency/dependency
UPDATE_DISCONNECTED ON TESTCUSTOMDATA TRUE
"
)
assert_equal(${PRETTY_ARGN} ${EXPECTED_UNCOMMENTED})
# cmake-format: off
cpm_prettify_package_arguments(PRETTY_ARGN true
NAME Dependency
SOURCE_DIR ${CMAKE_SOURCE_DIR}/local_dependency/dependency
UPDATE_DISCONNECTED ON
TESTCUSTOMDATA TRUE
)
# cmake-format: on
set(EXPECTED_COMMENTED
"# NAME Dependency
# SOURCE_DIR \${CMAKE_SOURCE_DIR}/local_dependency/dependency
# UPDATE_DISCONNECTED ON TESTCUSTOMDATA TRUE
"
)
assert_equal(${PRETTY_ARGN} ${EXPECTED_COMMENTED})
cpm_prettify_package_arguments(PRETTY_ARGN true "local directory")
set(EXPECTED_COMMENTED_LOCALDIR "# local directory
"
)
assert_equal(${PRETTY_ARGN} ${EXPECTED_COMMENTED_LOCALDIR})