From 00a5e8f2a509a937130fe86ee5552df4fd4e2caa Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco-Claraco Date: Mon, 19 Aug 2024 23:56:29 +0200 Subject: [PATCH 1/3] Fix: MRPT_INSTALL_CONFIG_HEADERS controls duplicated file in new ROS2 .deb packages --- cmakemodules/script_install_commands.cmake | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cmakemodules/script_install_commands.cmake b/cmakemodules/script_install_commands.cmake index 1b8f09487d..ace12b7cc3 100644 --- a/cmakemodules/script_install_commands.cmake +++ b/cmakemodules/script_install_commands.cmake @@ -2,20 +2,6 @@ # More installation commands: # ---------------------------------------------------------------------------- -# MRPTConfig.cmake: backwards-compatible file as it was named in mrpt v1.x -if(WIN32) - set(cfg_ver_destdir "./") -else() - set(cfg_ver_destdir "share/mrpt") -endif() -install( - FILES - "${MRPT_SOURCE_DIR}/parse-files/mrpt-config.cmake" - "${CMAKE_BINARY_DIR}/mrpt-config-version.cmake" - DESTINATION - ${cfg_ver_destdir} - ) - # Docs, examples and the rest of files: if(WIN32) install(DIRECTORY @@ -101,4 +87,18 @@ if (MRPT_INSTALL_CONFIG_HEADERS) DESTINATION "include/mrpt/" ) + + # MRPTConfig.cmake: backwards-compatible file as it was named in mrpt v1.x + if(WIN32) + set(cfg_ver_destdir "./") + else() + set(cfg_ver_destdir "share/mrpt") + endif() + install( + FILES + "${MRPT_SOURCE_DIR}/parse-files/mrpt-config.cmake" + "${CMAKE_BINARY_DIR}/mrpt-config-version.cmake" + DESTINATION + ${cfg_ver_destdir} + ) endif() \ No newline at end of file From 11034adf26e38af9b6d755d92d72e9ba9ba3f4a4 Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco-Claraco Date: Tue, 20 Aug 2024 23:56:04 +0200 Subject: [PATCH 2/3] Fix ancient cmake syntax --- CMakeLists.txt | 2 +- apps/robot-map-gui/CMakeLists.txt | 2 +- cmakemodules/AssureCMakeRootFile.cmake | 2 +- cmakemodules/DebugMacros.cmake | 22 +++++++++---------- cmakemodules/DeclareMEXLib.cmake | 20 ++++++++--------- cmakemodules/DeclareMRPTLib.cmake | 2 +- cmakemodules/FilterFileLists.cmake | 8 +++---- cmakemodules/FindDC1394.cmake | 4 ++-- cmakemodules/FindMatlab.cmake | 4 ++-- cmakemodules/FindOpenMP.cmake | 6 ++--- cmakemodules/FindPHIDGETS.cmake | 2 +- cmakemodules/Findcodecov.cmake | 2 +- cmakemodules/UtilsMacros.cmake | 10 ++++----- cmakemodules/cotire.cmake | 6 ++--- cmakemodules/script_assimp.cmake | 2 +- cmakemodules/script_declare_defines.cmake | 6 ++--- cmakemodules/script_ffmpeg.cmake | 6 ++--- cmakemodules/script_ftdi.cmake | 6 ++--- cmakemodules/script_gridmap_options.cmake | 2 +- cmakemodules/script_inotify.cmake | 8 +++---- cmakemodules/script_install_commands.cmake | 2 +- cmakemodules/script_isense.cmake | 6 ++--- cmakemodules/script_jpeg.cmake | 4 ++-- cmakemodules/script_kinect.cmake | 2 +- cmakemodules/script_libdc1394.cmake | 6 ++--- cmakemodules/script_liblas.cmake | 14 ++++++------ cmakemodules/script_matlab.cmake | 20 ++++++++--------- .../script_national_instruments.cmake | 12 +++++----- cmakemodules/script_nite2.cmake | 18 +++++++-------- cmakemodules/script_phidget.cmake | 2 +- cmakemodules/script_qt.cmake | 2 +- cmakemodules/script_show_final_summary.cmake | 4 ++-- cmakemodules/script_swissrange.cmake | 18 +++++++-------- cmakemodules/script_version_number.cmake | 4 ++-- cmakemodules/script_videre_svs.cmake | 16 +++++++------- cmakemodules/script_wxwidgets.cmake | 2 +- libs/bayes/CMakeLists.txt | 2 +- libs/containers/CMakeLists.txt | 2 +- libs/obs/CMakeLists.txt | 2 +- libs/rtti/CMakeLists.txt | 2 +- libs/serialization/CMakeLists.txt | 2 +- libs/tclap/CMakeLists.txt | 2 +- libs/typemeta/CMakeLists.txt | 2 +- parse-files/cmake_uninstall.cmake.in | 8 +++---- samples/CMakeLists.txt | 2 +- 45 files changed, 139 insertions(+), 139 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e89d0b0141..d819359592 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ mark_as_advanced(CMAKE_TIMING_VERBOSE) if(CMAKE_TIMING_VERBOSE AND UNIX) set_property(GLOBAL PROPERTY RULE_MESSAGES OFF) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CMAKE_CURRENT_SOURCE_DIR}/cmakemodules/custom_output.sh") -endif(CMAKE_TIMING_VERBOSE AND UNIX) +endif() # Detect wordsize: if(CMAKE_SIZEOF_VOID_P EQUAL 8) # Size in bytes! diff --git a/apps/robot-map-gui/CMakeLists.txt b/apps/robot-map-gui/CMakeLists.txt index 61aae80ca4..c42a2595bc 100644 --- a/apps/robot-map-gui/CMakeLists.txt +++ b/apps/robot-map-gui/CMakeLists.txt @@ -100,4 +100,4 @@ if(CMAKE_MRPT_HAS_Qt5 AND CMAKE_MRPT_HAS_OPENGL_GLUT) DeclareAppForInstall(${PROJECT_NAME}) AppStartMenuLink(${PROJECT_NAME} "Robot-made maps viewer") # Add link to the Start menu (in Windows Installable packages) -endif(CMAKE_MRPT_HAS_Qt5 AND CMAKE_MRPT_HAS_OPENGL_GLUT) +endif() diff --git a/cmakemodules/AssureCMakeRootFile.cmake b/cmakemodules/AssureCMakeRootFile.cmake index c8a854a150..cf03fc7f7d 100644 --- a/cmakemodules/AssureCMakeRootFile.cmake +++ b/cmakemodules/AssureCMakeRootFile.cmake @@ -8,6 +8,6 @@ if(NOT MRPT_SOURCE_DIR) message(FATAL_ERROR "ERROR: Do not use this directory as 'source directory' in CMake, but the ROOT directory of the MRPT source tree.") -endif(NOT MRPT_SOURCE_DIR) +endif() diff --git a/cmakemodules/DebugMacros.cmake b/cmakemodules/DebugMacros.cmake index 44c1313786..a62512b74a 100644 --- a/cmakemodules/DebugMacros.cmake +++ b/cmakemodules/DebugMacros.cmake @@ -8,32 +8,32 @@ macro( DEBUG_INCLUDE_DIRECTORIES _TAG ) foreach(dir ${debug_dirs}) message("${dir}") endforeach() - endif($ENV{DEBUG_VERBOSE}) -endmacro(DEBUG_INCLUDE_DIRECTORIES) + endif() +endmacro() -macro( DEBUG_VAR ) +macro(DEBUG_VAR) if($ENV{DEBUG_VERBOSE}) message(" ") foreach(var ${ARGN}) message("[DEBUG:VAR:${var}] ${${var}}") endforeach(var) - endif($ENV{DEBUG_VERBOSE}) -endmacro(DEBUG_VAR) + endif() +endmacro() -macro( DEBUG_GLOBAL_VAR ) +macro(DEBUG_GLOBAL_VAR) if($ENV{DEBUG_VERBOSE}) message(" ") foreach(var ${ARGN}) get_property(temp GLOBAL PROPERTY ${var} ) message("[DEBUG:GLOBAL_VAR:${var}] ${temp}") endforeach(var) - endif($ENV{DEBUG_VERBOSE}) -endmacro(DEBUG_GLOBAL_VAR) + endif() +endmacro() -macro( DEBUG_MESSAGE _msg ) +macro(DEBUG_MESSAGE _msg) message(" ") if($ENV{DEBUG_VERBOSE}) message("[DEBUG:MSG] ${_msg}") - endif($ENV{DEBUG_VERBOSE}) -endmacro(DEBUG_MESSAGE) + endif() +endmacro() diff --git a/cmakemodules/DeclareMEXLib.cmake b/cmakemodules/DeclareMEXLib.cmake index 0b60102e0f..02e9f6b34c 100644 --- a/cmakemodules/DeclareMEXLib.cmake +++ b/cmakemodules/DeclareMEXLib.cmake @@ -2,7 +2,7 @@ #----------------------------------------------------------------------- macro(define_mex_lib name) internal_define_mex_lib(${name} 0 ) # is_private = 0 -endmacro(define_mex_lib) +endmacro() # define_mex_lib_private(): Declares a private MEX library, which is stored in /private subfolder # private libraries are typically used for MEX classes (MEX libraries containing several methods @@ -11,7 +11,7 @@ endmacro(define_mex_lib) #----------------------------------------------------------------------- macro(define_mex_lib_private name) internal_define_mex_lib(${name} 1 ) # is_private = 1 -endmacro(define_mex_lib_private) +endmacro() # Implementation of both define_mex_lib() and define_mex_lib_private(): #----------------------------------------------------------------------------- @@ -21,22 +21,22 @@ macro(internal_define_mex_lib name is_private) if(${is_private}) set(subfolder private) # Special subfolder private in Matlab (restricted access) set(underscore "_") # Suffix _ (syntax chosen for private libraries) - endif(${is_private}) + endif() # 32-bit or 64-bit mex: choose correct suffix depending on system if(WIN32) if (CMAKE_CL_64) set(MEX_SUFFIX .mexw64) - else(CMAKE_CL_64) + else() set(MEX_SUFFIX .mexw32) - endif(CMAKE_CL_64) - else(WIN32) + endif() + else() if (CMAKE_SIZEOF_VOID_P MATCHES "8") set(MEX_SUFFIX .mexa64) - else(CMAKE_SIZEOF_VOID_P MATCHES "8") + else() set(MEX_SUFFIX .mexglx) endif (CMAKE_SIZEOF_VOID_P MATCHES "8") - endif(WIN32) + endif() # Define MEX library target with specific options set_target_properties(${name} PROPERTIES @@ -50,7 +50,7 @@ macro(internal_define_mex_lib name is_private) # Preprocessor #defines are done here to set proper behaviour of Matlab headers (e.g. matrix.h) during compilation add_definitions(/DMATLAB_MEX_FILE) # Equivalent to #define MATLAB_MEX_FILE add_definitions(/DMX_COMPAT_32) # Equivalent to #define MX_COMPAT_32 -endmacro(internal_define_mex_lib) +endmacro() # define_mex_test(): Declares a MEX executable which allows debug of mexFunction() through main() function: # Important: This scripts bases on previously configured MEX library, @@ -72,4 +72,4 @@ endmacro(internal_define_mex_lib) # Set MEX tests' output directory set_target_properties("${name}-test" PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${MEX_EXECUTABLE_OUTPUT_PATH}) -endmacro(define_mex_test name) +endmacro() diff --git a/cmakemodules/DeclareMRPTLib.cmake b/cmakemodules/DeclareMRPTLib.cmake index 4c3f359f75..79cb865f80 100644 --- a/cmakemodules/DeclareMRPTLib.cmake +++ b/cmakemodules/DeclareMRPTLib.cmake @@ -445,7 +445,7 @@ macro(internal_define_mrpt_lib name headers_only ) if (EXISTS "${PDB_FILE}") install(FILES ${PDB_FILE} DESTINATION bin COMPONENT LibrariesDebugInfoPDB) endif () - endif(MSVC) + endif() else() # it IS headers_only: install(TARGETS ${name} EXPORT mrpt-${name}-targets) endif () diff --git a/cmakemodules/FilterFileLists.cmake b/cmakemodules/FilterFileLists.cmake index e103a256ac..989aa804bb 100644 --- a/cmakemodules/FilterFileLists.cmake +++ b/cmakemodules/FilterFileLists.cmake @@ -7,17 +7,17 @@ macro(REMOVE_MATCHING_FILES_FROM_LIST match_expr lst_files) foreach(FIL ${${lst_files}}) if(NOT ${FIL} MATCHES "${match_expr}") set(lst_files_aux "${lst_files_aux}" "${FIL}") - endif(NOT ${FIL} MATCHES "${match_expr}") + endif() endforeach(FIL) set(${lst_files} ${lst_files_aux}) -endmacro(REMOVE_MATCHING_FILES_FROM_LIST) +endmacro() macro(KEEP_MATCHING_FILES_FROM_LIST match_expr lst_files) set(lst_files_aux "") foreach(FIL ${${lst_files}}) if(${FIL} MATCHES "${match_expr}") set(lst_files_aux "${lst_files_aux}" "${FIL}") - endif(${FIL} MATCHES "${match_expr}") + endif() endforeach(FIL) set(${lst_files} ${lst_files_aux}) -endmacro(KEEP_MATCHING_FILES_FROM_LIST) +endmacro() diff --git a/cmakemodules/FindDC1394.cmake b/cmakemodules/FindDC1394.cmake index e768ac9d1e..db452d27ad 100644 --- a/cmakemodules/FindDC1394.cmake +++ b/cmakemodules/FindDC1394.cmake @@ -30,6 +30,6 @@ if(DC1394_INCLUDE_DIR) #The following deprecated settings are for backwards compatibility with CMake1.4 set (DC1394_INCLUDE_PATH ${DC1394_INCLUDE_DIR}) - endif(DC1394_LIBRARY) -endif(DC1394_INCLUDE_DIR) + endif() +endif() diff --git a/cmakemodules/FindMatlab.cmake b/cmakemodules/FindMatlab.cmake index cfef4802b7..244a05f564 100755 --- a/cmakemodules/FindMatlab.cmake +++ b/cmakemodules/FindMatlab.cmake @@ -15,7 +15,7 @@ find_path(MATLAB_INCLUDE_DIR mex.h if(MATLAB_INCLUDE_DIR) # Protect against #include'ing undefined dirs. include_directories(${MATLAB_INCLUDE_DIR}) -endif(MATLAB_INCLUDE_DIR) +endif() find_library( MATLAB_MEX_LIBRARY NAMES libmex mex @@ -37,7 +37,7 @@ if(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES) set(MATLAB_FOUND 1) # get_filename_component(MATLAB_VERSION ${MATLAB_ROOT} NAME) # Find MATLAB version # set(MATLAB_VERSION ${MATLAB_VERSION} CACHE STRING "" FORCE) # Force value over GUI -endif(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES) +endif() mark_as_advanced( MATLAB_LIBRARIES diff --git a/cmakemodules/FindOpenMP.cmake b/cmakemodules/FindOpenMP.cmake index b21eea6abb..e9b6f04ef6 100644 --- a/cmakemodules/FindOpenMP.cmake +++ b/cmakemodules/FindOpenMP.cmake @@ -63,7 +63,7 @@ set(OpenMP_CXX_TEST_SOURCE ${OpenMP_C_TEST_SOURCE}) if(DEFINED OpenMP_C_FLAGS AND DEFINED OpenMP_CXX_FLAGS) set(OpenMP_C_FLAG_CANDIDATES) set(OpenMP_CXX_FLAG_CANDIDATES) -endif(DEFINED OpenMP_C_FLAGS AND DEFINED OpenMP_CXX_FLAGS) +endif() # check c compiler foreach(FLAG ${OpenMP_C_FLAG_CANDIDATES}) @@ -76,7 +76,7 @@ foreach(FLAG ${OpenMP_C_FLAG_CANDIDATES}) if(OpenMP_FLAG_DETECTED) set(OpenMP_C_FLAGS_INTERNAL "${FLAG}") break() - endif(OpenMP_FLAG_DETECTED) + endif() endforeach(FLAG ${OpenMP_C_FLAG_CANDIDATES}) # check cxx compiler @@ -90,7 +90,7 @@ foreach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES}) if(OpenMP_FLAG_DETECTED) set(OpenMP_CXX_FLAGS_INTERNAL "${FLAG}") break() - endif(OpenMP_FLAG_DETECTED) + endif() endforeach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES}) set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS_INTERNAL}" diff --git a/cmakemodules/FindPHIDGETS.cmake b/cmakemodules/FindPHIDGETS.cmake index 37dd3c04b0..7604d89973 100644 --- a/cmakemodules/FindPHIDGETS.cmake +++ b/cmakemodules/FindPHIDGETS.cmake @@ -45,4 +45,4 @@ if(PHIDGETS_LIBRARIES AND PHIDGETS_INCLUDE_DIR) mark_as_advanced(PHIDGETS_INCLUDE_DIR) mark_as_advanced(PHIDGETS_LIBRARIES) -endif(PHIDGETS_LIBRARIES AND PHIDGETS_INCLUDE_DIR) +endif() diff --git a/cmakemodules/Findcodecov.cmake b/cmakemodules/Findcodecov.cmake index f3da83935c..35cfa500d8 100644 --- a/cmakemodules/Findcodecov.cmake +++ b/cmakemodules/Findcodecov.cmake @@ -255,7 +255,7 @@ function(add_coverage_target TNAME) add_gcov_target(${TNAME}) add_lcov_target(${TNAME}) -endfunction(add_coverage_target) +endfunction() diff --git a/cmakemodules/UtilsMacros.cmake b/cmakemodules/UtilsMacros.cmake index d94747b1e1..657939353e 100644 --- a/cmakemodules/UtilsMacros.cmake +++ b/cmakemodules/UtilsMacros.cmake @@ -9,11 +9,11 @@ macro(STRING_APPEND _VAR _VALUE ) if (${_VAR}) # not empty, add space and value set(${_VAR} "${${_VAR}} ${_VALUE}") - else(${_VAR}) + else() # empty, no space required. set(${_VAR} "${_VALUE}") endif (${_VAR}) -endmacro(STRING_APPEND) +endmacro() # Based on: http://www.cmake.org/pipermail/cmake/2008-February/020114.html # Usage: list_subdirectories(the_list_is_returned_here C:/cwd) @@ -24,10 +24,10 @@ macro(list_subdirectories retval curdir) string(SUBSTRING ${dir} 0 1 dir1st) if(IS_DIRECTORY ${curdir}/${dir} AND NOT ${dir1st} STREQUAL "." AND NOT ${dir} STREQUAL "CMakeFiles") set(list_of_dirs ${list_of_dirs} ${dir}) - endif(IS_DIRECTORY ${curdir}/${dir} AND NOT ${dir1st} STREQUAL "." AND NOT ${dir} STREQUAL "CMakeFiles") + endif() endforeach(dir) set(${retval} ${list_of_dirs}) -endmacro(list_subdirectories) +endmacro() # Parse a list of "pkg-config"-like flags and split them into INCLUDE_DIRS,etc. @@ -55,7 +55,7 @@ macro(pkgconfig_parse _FLAGS _OUT_PREFIX) endif (${_START} STREQUAL "-L") endif (_LEN GREATER 2) endforeach(str) -endmacro(pkgconfig_parse ) +endmacro() # Converts a version like "1.2.3" into a string "0x10203", # or "3.4.19" into "0x30413". diff --git a/cmakemodules/cotire.cmake b/cmakemodules/cotire.cmake index 33b1d4e202..16ba9d910f 100644 --- a/cmakemodules/cotire.cmake +++ b/cmakemodules/cotire.cmake @@ -3318,7 +3318,7 @@ function (cotire_setup_unity_build_target _languages _configurations _target) cotire_init_target(${_unityTargetName}) cotire_add_to_unity_all_target(${_unityTargetName}) set_property(TARGET ${_target} PROPERTY COTIRE_UNITY_TARGET_NAME "${_unityTargetName}") -endfunction(cotire_setup_unity_build_target) +endfunction() function (cotire_target _target) set(_options "") @@ -3400,7 +3400,7 @@ function (cotire_target _target) if (_targetAddCleanTarget) cotire_setup_clean_target(${_target}) endif() -endfunction(cotire_target) +endfunction() function (cotire_map_libraries _strategy _mappedLibrariesVar) set (_mappedLibraries "") @@ -3482,7 +3482,7 @@ function (cotire_target_link_libraries _target) endif() endif() endif() -endfunction(cotire_target_link_libraries) +endfunction() function (cotire_cleanup _binaryDir _cotireIntermediateDirName _targetName) if (_targetName) diff --git a/cmakemodules/script_assimp.cmake b/cmakemodules/script_assimp.cmake index f74bcf9054..3bef62851b 100644 --- a/cmakemodules/script_assimp.cmake +++ b/cmakemodules/script_assimp.cmake @@ -30,7 +30,7 @@ if(PKG_CONFIG_FOUND) set(ASSIMP_CXX_FLAGS ${ASSIMP_CFLAGS}) endif (ASSIMP_FOUND) -endif(PKG_CONFIG_FOUND) +endif() if (NOT ASSIMP_FOUND) set(MRPT_BUILD_ASSIMP ON CACHE BOOL "Build an embedded version of Assimp (3D models importer)") diff --git a/cmakemodules/script_declare_defines.cmake b/cmakemodules/script_declare_defines.cmake index fbe9d199cd..aca42cf19a 100644 --- a/cmakemodules/script_declare_defines.cmake +++ b/cmakemodules/script_declare_defines.cmake @@ -4,10 +4,10 @@ macro(CREATE_CMAKE_MRPT_DEFINE defName) if(${defName} MATCHES "ON") set(CMAKE_${defName} "1") - else(${defName} MATCHES "ON") + else() set(CMAKE_${defName} "0") - endif(${defName} MATCHES "ON") -endmacro(CREATE_CMAKE_MRPT_DEFINE) + endif() +endmacro() CREATE_CMAKE_MRPT_DEFINE(MRPT_ALWAYS_CHECKS_DEBUG) CREATE_CMAKE_MRPT_DEFINE(MRPT_ALWAYS_CHECKS_DEBUG_MATRICES) diff --git a/cmakemodules/script_ffmpeg.cmake b/cmakemodules/script_ffmpeg.cmake index f4001cb0d3..10c6068949 100644 --- a/cmakemodules/script_ffmpeg.cmake +++ b/cmakemodules/script_ffmpeg.cmake @@ -70,19 +70,19 @@ if(MRPT_HAS_FFMPEG_WIN32) set(CMAKE_MRPT_HAS_FFMPEG 0) set(CMAKE_MRPT_HAS_FFMPEG_SYSTEM 0) message("The directory 'FFMPEG_WIN32_ROOT_DIR' does not exists. Turn off FFmpeg support or provide the correct path.") - endif(NOT EXISTS "${FFMPEG_WIN32_ROOT_DIR}") + endif() if(NOT EXISTS "${FFMPEG_WIN32_ROOT_DIR}/include/libavcodec" OR NOT EXISTS "${FFMPEG_WIN32_ROOT_DIR}/include/libavformat" OR NOT EXISTS "${FFMPEG_WIN32_ROOT_DIR}/include/libavutil" OR NOT EXISTS "${FFMPEG_WIN32_ROOT_DIR}/include/libswscale") set(CMAKE_MRPT_HAS_FFMPEG 0) set(CMAKE_MRPT_HAS_FFMPEG_SYSTEM 0) message("The directory 'FFMPEG_WIN32_ROOT_DIR' does not contain include/{libavcodec,libavformat,libavutil,libswscale}. Turn off FFmpeg support or provide the correct path.") - endif(NOT EXISTS "${FFMPEG_WIN32_ROOT_DIR}/include/libavcodec" OR NOT EXISTS "${FFMPEG_WIN32_ROOT_DIR}/include/libavformat" OR NOT EXISTS "${FFMPEG_WIN32_ROOT_DIR}/include/libavutil" OR NOT EXISTS "${FFMPEG_WIN32_ROOT_DIR}/include/libswscale") + endif() if(NOT EXISTS "${FFMPEG_WIN32_ROOT_DIR}/lib") set(CMAKE_MRPT_HAS_FFMPEG 0) set(CMAKE_MRPT_HAS_FFMPEG_SYSTEM 0) message("The directory 'FFMPEG_WIN32_ROOT_DIR' does not contain /lib/. Turn off FFmpeg support or provide the correct path.") - endif(NOT EXISTS "${FFMPEG_WIN32_ROOT_DIR}/lib") + endif() # We need the .lib files: avcodec-52.lib, avformat-52.lib, avutil-49.lib, swscale-0.lib file(GLOB FFMPEG_WIN32_AVCODEC_LIB "${FFMPEG_WIN32_ROOT_DIR}/lib/avcodec*.lib") diff --git a/cmakemodules/script_ftdi.cmake b/cmakemodules/script_ftdi.cmake index e089245569..6d23af0e7f 100644 --- a/cmakemodules/script_ftdi.cmake +++ b/cmakemodules/script_ftdi.cmake @@ -41,10 +41,10 @@ if(UNIX) ) if(${CMAKE_FTDI_CONFIG_RES}) message("Error invoking FTDI config file:\n ${FTDI_CONFIG_FILE} --libs") - endif(${CMAKE_FTDI_CONFIG_RES}) + endif() pkgconfig_parse(${CMAKE_FTDI_LIBS} "FTDI") - endif(FTDI_CONFIG_FILE) + endif() endif (LibFTDI1_FOUND) if(CMAKE_MRPT_HAS_FTDI) @@ -53,7 +53,7 @@ if(UNIX) message(STATUS " FTDI_INCLUDE_DIRS: ${FTDI_INCLUDE_DIRS}") message(STATUS " FTDI_LINK_DIRS: ${FTDI_LINK_DIRS}") message(STATUS " FTDI_LIBS: ${FTDI_LIBS}") - endif($ENV{VERBOSE}) + endif() add_library(imp_ftdi INTERFACE IMPORTED) set_target_properties(imp_ftdi diff --git a/cmakemodules/script_gridmap_options.cmake b/cmakemodules/script_gridmap_options.cmake index 72dcad8503..cab9480309 100644 --- a/cmakemodules/script_gridmap_options.cmake +++ b/cmakemodules/script_gridmap_options.cmake @@ -3,4 +3,4 @@ set(MRPT_OCCUPANCY_GRID_CELLSIZE 8 CACHE STRING "Cell size for mrpt::maps::COccupancyGridMap2D (either 8 or 16 bits)") if(NOT MRPT_OCCUPANCY_GRID_CELLSIZE EQUAL 8 AND NOT MRPT_OCCUPANCY_GRID_CELLSIZE EQUAL 16) message("MRPT_OCCUPANCY_GRID_CELLSIZE can have the values 8 or 16 only.") -endif(NOT MRPT_OCCUPANCY_GRID_CELLSIZE EQUAL 8 AND NOT MRPT_OCCUPANCY_GRID_CELLSIZE EQUAL 16) +endif() diff --git a/cmakemodules/script_inotify.cmake b/cmakemodules/script_inotify.cmake index 1c617b1bf0..f2467055ec 100644 --- a/cmakemodules/script_inotify.cmake +++ b/cmakemodules/script_inotify.cmake @@ -6,10 +6,10 @@ if(UNIX) if(INOTIFY_HEADER_FILE) set(CMAKE_MRPT_HAS_INOTIFY 1) mark_as_advanced(INOTIFY_HEADER_FILE) - else(INOTIFY_HEADER_FILE) + else() set(CMAKE_MRPT_HAS_INOTIFY 0) - endif(INOTIFY_HEADER_FILE) -else(UNIX) + endif() +else() # In windows there is no INOTIFY api. set(CMAKE_MRPT_HAS_INOTIFY 0) -endif(UNIX) +endif() diff --git a/cmakemodules/script_install_commands.cmake b/cmakemodules/script_install_commands.cmake index ace12b7cc3..de96e37e45 100644 --- a/cmakemodules/script_install_commands.cmake +++ b/cmakemodules/script_install_commands.cmake @@ -42,7 +42,7 @@ if(WIN32) install(FILES "${F}" DESTINATION lib) endforeach() -else(WIN32) +else() option(MRPT_INSTALL_EXAMPLES "Do install examples" ON) mark_as_advanced(MRPT_INSTALL_EXAMPLES) diff --git a/cmakemodules/script_isense.cmake b/cmakemodules/script_isense.cmake index 2809ab23c5..3f3b2d9e60 100644 --- a/cmakemodules/script_isense.cmake +++ b/cmakemodules/script_isense.cmake @@ -7,8 +7,8 @@ set( MRPT_HAS_INTERSENSE OFF CACHE BOOL "Build with support for Intersense libra if( MRPT_HAS_INTERSENSE ) if(UNIX) message("Sorry! INTERSENSE sensor is supported only for Windows yet. Set MRPT_HAS_INTERSENSE to OFF") - else(UNIX) + else() # Set to 1, next check for missing things and set to 0 on any error & report message: set(CMAKE_MRPT_HAS_INTERSENSE 1) - endif(UNIX) -endif(MRPT_HAS_INTERSENSE) + endif() +endif() diff --git a/cmakemodules/script_jpeg.cmake b/cmakemodules/script_jpeg.cmake index 17af888037..9871aa2f30 100644 --- a/cmakemodules/script_jpeg.cmake +++ b/cmakemodules/script_jpeg.cmake @@ -26,9 +26,9 @@ if((NOT CMAKE_MRPT_HAS_JPEG_SYSTEM) AND NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL "Em find_program(NASM_PATH nasm) if(NASM_PATH) set(JPEG_ENABLE_SIMD 1) - else(NASM_PATH) + else() set(JPEG_ENABLE_SIMD 0) - endif(NASM_PATH) + endif() ExternalProject_Add(EP_JPEG URL "https://github.com/libjpeg-turbo/libjpeg-turbo/archive/1.5.90.tar.gz" diff --git a/cmakemodules/script_kinect.cmake b/cmakemodules/script_kinect.cmake index a427982b79..4a299556b9 100644 --- a/cmakemodules/script_kinect.cmake +++ b/cmakemodules/script_kinect.cmake @@ -8,7 +8,7 @@ if (NOT DISABLE_LIBUSB) if(PKG_CONFIG_FOUND) PKG_CHECK_MODULES(PKG_LIBUSB10 QUIET libusb-1.0 IMPORTED_TARGET GLOBAL) # PkgConfig::PKG_LIBUSB10 endif() - endif(UNIX) + endif() else () set(PKG_LIBUSB10_FOUND "") endif () diff --git a/cmakemodules/script_libdc1394.cmake b/cmakemodules/script_libdc1394.cmake index 1c74a1aba1..39f38a2c9e 100644 --- a/cmakemodules/script_libdc1394.cmake +++ b/cmakemodules/script_libdc1394.cmake @@ -21,10 +21,10 @@ if(PKG_CONFIG_FOUND) #message(STATUS "LIBDC1394_2_INCLUDE_DIRS : ${LIBDC1394_2_INCLUDE_DIRS}") #message(STATUS "LIBDC1394_2_LIBRARY_DIRS : ${LIBDC1394_2_LIBRARY_DIRS}") #message(STATUS "LIBDC1394_2_LDFLAGS : ${LIBDC1394_2_LDFLAGS}") - else(LIBDC1394_2_FOUND) + else() set(CMAKE_MRPT_HAS_LIBDC1394_2 0) endif (LIBDC1394_2_FOUND) -endif(PKG_CONFIG_FOUND) +endif() -endif(NOT DISABLE_LIBDC1394) +endif() diff --git a/cmakemodules/script_liblas.cmake b/cmakemodules/script_liblas.cmake index 18efcfe76b..18fb8a1461 100644 --- a/cmakemodules/script_liblas.cmake +++ b/cmakemodules/script_liblas.cmake @@ -16,7 +16,7 @@ if(UNIX) ) if(${CMAKE_LAS_CONFIG_RES}) message("Error invoking LAS config file:\n ${LAS_CONFIG_FILE} --libs") - endif(${CMAKE_LAS_CONFIG_RES}) + endif() execute_process(COMMAND ${LAS_CONFIG_FILE} --includes RESULT_VARIABLE CMAKE_LAS_CONFIG_RES @@ -25,7 +25,7 @@ if(UNIX) ) if(${CMAKE_LAS_CONFIG_RES}) message("Error invoking LAS config file:\n ${LAS_CONFIG_FILE} --includes") - endif(${CMAKE_LAS_CONFIG_RES}) + endif() # Join all flags and parse to separate them: set(CMAKE_LAS_CFGS "${CMAKE_LAS_LIBS} ${CMAKE_LAS_INCLUDES}") @@ -40,13 +40,13 @@ if(UNIX) message(STATUS " LAS_INCLUDE_DIRS: ${LAS_INCLUDE_DIRS}") message(STATUS " LAS_LINK_DIRS: ${LAS_LINK_DIRS}") message(STATUS " LAS_LIBS: ${LAS_LIBS}") - endif($ENV{VERBOSE}) + endif() - else(LAS_CONFIG_FILE) + else() set(CMAKE_MRPT_HAS_LIBLAS 0) - endif(LAS_CONFIG_FILE) -else(UNIX) + endif() +else() # Windows: (Not supported for now) set(CMAKE_MRPT_HAS_LIBLAS 0) -endif(UNIX) +endif() diff --git a/cmakemodules/script_matlab.cmake b/cmakemodules/script_matlab.cmake index 53be7e7622..822cd17fee 100644 --- a/cmakemodules/script_matlab.cmake +++ b/cmakemodules/script_matlab.cmake @@ -11,9 +11,9 @@ if(MRPT_WITH_MATLAB_WRAPPER) if(NOT MATLAB_ROOT) if(WINDOWS) # In Windows set(MATLAB_ROOT "C:") - else(WINDOWS) # In Linux + else() # In Linux set(MATLAB_ROOT "/usr/local/MATLAB") - endif(WINDOWS) + endif() if(IS_DIRECTORY ${MATLAB_ROOT}) # Search installed versions in default directory file(GLOB LIST_MATLAB_INSTALLS RELATIVE ${MATLAB_ROOT} ${MATLAB_ROOT}/*) @@ -23,11 +23,11 @@ if(NOT MATLAB_ROOT) list(GET LIST_MATLAB_INSTALLS 0 MATLAB_VERSION) # Take first element (highest version) set(MATLAB_ROOT "${MATLAB_ROOT}/${MATLAB_VERSION}") - endif(IS_DIRECTORY ${MATLAB_ROOT}) + endif() set(MATLAB_ROOT ${MATLAB_ROOT} CACHE PATH "Path to the MATLAB installation directory (e.g. /usr/local/MATLAB/R2012b, C:/... (TODO)") set(MATLAB_VERSION ${MATLAB_VERSION} CACHE STRING "R...-like version to use from installed ones") -endif(NOT MATLAB_ROOT) +endif() # DISABLE_MATLAB # --------------------- @@ -56,10 +56,10 @@ if(NOT CMAKE_MRPT_HAS_MATLAB) # MEXPLUS header-only lib to handle mxArray class: add_subdirectory("${MRPT_SOURCE_DIR}/3rdparty/mexplus/") include_directories("${MRPT_SOURCE_DIR}/3rdparty/mexplus/") - else(MATLAB_FOUND) + else() message("MATLAB not found. Either set MATLAB_ROOT correctly, or set MRPT_WITH_MATLAB_WRAPPER=OFF") - endif(MATLAB_FOUND) -endif(NOT CMAKE_MRPT_HAS_MATLAB) + endif() +endif() # It seems it works with dynamic libraries too now! ## Set special options for Matlab wrapper compatibility @@ -67,7 +67,7 @@ endif(NOT CMAKE_MRPT_HAS_MATLAB) # message(SEND_ERROR #"BUILD_SHARED_LIBS is activated. #Static libraries are needed for MEX libraries due to TLS limitation in Matlab. Deactivate BUILD_SHARED_LIBRARIES.") -#endif(BUILD_SHARED_LIBS) +#endif() ## Since MEX libraries are dynamic but MRPT libraries need to be static, the static libraries must be Position Independent Code (PIC) set(CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -79,6 +79,6 @@ file(COPY ${MRPT_SOURCE_DIR}/mex/samples DESTINATION ${CMAKE_BINARY_DIR}/mex) file(COPY ${MRPT_SOURCE_DIR}/mex/mrpt_setup.m DESTINATION ${CMAKE_BINARY_DIR}/mex) file(COPY ${MRPT_SOURCE_DIR}/mex/README.txt DESTINATION ${CMAKE_BINARY_DIR}/mex) -endif(NOT DISABLE_MATLAB) +endif() -endif(MRPT_WITH_MATLAB_WRAPPER) +endif() diff --git a/cmakemodules/script_national_instruments.cmake b/cmakemodules/script_national_instruments.cmake index 7ed45d83d8..e845668169 100644 --- a/cmakemodules/script_national_instruments.cmake +++ b/cmakemodules/script_national_instruments.cmake @@ -33,11 +33,11 @@ if(NOT DISABLE_NationalInstruments) # The variable that actually ends up in config.h if (NI_DAQmxBASE_INCLUDE_DIR AND NI_DAQmxBASE_LIB_FILE) set(CMAKE_MRPT_HAS_NIDAQMXBASE 1) - else(NI_DAQmxBASE_INCLUDE_DIR AND NI_DAQmxBASE_LIB_FILE) + else() message("Error: Correct NI_DAQmxBASE_LIB_FILE and NI_DAQmxBASE_INCLUDE_DIR, or uncheck MRPT_HAS_NI_DAQmxBASE") endif (NI_DAQmxBASE_INCLUDE_DIR AND NI_DAQmxBASE_LIB_FILE) - endif(MRPT_HAS_NI_DAQmxBASE) -endif(NOT DISABLE_NationalInstruments) + endif() +endif() # National Instruments "DAQmx" C API @@ -70,8 +70,8 @@ if(NOT DISABLE_NationalInstruments) # The variable that actually ends up in config.h if (NI_DAQmx_INCLUDE_DIR AND NI_DAQmx_LIB_FILE) set(CMAKE_MRPT_HAS_NIDAQMX 1) - else(NI_DAQmx_INCLUDE_DIR AND NI_DAQmx_LIB_FILE) + else() message("Error: Correct NI_DAQmx_LIB_FILE and NI_DAQmx_INCLUDE_DIR, or uncheck MRPT_HAS_NI_DAQmx") endif (NI_DAQmx_INCLUDE_DIR AND NI_DAQmx_LIB_FILE) - endif(MRPT_HAS_NI_DAQmx) -endif(NOT DISABLE_NationalInstruments) + endif() +endif() diff --git a/cmakemodules/script_nite2.cmake b/cmakemodules/script_nite2.cmake index aafda7bf62..b7f2a044db 100644 --- a/cmakemodules/script_nite2.cmake +++ b/cmakemodules/script_nite2.cmake @@ -3,7 +3,7 @@ set(CMAKE_MRPT_HAS_NITE2 0) if(UNIX) set( MRPT_HAS_NITE2 OFF CACHE INTERNAL "Has NITE2 Windows libraries?" FORCE) -else(UNIX) +else() set( MRPT_HAS_NITE2 OFF CACHE BOOL "Has NITE2 Windows libraries?") if(MRPT_HAS_NITE2) @@ -12,31 +12,31 @@ else(UNIX) if(UNIX) message("Sorry! NITE2 is supported only for Windows yet. Set MRPT_HAS_NITE2 to OFF") set(CMAKE_MRPT_HAS_NITE2 0) - else(UNIX) + else() # Set to 1, next check for missing things and set to 0 on any error & report message: set(CMAKE_MRPT_HAS_NITE2 1) if(NOT EXISTS ${NITE2_ROOT_DIR}) set(CMAKE_MRPT_HAS_NITE2 0) message("The directory 'NITE2_ROOT_DIR' does not exists. Turn off NITE2 support or provide the correct path.") - endif(NOT EXISTS ${NITE2_ROOT_DIR}) + endif() if(NOT EXISTS ${NITE2_ROOT_DIR}/Include/NiTE.h) set(CMAKE_MRPT_HAS_NITE2 0) message("The directory 'NITE2_ROOT_DIR' does not contain Include/NiTE.h. Turn off NITE2 support or provide the correct path.") - endif(NOT EXISTS ${NITE2_ROOT_DIR}/Include/NiTE.h) + endif() if(NOT EXISTS ${NITE2_ROOT_DIR}/Lib/NiTE2.lib) set(CMAKE_MRPT_HAS_NITE2 0) message("The directory 'NITE2_ROOT_DIR' does not contain Lib/NiTE2.lib. Turn off NITE2 support or provide the correct path.") - endif(NOT EXISTS ${NITE2_ROOT_DIR}/Lib/NiTE2.lib) + endif() - endif(UNIX) + endif() - endif(MRPT_HAS_NITE2) -endif(UNIX) + endif() +endif() if(CMAKE_MRPT_HAS_NITE2) include_directories("${NITE2_ROOT_DIR}/Include") link_directories("${NITE2_ROOT_DIR}/Lib") -endif(CMAKE_MRPT_HAS_NITE2) +endif() diff --git a/cmakemodules/script_phidget.cmake b/cmakemodules/script_phidget.cmake index fcf78e13d7..4274dbf654 100644 --- a/cmakemodules/script_phidget.cmake +++ b/cmakemodules/script_phidget.cmake @@ -16,5 +16,5 @@ if(NOT DISABLE_PHIDGETS) if(PHIDGETS_FOUND) set(CMAKE_MRPT_HAS_PHIDGET 1) set(CMAKE_MRPT_HAS_PHIDGET_SYSTEM 1) - endif(PHIDGETS_FOUND) + endif() endif() diff --git a/cmakemodules/script_qt.cmake b/cmakemodules/script_qt.cmake index efe7b794a9..ccfdbe731c 100644 --- a/cmakemodules/script_qt.cmake +++ b/cmakemodules/script_qt.cmake @@ -32,7 +32,7 @@ if (MRPT_WITH_QT) message(STATUS "Qt5 include dirs: ${Qt5_COMPONENTS_INCLUDE_DIRS}") endif() - endif(Qt5Core_FOUND) + endif() endif() diff --git a/cmakemodules/script_show_final_summary.cmake b/cmakemodules/script_show_final_summary.cmake index 006ed4045f..120854f2b7 100644 --- a/cmakemodules/script_show_final_summary.cmake +++ b/cmakemodules/script_show_final_summary.cmake @@ -181,7 +181,7 @@ SHOW_CONFIG_LINE("Flir FlyCapture2 " CMAKE_MRPT_HAS_FLYCAPTUR SHOW_CONFIG_LINE("Flir Triclops " CMAKE_MRPT_HAS_TRICLOPS) if(UNIX) SHOW_CONFIG_LINE_SYSTEM("libftdi (USB) " CMAKE_MRPT_HAS_FTDI "[Version: ${LIBFTDI_VERSION_STRING}]") -endif(UNIX) +endif() SHOW_CONFIG_LINE("MYNTEYE-D SDK " CMAKE_MRPT_HAS_MYNTEYE_D) message(STATUS " National Instruments...") SHOW_CONFIG_LINE("...NIDAQmx? " CMAKE_MRPT_HAS_NIDAQMX) @@ -195,7 +195,7 @@ SHOW_CONFIG_LINE_SYSTEM("SwissRanger 3/4000 3D camera " CMAKE_MRPT_HAS_SW SHOW_CONFIG_LINE_SYSTEM("Videre SVS stereo camera " CMAKE_MRPT_HAS_SVS) if(UNIX) SHOW_CONFIG_LINE_SYSTEM("libudev (requisite for XSensMT) " CMAKE_MRPT_HAS_LIBUDEV) -endif(UNIX) +endif() SHOW_CONFIG_LINE_SYSTEM("xSENS MT " CMAKE_MRPT_HAS_xSENS) SHOW_CONFIG_LINE_SYSTEM("Intersense sensors " CMAKE_MRPT_HAS_INTERSENSE) message(STATUS "") diff --git a/cmakemodules/script_swissrange.cmake b/cmakemodules/script_swissrange.cmake index a0ece7dbe8..93113672c8 100644 --- a/cmakemodules/script_swissrange.cmake +++ b/cmakemodules/script_swissrange.cmake @@ -11,10 +11,10 @@ if(UNIX) mark_as_advanced(SWR_HEADER_FILE) set(MRPT_SWR_LIBS mesasr) - else(SWR_HEADER_FILE) + else() set(CMAKE_MRPT_HAS_SWISSRANGE 0) - endif(SWR_HEADER_FILE) -else(UNIX) + endif() +else() if (MSVC) # Windows: ... find_path(SWR_LIBMESASR_DIR MesaImaging/Swissranger/libMesaSR/) @@ -34,21 +34,21 @@ else(UNIX) message(STATUS "*** ERROR *** SwissRanger Library directory found but doesn't contain expected files. Not using it.") set(CMAKE_MRPT_HAS_SWISSRANGE 0) endif (EXISTS "${SWR_LIBMESASR_DIR}/libMesaSR.lib" AND EXISTS "${SWR_LIBMESASR_DIR}/libMesaSR.h") - else(SWR_LIBMESASR_DIR) + else() set(CMAKE_MRPT_HAS_SWISSRANGE 0) - endif(SWR_LIBMESASR_DIR) - endif(MSVC) -endif(UNIX) + endif() + endif() +endif() # Leave at the user's choice to disable the SWR libs: option(DISABLE_SWISSRANGER_3DCAM_LIBS "Disable the usage (if found) of SWR libs" "OFF") mark_as_advanced(DISABLE_SWISSRANGER_3DCAM_LIBS) if(DISABLE_SWISSRANGER_3DCAM_LIBS) set(CMAKE_MRPT_HAS_SWISSRANGE 0) -endif(DISABLE_SWISSRANGER_3DCAM_LIBS) +endif() # Can only be a system lib: set(CMAKE_MRPT_HAS_SWISSRANGE_SYSTEM 0) if(CMAKE_MRPT_HAS_SWISSRANGE) set(CMAKE_MRPT_HAS_SWISSRANGE_SYSTEM 1) -endif(CMAKE_MRPT_HAS_SWISSRANGE) +endif() diff --git a/cmakemodules/script_version_number.cmake b/cmakemodules/script_version_number.cmake index 5ac67d98e2..2c558b3041 100644 --- a/cmakemodules/script_version_number.cmake +++ b/cmakemodules/script_version_number.cmake @@ -27,6 +27,6 @@ if(WIN32) set(CMAKE_MRPT_COMPILER_NAME "_${CMAKE_CXX_COMPILER_ID}") endif() set(MRPT_DLL_VERSION_POSTFIX "${CMAKE_MRPT_VERSION_NUMBER_MAJOR}${CMAKE_MRPT_VERSION_NUMBER_MINOR}${CMAKE_MRPT_VERSION_NUMBER_PATCH}${CMAKE_MRPT_COMPILER_NAME}_x${CMAKE_MRPT_WORD_SIZE}") -else(WIN32) +else() set(MRPT_DLL_VERSION_POSTFIX "") -endif(WIN32) +endif() diff --git a/cmakemodules/script_videre_svs.cmake b/cmakemodules/script_videre_svs.cmake index fcd196cc68..cdd6ba8f58 100644 --- a/cmakemodules/script_videre_svs.cmake +++ b/cmakemodules/script_videre_svs.cmake @@ -13,33 +13,33 @@ if(MRPT_HAS_SVS) if(NOT EXISTS ${SVS_ROOT_DIR}) set(CMAKE_MRPT_HAS_SVS 0) message("The directory 'SVS_ROOT_DIR' does not exists. Turn off SVS support or provide the correct path.") - endif(NOT EXISTS ${SVS_ROOT_DIR}) + endif() if(NOT EXISTS ${SVS_ROOT_DIR}/src/svsclass.h) set(CMAKE_MRPT_HAS_SVS 0) message("The directory 'SVS_ROOT_DIR' does not contain src/svsclass.h. Turn off SVS support or provide the correct path.") - endif(NOT EXISTS ${SVS_ROOT_DIR}/src/svsclass.h) + endif() if(NOT EXISTS ${SVS_ROOT_DIR}/src/dcs.h) set(CMAKE_MRPT_HAS_SVS 0) message("The directory 'SVS_ROOT_DIR' does not contain src/dcs.h. Turn off SVS support or provide the correct path.") - endif(NOT EXISTS ${SVS_ROOT_DIR}/src/dcs.h) - else(UNIX) + endif() + else() message("Sorry! STOC camera is supported only for LINUX yet. Set MRPT_HAS_SVS to OFF") set(CMAKE_MRPT_HAS_SVS 0) - endif(UNIX) -endif(MRPT_HAS_SVS) + endif() +endif() if(CMAKE_MRPT_HAS_SVS) include_directories("${SVS_ROOT_DIR}/src") link_directories("${SVS_ROOT_DIR}/bin") -endif(CMAKE_MRPT_HAS_SVS) +endif() # This can only be a system lib: set(CMAKE_MRPT_HAS_SVS_SYSTEM 0) if(CMAKE_MRPT_HAS_SVS) set(CMAKE_MRPT_HAS_SVS_SYSTEM 1) -endif(CMAKE_MRPT_HAS_SVS) +endif() diff --git a/cmakemodules/script_wxwidgets.cmake b/cmakemodules/script_wxwidgets.cmake index 9cbd648e55..afe0581356 100644 --- a/cmakemodules/script_wxwidgets.cmake +++ b/cmakemodules/script_wxwidgets.cmake @@ -95,7 +95,7 @@ endif() set(CMAKE_MRPT_HAS_WXWIDGETS_SYSTEM 0) if(CMAKE_MRPT_HAS_WXWIDGETS) set(CMAKE_MRPT_HAS_WXWIDGETS_SYSTEM 1) -endif(CMAKE_MRPT_HAS_WXWIDGETS) +endif() # -- install DLLs -- diff --git a/libs/bayes/CMakeLists.txt b/libs/bayes/CMakeLists.txt index e771ff7d8f..62fcec952d 100644 --- a/libs/bayes/CMakeLists.txt +++ b/libs/bayes/CMakeLists.txt @@ -11,4 +11,4 @@ define_mrpt_lib( if(BUILD_mrpt-bayes) -endif( ) +endif() diff --git a/libs/containers/CMakeLists.txt b/libs/containers/CMakeLists.txt index 5251aa84ed..f57d1edfda 100644 --- a/libs/containers/CMakeLists.txt +++ b/libs/containers/CMakeLists.txt @@ -18,4 +18,4 @@ if(BUILD_mrpt-containers) target_link_libraries(containers PRIVATE mrpt_libfyaml) endif() -endif( ) +endif() diff --git a/libs/obs/CMakeLists.txt b/libs/obs/CMakeLists.txt index 7b5339ea32..685bec8dfb 100644 --- a/libs/obs/CMakeLists.txt +++ b/libs/obs/CMakeLists.txt @@ -57,4 +57,4 @@ if(BUILD_mrpt-obs) # Update Sep 2019: mrpt-obs now also uses OpenCV directly, so let's just link against opencv anyway: target_link_libraries(obs PRIVATE imp_opencv) -endif(BUILD_mrpt-obs) +endif() diff --git a/libs/rtti/CMakeLists.txt b/libs/rtti/CMakeLists.txt index c1cbe659a1..7c9c4e5503 100644 --- a/libs/rtti/CMakeLists.txt +++ b/libs/rtti/CMakeLists.txt @@ -15,4 +15,4 @@ define_mrpt_lib( if(BUILD_mrpt-rtti) -endif( ) +endif() diff --git a/libs/serialization/CMakeLists.txt b/libs/serialization/CMakeLists.txt index 9b711d40e0..8604cfb7e7 100644 --- a/libs/serialization/CMakeLists.txt +++ b/libs/serialization/CMakeLists.txt @@ -24,4 +24,4 @@ define_mrpt_lib( if(BUILD_mrpt-serialization) target_link_libraries(serialization PRIVATE ${tst_json_dep}) -endif( ) +endif() diff --git a/libs/tclap/CMakeLists.txt b/libs/tclap/CMakeLists.txt index b1af0f86ed..be6b49ce06 100644 --- a/libs/tclap/CMakeLists.txt +++ b/libs/tclap/CMakeLists.txt @@ -11,4 +11,4 @@ define_mrpt_lib_header_only( if(BUILD_mrpt-tclap) -endif( ) +endif() diff --git a/libs/typemeta/CMakeLists.txt b/libs/typemeta/CMakeLists.txt index cc1e950f1d..4e8b345664 100644 --- a/libs/typemeta/CMakeLists.txt +++ b/libs/typemeta/CMakeLists.txt @@ -11,4 +11,4 @@ if(BUILD_mrpt-typemeta) # Enforce C++17 in all dependent projects: mrpt_lib_target_requires_cpp17(typemeta) -endif( ) +endif() diff --git a/parse-files/cmake_uninstall.cmake.in b/parse-files/cmake_uninstall.cmake.in index aa20a69a62..a4560bf9f7 100644 --- a/parse-files/cmake_uninstall.cmake.in +++ b/parse-files/cmake_uninstall.cmake.in @@ -4,7 +4,7 @@ # ----------------------------------------------- if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") -endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") +endif() file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) string(REGEX REPLACE "\n" ";" files "${files}") @@ -18,10 +18,10 @@ foreach(file ${files}) ) if(NOT "${rm_retval}" STREQUAL 0) message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") - endif(NOT "${rm_retval}" STREQUAL 0) - else(EXISTS "$ENV{DESTDIR}${file}") + endif() + else() message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") - endif(EXISTS "$ENV{DESTDIR}${file}") + endif() endforeach(file) diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 0db085198d..33bb63dbfe 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -363,7 +363,7 @@ if(MRPT_BUILD_EXAMPLES) ) set(CMAKE_EXAMPLE_DEPS mrpt::hwdrivers mrpt::gui mrpt::opengl mrpt::maps) GENERATE_CMAKE_FILES_SAMPLES_DIRECTORY() - endif(MRPT_HAS_OPENNI2) + endif() # === Navigation examples === if(BUILD_mrpt-nav) From c110e1b0a0f1b0c62e971632acf5f1e129a4f1a9 Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco-Claraco Date: Wed, 21 Aug 2024 00:02:27 +0200 Subject: [PATCH 3/3] Add cmake variable MRPT_INSTALL_EMBEDDED_nanoflann (for the ROS wrapper) --- cmakemodules/script_nanoflann.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmakemodules/script_nanoflann.cmake b/cmakemodules/script_nanoflann.cmake index 82a07caed0..bd7a79f8a8 100644 --- a/cmakemodules/script_nanoflann.cmake +++ b/cmakemodules/script_nanoflann.cmake @@ -38,14 +38,19 @@ if (NOT nanoflann_FOUND) message(FATAL_ERROR "nanoflann not found, neither as system library nor git submodule. Check error messages above for possible reasons.") endif() +option(MRPT_INSTALL_EMBEDDED_nanoflann "Only if nanoflann is not a system library, do install embedded nanoflann? (Default: yes)" ON) +mark_as_advanced(MRPT_INSTALL_EMBEDDED_nanoflann) + # system library?: if (NOT "${nanoflann_DIR}" STREQUAL "${nanoflann_EMBEDDED_BUILD_DIR}") set(CMAKE_MRPT_HAS_NANOFLANN_SYSTEM 1) else() set(CMAKE_MRPT_HAS_NANOFLANN_SYSTEM 0) - # install the embedded copy too (we need nanoflann-config.cmake, etc.) - install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} --build \"${nanoflann_EMBEDDED_BUILD_DIR}\" --target install)") + if (MRPT_INSTALL_EMBEDDED_nanoflann) + # install the embedded copy too (we need nanoflann-config.cmake, etc.) + install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} --build \"${nanoflann_EMBEDDED_BUILD_DIR}\" --target install)") + endif() endif() if ($ENV{VERBOSE})