Skip to content

Commit 3f4eed1

Browse files
aphecetchedavidrohr
authored andcommitted
[CMake] The Modern CMake Migration.
Only changes in cmake-related files in this commit. Basically all CMakeLists.txt have been modified, plus most of the *.cmake ones.
1 parent 0642ad1 commit 3f4eed1

247 files changed

Lines changed: 9452 additions & 11135 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cmake-format.py

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
# How wide to allow formatted cmake files
2+
line_width = 80
3+
4+
# How many spaces to tab for indent
5+
tab_size = 2
6+
7+
# If arglists are longer than this, break them always
8+
max_subargs_per_line = 5
9+
10+
# If true, separate flow control names from their parentheses with a space
11+
separate_ctrl_name_with_space = False
12+
13+
# If true, separate function names from parentheses with a space
14+
separate_fn_name_with_space = False
15+
16+
# If a statement is wrapped to more than one line, than dangle the closing
17+
# parenthesis on it's own line
18+
dangle_parens = False
19+
20+
# What character to use for bulleted lists
21+
bullet_char = '*'
22+
23+
# What character to use as punctuation after numerals in an enumerated list
24+
enum_char = '.'
25+
26+
# What style line endings to use in the output.
27+
line_ending = 'unix'
28+
29+
# Format command names consistently as 'lower' or 'upper' case
30+
command_case = 'canonical'
31+
32+
# Format keywords consistently as 'lower' or 'upper' case
33+
keyword_case = 'upper'
34+
35+
# Specify structure for custom cmake functions
36+
# * = ZERO_OR_MORE
37+
# + = ONE_OR_MORE
38+
additional_commands = {
39+
"o2_add_executable": {
40+
"flags": ["IS_TEST", "IS_BENCHMARK", "NO_INSTALL"],
41+
"kwargs": {
42+
"SOURCES": '+',
43+
"PUBLIC_LINK_LIBRARIES": '*',
44+
"COMPONENT_NAME": '*',
45+
"EXEVARNAME": '*'
46+
}
47+
},
48+
"o2_add_header_only_library": {
49+
"kwargs": {
50+
"INCLUDE_DIRECTORIES": '*',
51+
"INTERFACE_LINK_LIBRARIES": '*',
52+
}
53+
},
54+
"o2_add_library": {
55+
"kwargs": {
56+
"SOURCES": '+',
57+
"PUBLIC_INCLUDE_DIRECTORIES": '*',
58+
"PUBLIC_LINK_LIBRARIES": '*',
59+
"PRIVATE_INCLUDE_DIRECTORIES": '*',
60+
"TARGETVARNAME": '*',
61+
}
62+
},
63+
"o2_target_root_dictionary": {
64+
"kwargs": {
65+
"LINKDEF": '+',
66+
"HEADERS": '*',
67+
}
68+
},
69+
"o2_target_man_page": {
70+
"kwargs": {
71+
"NAME": '+',
72+
"SECTION": '*',
73+
}
74+
},
75+
"add_root_dictionary": {
76+
"kwargs": {
77+
"LINKDEF": '+',
78+
"HEADERS": '*',
79+
"BASENAME": '*',
80+
}
81+
},
82+
"o2_data_file": {
83+
"kwargs": {
84+
"COPY": '+',
85+
"DESTINATION": '*',
86+
}
87+
},
88+
"o2_add_test_wrapper": {
89+
"flags": ["DONT_FAIL_ON_TIMEOUT", "NON_FATAL"],
90+
"kwargs": {
91+
"COMMAND": '*',
92+
"NO_BOOST_TEST": '*',
93+
"MAX_ATTEMPTS": '*',
94+
"TIMEOUT": '*',
95+
"NAME": '*',
96+
"WORKING_DIRECTORY": '*',
97+
"CONFIGURATIONS": '*',
98+
"COMMAND_LINE_ARGS": '*',
99+
"LABELS": '*',
100+
"ENVIRONMENT": '*',
101+
}
102+
},
103+
"o2_add_test": {
104+
"kwargs": {
105+
"INSTALL": '*',
106+
"NO_BOOST_TEST": '*',
107+
"NON_FATAL": '*',
108+
"COMPONENT_NAME": '*',
109+
"MAX_ATTEMPTS": '*',
110+
"TIMEOUT": '*',
111+
"WORKING_DIRECTORY": '*',
112+
"SOURCES": '*',
113+
"PUBLIC_LINK_LIBRARIES": '*',
114+
"COMMAND_LINE_ARGS": '*',
115+
"LABELS": '*',
116+
"ENVIRONMENT": '*',
117+
}
118+
},
119+
"o2_add_test_root_macro": {
120+
"flags": ["NON_FATAL", "LOAD_ONLY"],
121+
"kwargs": {
122+
"ENVIRONMENT": '*',
123+
"PUBLIC_LINK_LIBRARIES": '*',
124+
"LABELS": '*',
125+
}
126+
},
127+
"o2_name_target": {
128+
"kwargs": {
129+
"INCLUDE_DIRECTORIES": '*',
130+
"INTERFACE_LINK_LIBRARIES": '*',
131+
}
132+
},
133+
"find_package_handle_standard_args": {
134+
"flags": ["CONFIG_MODE"],
135+
"kwargs": {
136+
"DEFAULT_MSG": '*',
137+
"REQUIRED_VARS": '*',
138+
"VERSION_VAR": '*',
139+
"HANDLE_COMPONENTS": '*',
140+
"FAIL_MESSAGE": '*'
141+
}
142+
},
143+
"set_package_properties": {
144+
"kwargs": {
145+
"PROPERTIES": '*',
146+
"URL": '*',
147+
"TYPE": '*',
148+
"PURPOSE": '*'
149+
}
150+
}
151+
}
152+
153+
# A list of command names which should always be wrapped
154+
always_wrap = []
155+
156+
# Specify the order of wrapping algorithms during successive reflow attempts
157+
algorithm_order = [0, 1, 2, 3, 4]
158+
159+
# If true, the argument lists which are known to be sortable will be sorted
160+
# lexicographicall
161+
autosort = False
162+
163+
# enable comment markup parsing and reflow
164+
enable_markup = True
165+
166+
# If comment markup is enabled, don't reflow the first comment block in
167+
# eachlistfile. Use this to preserve formatting of your
168+
# copyright/licensestatements.
169+
first_comment_is_literal = False
170+
171+
# If comment markup is enabled, don't reflow any comment block which matchesthis
172+
# (regex) pattern. Default is `None` (disabled).
173+
literal_comment_pattern = None
174+
175+
# Regular expression to match preformat fences in comments
176+
# default=r'^\s*([`~]{3}[`~]*)(.*)$'
177+
fence_pattern = '^\\s*([`~]{3}[`~]*)(.*)$'
178+
179+
# Regular expression to match rulers in comments
180+
# default=r'^\s*[^\w\s]{3}.*[^\w\s]{3}$'
181+
ruler_pattern = '^\\s*[^\\w\\s]{3}.*[^\\w\\s]{3}$'
182+
183+
# If true, emit the unicode byte-order mark (BOM) at the start of the file
184+
emit_byteorder_mark = False
185+
186+
# If a comment line starts with at least this many consecutive hash characters,
187+
# then don't lstrip() them off. This allows for lazy hash rulers where the first
188+
# hash char is not separated by space
189+
hashruler_min_length = 10
190+
191+
# If true, then insert a space between the first hash char and remaining hash
192+
# chars in a hash ruler, and normalize it's length to fill the column
193+
canonicalize_hashrulers = True
194+
195+
# Specify the encoding of the input file. Defaults to utf-8.
196+
input_encoding = 'utf-8'
197+
198+
# Specify the encoding of the output file. Defaults to utf-8. Note that cmake
199+
# only claims to support utf-8 so be careful when using anything else
200+
output_encoding = 'utf-8'
201+
202+
# A dictionary containing any per-command configuration overrides. Currently
203+
# only `command_case` is supported.
204+
per_command = {}

