Skip to content

Commit

Permalink
chore: fix cmake min version deprecation warning (#761)
Browse files Browse the repository at this point in the history
* chore: fix cmake min version deprecation warning

This commit fixed the cmake min version < 3.5 deprecation warning. It
updates the version to the one recommended by the [ROS noetic migration
guide](https://wiki.ros.org/noetic/Migration#Increase_required_CMake_version_to_avoid_author_warning).

* Fix installation target in cmake_pkg tests

---------

Co-authored-by: Timon Engelke <[email protected]>
  • Loading branch information
rickstaa and timonegk authored Aug 15, 2023
1 parent b938b43 commit 9b3811b
Show file tree
Hide file tree
Showing 25 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion catkin_tools/jobs/catkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ def create_catkin_test_job(

# CMakeLists.txt for prebuild package
SETUP_PREBUILD_CMAKELISTS_TEMPLATE = """\
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(catkin_tools_prebuild)
find_package(catkin QUIET)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(catkin_pkg_cmake_err)

## Find catkin macros and libraries
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(catkin_pkg_cmake_warn)

## Find catkin macros and libraries
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(catkin_pkg_make_err)

## Find catkin macros and libraries
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(catkin_pkg_make_warn)

## Find catkin macros and libraries
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(build_type_condition)
3 changes: 1 addition & 2 deletions tests/system/resources/catkin_pkgs/cmake_args/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(cmake_args)

find_package(catkin REQUIRED)
Expand All @@ -16,4 +16,3 @@ endif()
if(NOT VAR3)
message(SEND_ERROR "VAR3 NOT DEFINED!")
endif()

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(cmake_err)
find_package(catkin REQUIRED)
catkin_package()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(cmake_warning)
find_package(catkin REQUIRED)
catkin_package()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(build_type_condition)
2 changes: 1 addition & 1 deletion tests/system/resources/catkin_pkgs/make_err/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(make_err)
find_package(catkin REQUIRED)
catkin_package()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(make_warning)
find_package(catkin REQUIRED)
catkin_package()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(products_0)
find_package(catkin REQUIRED)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(products_unicode)
find_package(catkin REQUIRED)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(python_pkg)
find_package(catkin REQUIRED)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(python_tests)
find_package(catkin REQUIRED)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(python_tests_err)
find_package(catkin REQUIRED)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(python_tests_targets)
find_package(catkin REQUIRED)

Expand Down
2 changes: 1 addition & 1 deletion tests/system/resources/cmake_pkgs/app_pkg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(app_pkg)

find_package(lib_pkg REQUIRED)
Expand Down
3 changes: 1 addition & 2 deletions tests/system/resources/cmake_pkgs/cmake_pkg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(cmake_pkg)

add_executable(vanilla vanilla.cpp)
Expand All @@ -7,4 +7,3 @@ install(TARGETS vanilla
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/static)

2 changes: 1 addition & 1 deletion tests/system/resources/cmake_pkgs/lib_pkg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(lib_pkg)

# make cache variables for install destinations
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(test_err_pkg)

include(CTest)
Expand Down
2 changes: 1 addition & 1 deletion tests/system/resources/cmake_pkgs/test_pkg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(test_pkg)

include(CTest)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(pkg_with_roslint)
find_package(catkin REQUIRED COMPONENTS roslint)
catkin_package()
Expand Down
7 changes: 4 additions & 3 deletions tests/system/workspace_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,17 @@ class Package(object):
</export>"""

CATKIN_CMAKELISTS_TEMPLATE = """
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project({name})
find_package(catkin REQUIRED COMPONENTS {catkin_components})
catkin_package()"""

CMAKE_CMAKELISTS_TEMPLATE = """
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project({name})
{find_packages}
add_custom_target(install)"""
install(FILES ${{CMAKE_CURRENT_SOURCE_DIR}}/package.xml DESTINATION share/${{PROJECT_NAME}})
"""

CMAKE_CMAKELISTS_FIND_PACKAGE_TEMPLATE = """
find_package({name})"""
Expand Down

0 comments on commit 9b3811b

Please sign in to comment.