1- ##############################################################################
1+ # #############################################################################
22# CMAKE CONFIGURATION
3- ##############################################################################
3+ # #############################################################################
44cmake_minimum_required (VERSION 3.5.1 FATAL_ERROR)
55
66# set project name
7- project (pcl-visualizer VERSION 1.0.0
8- DESCRIPTION "Point cloud visualizser with PCL"
7+ project (pcl-visualizer VERSION 1.0.0
8+ DESCRIPTION "Point cloud visualizser with PCL"
99)
1010
1111# set build type = Release mode
@@ -22,56 +22,59 @@ set(CMAKE_CXX_STANDARD 17)
2222set (CMAKE_CXX_STANDARD_REQUIRED True )
2323set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage" )
2424set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage" )
25- ##############################################################################
25+
26+ # #############################################################################
2627# PACKAGES DEPENDENCIES
27- ##############################################################################
28+ # #############################################################################
2829message ("${BoldYellow} ***********************" )
2930message ("${BoldYellow} PCL PACKAGE" )
3031message ("${BoldYellow} ***********************" )
3132
3233find_package (PCL 1.8 REQUIRED QUIET )
34+
3335if (PCL_FOUND)
3436 message (STATUS "${BoldGreen} PCL status:" )
3537 message (STATUS " version: ${PCL_VERSION} " )
3638 message (STATUS " directory: ${PCL_DIR} " )
3739else ()
38- message (FATAL_ERROR "${BoldRed} ERROR: PCL minimum required version 1.8. Not found" )
40+ message (FATAL_ERROR "${BoldRed} ERROR: PCL minimum required version 1.8. Not found" )
3941endif ()
4042
4143message ("${BoldYellow} ***********************" )
4244message ("${BoldYellow} VTK PACKAGE" )
4345message ("${BoldYellow} ***********************" )
4446
4547find_package (VTK 8.1 REQUIRED QUIET )
48+
4649if (VTK_FOUND)
4750 message (STATUS "${BoldGreen} VTK status:" )
4851 message (STATUS " version: ${VTK_VERSION} " )
4952 message (STATUS " directory: ${VTK_DIR} " )
5053else ()
51- message (FATAL_ERROR "${BoldRed} ERROR: VTK minimum required version 8.1. Not found" )
54+ message (FATAL_ERROR "${BoldRed} ERROR: VTK minimum required version 8.1. Not found" )
5255endif ()
5356
5457# Use the compile definitions defined in PCL
5558add_definitions (${PCL_DEFINITIONS} )
5659
57- ##############################################################################
60+ # #############################################################################
5861# ADD LIBRARIES FOLDER
59- ##############################################################################
62+ # #############################################################################
6063add_subdirectory (parser)
6164
62- ##############################################################################
65+ # #############################################################################
6366# SOURCE CODE
64- ##############################################################################
67+ # #############################################################################
6568set (MAIN_SOURCE "src/main.cpp" )
6669
67- ##############################################################################
70+ # #############################################################################
6871# EXECUTABLES
69- ##############################################################################
72+ # #############################################################################
7073add_executable (${PROJECT_NAME} ${MAIN_SOURCE} )
7174
72- ##############################################################################
75+ # #############################################################################
7376# TARGET LIBRARIES
74- ##############################################################################
77+ # #############################################################################
7578target_include_directories (${PROJECT_NAME} PRIVATE ${PCL_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS} )
7679target_include_directories (cloud_parser PRIVATE ${PCL_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS} )
7780target_link_libraries (${PROJECT_NAME} ${PCL_LIBRARIES} ${VTK_LIBRARIES} cloud_parser)
@@ -81,9 +84,9 @@ message("${BoldCyan}=========================================")
8184message ("${BoldCyan} Project: ${PROJECT_NAME} COMPILED WITH CMAKE " ${CMAKE_VERSION} )
8285message ("${BoldCyan} =========================================" )
8386
84- ##############################################################################
87+ # #############################################################################
8588# INSTALL DIRECTORY
86- ##############################################################################
89+ # #############################################################################
8790install (TARGETS ${PROJECT_NAME}
8891 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
8992 PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
@@ -97,10 +100,16 @@ if(BUILD_TESTING)
97100 enable_testing ()
98101 add_subdirectory (external)
99102 add_subdirectory (tests)
103+
100104 if (CODE_COVERAGE)
101- message ("${BoldWhite} Coverage enabled ${ColourReset} " )
105+ message ("${BoldWhite} Coverage enabled ${ColourReset} " )
102106 include ("${CMAKE_CURRENT_LIST_DIR} /cmake/CodeCoverage.cmake" )
103107 append_coverage_compiler_flags()
104- setup_target_for_coverage_lcov(NAME coverage EXECUTABLE testlib BASE_DIRECTORY ../coverage)
108+ setup_target_for_coverage_lcov(NAME coverage EXECUTABLE ctest -j ${n_cores}
109+ BASE_DIRECTORY ../coverage
110+ DEPENDENCIES
111+ testlib
112+ testconcreteparses
113+ )
105114 endif ()
106115endif ()
0 commit comments