Algorithm/CMakeLists.txt

Lines changed: 54 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,54 @@
1-
# @author Matthias Richter
2-
# @brief cmake setup for module Algorithm
3-
4-
set(MODULE_NAME "Algorithm")
5-
6-
O2_SETUP(NAME ${MODULE_NAME})
7-
8-
set(SRCS
9-
)
10-
11-
set(LIBRARY_NAME ${MODULE_NAME})
12-
13-
set(BUCKET_NAME Algorithm_bucket)
14-
15-
# no library for the moment
16-
#O2_GENERATE_LIBRARY()
17-
18-
Set(Exe_Names
19-
)
20-
21-
set(Exe_Source
22-
)
23-
24-
list(LENGTH Exe_Names _length)
25-
if (LENGTH)
26-
math(EXPR _length ${_length}-1)
27-
28-
ForEach (_file RANGE 0 ${_length})
29-
list(GET Exe_Names ${_file} _name)
30-
list(GET Exe_Source ${_file} _src)
31-
O2_GENERATE_EXECUTABLE(
32-
EXE_NAME ${_name}
33-
SOURCES ${_src}
34-
MODULE_LIBRARY_NAME ${LIBRARY_NAME}
35-
BUCKET_NAME ${BUCKET_NAME}
36-
)
37-
EndForEach (_file RANGE 0 ${_length})
38-
endif()
39-
40-
set(TEST_SRCS
41-
test/o2formatparser.cxx
42-
test/headerstack.cxx
43-
test/parser.cxx
44-
test/tableview.cxx
45-
test/pageparser.cxx
46-
test/test_mpl_tools.cxx
47-
test/test_RangeTokenizer.cxx
48-
test/test_BitstreamReader.cxx
49-
)
50-
51-
O2_GENERATE_TESTS(
52-
BUCKET_NAME ${BUCKET_NAME}
53-
TEST_SRCS ${TEST_SRCS}
54-
)
55-
56-
O2_GENERATE_MAN(NAME Algorithm SECTION 3)
57-
O2_GENERATE_MAN(NAME algorithm_parser SECTION 3)
1+
# Copyright CERN and copyright holders of ALICE O2. This software is distributed
2+
# under the terms of the GNU General Public License v3 (GPL Version 3), copied
3+
# verbatim in the file "COPYING".
4+
#
5+
# See http://alice-o2.web.cern.ch/license for full licensing information.
6+
#
7+
# In applying this license CERN does not waive the privileges and immunities
8+
# granted to it by virtue of its status as an Intergovernmental Organization or
9+
# submit itself to any jurisdiction.
10+
11+
o2_add_header_only_library(Algorithm INTERFACE_LINK_LIBRARIES O2::Headers)
12+
13+
o2_target_man_page(Algorithm NAME Algorithm SECTION 3)
14+
o2_target_man_page(Algorithm NAME algorithm_parser SECTION 3)
15+
16+
o2_add_test(o2formatparser
17+
SOURCES test/o2formatparser.cxx
18+
COMPONENT_NAME Algorithm
19+
PUBLIC_LINK_LIBRARIES O2::Algorithm
20+
LABELS algorithm)
21+
22+
o2_add_test(headerstack
23+
SOURCES test/headerstack.cxx
24+
COMPONENT_NAME Algorithm
25+
PUBLIC_LINK_LIBRARIES O2::Algorithm
26+
LABELS algorithm)
27+
28+
o2_add_test(parser
29+
SOURCES test/parser.cxx
30+
COMPONENT_NAME Algorithm
31+
PUBLIC_LINK_LIBRARIES O2::Algorithm
32+
LABELS algorithm)
33+
34+
o2_add_test(tableview
35+
SOURCES test/tableview.cxx
36+
COMPONENT_NAME Algorithm
37+
PUBLIC_LINK_LIBRARIES O2::Algorithm
38+
LABELS algorithm)
39+
40+
o2_add_test(pageparser
41+
SOURCES test/pageparser.cxx
42+
COMPONENT_NAME Algorithm
43+
PUBLIC_LINK_LIBRARIES O2::Algorithm
44+
LABELS algorithm)
45+
46+
o2_add_test(mpl_tools
47+
SOURCES test/test_mpl_tools.cxx
48+
COMPONENT_NAME Algorithm
49+
LABELS algorithm)
50+
51+
o2_add_test(RangeTokenizer
52+
SOURCES test/test_RangeTokenizer.cxx
53+
COMPONENT_NAME Algorithm
54+
LABELS algorithm)

AliceO2_test.cmake

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)