@@ -16,6 +16,22 @@ group CMakeLists;
16
16
17
17
cmakelists(solution, test) ::= <<
18
18
19
+ $if (solution)$
20
+ # Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima).
21
+ #
22
+ # Licensed under the Apache License, Version 2.0 (the "License");
23
+ # you may not use this file except in compliance with the License.
24
+ # You may obtain a copy of the License at
25
+ #
26
+ # http://www.apache.org/licenses/LICENSE-2.0
27
+ #
28
+ # Unless required by applicable law or agreed to in writing, software
29
+ # distributed under the License is distributed on an "AS IS" BASIS,
30
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31
+ # See the License for the specific language governing permissions and
32
+ # limitations under the License.
33
+ $endif$
34
+
19
35
cmake_minimum_required(VERSION 3.20)
20
36
21
37
project("generated_code")
@@ -41,6 +57,17 @@ $endif$
41
57
find_package(fastcdr REQUIRED)
42
58
find_package(fastdds 3 REQUIRED)
43
59
60
+ $if (solution)$
61
+ # Set CMAKE_BUILD_TYPE to Release by default.
62
+ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
63
+ message(STATUS "Setting build type to 'Release' as none was specified.")
64
+ set(CMAKE_BUILD_TYPE Release CACHE STRING
65
+ "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
66
+ FORCE)
67
+ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
68
+ endif()
69
+ $endif$
70
+
44
71
$solution.projects : { project | $pub_sub_execs(project=project, libraries=solution.libraries, test=test)$}; separator="\n"$
45
72
46
73
$if (test)$
0 commit comments