Skip to content

Commit c6525d9

Browse files
committed
Update CMakelists
Signed-off-by: Alberto Tudela <[email protected]>
1 parent 404a2fe commit c6525d9

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

CMakeLists.txt

+29
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
cmake_minimum_required(VERSION 3.5)
22
project(laser_segmentation)
33

4+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
5+
message(STATUS "Setting build type to Release as none was specified.")
6+
set(CMAKE_BUILD_TYPE "Release" CACHE
7+
STRING "Choose the type of build." FORCE)
8+
9+
# Set the possible values of build type for cmake-gui
10+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
11+
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
12+
endif()
13+
414
# Default to C++17
515
if(NOT CMAKE_CXX_STANDARD)
616
if("cxx_std_17" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
@@ -15,6 +25,25 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
1525
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-Wnon-virtual-dtor>")
1626
endif()
1727

28+
option(COVERAGE_ENABLED "Enable code coverage" FALSE)
29+
if(COVERAGE_ENABLED)
30+
add_compile_options(--coverage)
31+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
32+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage")
33+
endif()
34+
35+
# Defaults for Microsoft C++ compiler
36+
if(MSVC)
37+
# https://blog.kitware.com/create-dlls-on-windows-without-declspec-using-new-cmake-export-all-feature/
38+
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
39+
40+
# Enable Math Constants
41+
# https://docs.microsoft.com/en-us/cpp/c-runtime-library/math-constants?view=vs-2019
42+
add_compile_definitions(
43+
_USE_MATH_DEFINES
44+
)
45+
endif()
46+
1847
# ###############################################
1948
# # Find dependencies ##
2049
# ###############################################

package.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<name>laser_segmentation</name>
55
<version>3.0.0</version>
66
<description>Implementation of algorithms for segmentation of laserscans.</description>
7-
<maintainer email="[email protected]">Alberto J. Tudela Roldán</maintainer>
7+
<maintainer email="[email protected]">Alberto Tudela</maintainer>
88
<maintainer email="[email protected]">Manuel Fernandez-Carmona</maintainer>
99
<license>Apache-2.0</license>
10-
<author email="[email protected]">Alberto J. Tudela Roldán</author>
10+
<author email="[email protected]">Alberto Tudela</author>
1111
<buildtool_depend>ament_cmake</buildtool_depend>
1212
<depend>rclcpp</depend>
1313
<depend>rclcpp_components</depend>

0 commit comments

Comments
 (0)