Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cmake message WARNING and SEND_ERROR when appropriate #1401

Merged
merged 4 commits into from
Aug 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ elseif("${CMAKE_BUILD_TYPE_UPPERCASE}" STREQUAL "RELWITHDEBINFO")
elseif("${CMAKE_BUILD_TYPE_UPPERCASE}" STREQUAL "MINSIZEREL")
set(BUILD_TYPE_MINSIZEREL TRUE)
else()
message(STATUS "CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} unknown. Valid options are: Debug | Release | RelWithDebInfo | MinSizeRel")
message(WARNING "CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} unknown. Valid options are: Debug | Release | RelWithDebInfo | MinSizeRel")
endif()

#===============================================================================
Expand Down Expand Up @@ -497,7 +497,7 @@ if(CLANG_FORMAT_EXECUTABLE)
else()

if(DART_VERBOSE)
message(STATUS "Looking for clang-format - NOT found, please install clang-format to enable automatic code formatting")
message(WARNING "Looking for clang-format - NOT found, please install clang-format to enable automatic code formatting")
endif()

endif()
Expand Down
6 changes: 3 additions & 3 deletions cmake/DARTFindDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ else()
if(OCTOMAP_FOUND OR octomap_FOUND)
if(NOT DEFINED octomap_VERSION)
set(HAVE_OCTOMAP FALSE CACHE BOOL "Check if octomap found." FORCE)
message(STATUS "Looking for octomap - octomap_VERSION is not defined, "
message(WARNING "Looking for octomap - octomap_VERSION is not defined, "
"please install octomap with version information"
)
else()
Expand All @@ -113,7 +113,7 @@ else()
endif()
else()
set(HAVE_OCTOMAP FALSE CACHE BOOL "Check if octomap found." FORCE)
message(STATUS "Looking for octomap - NOT found, to use VoxelGridShape, "
message(WARNING "Looking for octomap - NOT found, to use VoxelGridShape, "
"please install octomap"
)
endif()
Expand All @@ -129,7 +129,7 @@ if(DART_VERBOSE)
if("${PERLMODULES_FOUND}" STREQUAL "TRUE")
message(STATUS "Looking for PerlModules - found")
else()
message(STATUS "Looking for PerlModules - NOT found, to colorize gcc messages, please install Regexp::Common Getopt::ArgvFile Getopt::Long Term::ANSIColor (http://www.cpan.org/modules/INSTALL.html)")
message(WARNING "Looking for PerlModules - NOT found, to colorize gcc messages, please install Regexp::Common Getopt::ArgvFile Getopt::Long Term::ANSIColor (http://www.cpan.org/modules/INSTALL.html)")
endif()
endif()

Expand Down
4 changes: 2 additions & 2 deletions cmake/DARTFindassimp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ find_package(assimp REQUIRED MODULE)
# Manually check version because the upstream version compatibility policy
# doesn't allow different major number while DART is compatible any version
# greater than or equal to 3.2.
if(ASSIMP_VERSION VERSION_LESS 3.2)
message(STATUS "Found Assimp ${ASSIMP_VERSION}, but Assimp >= 3.2 is "
if(ASSIMP_VERSION AND ASSIMP_VERSION VERSION_LESS 3.2)
message(SEND_ERROR "Found Assimp ${ASSIMP_VERSION}, but Assimp >= 3.2 is "
"required"
)
endif()
Expand Down
4 changes: 2 additions & 2 deletions cmake/DARTFindpagmo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ if(TARGET Pagmo::pagmo)
if(PAGMO_BUILT_WITH_NLOPT)
dart_find_package(NLOPT)
if(NOT TARGET NLOPT::nlopt)
message(STATUS
message(WARNING
"The installed version of pagmo is built with nlopt, but nlopt is not "
"found. Please install nlopt to use dart-optimizer-pagmo."
)
Expand All @@ -69,7 +69,7 @@ if(TARGET Pagmo::pagmo)
if(PAGMO_BUILT_WITH_IPOPT)
dart_find_package(IPOPT)
if(NOT TARGET IPOPT::ipopt)
message(STATUS
message(WARNING
"The installed version of pagmo is built with ipopt, but ipopt is not "
"found. Please install ipopt to use dart-optimizer-pagmo."
)
Expand Down
8 changes: 4 additions & 4 deletions cmake/DARTMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ macro(dart_check_optional_package variable component dependency)
else()
set(HAVE_${variable} FALSE CACHE BOOL "Check if ${variable} found." FORCE)
if(ARGV3) # version
message(STATUS "Looking for ${dependency} - NOT found, to use"
" ${component}, please install ${dependency} (>= ${ARGV3})")
message(WARNING "Looking for ${dependency} - NOT found, to use"
" ${component}, please install ${dependency} (>= ${ARGV3})")
else()
message(STATUS "Looking for ${dependency} - NOT found, to use"
" ${component}, please install ${dependency}")
message(WARNING "Looking for ${dependency} - NOT found, to use"
" ${component}, please install ${dependency}")
endif()
return()
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindPerlModules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if(PERL_FOUND)
mark_as_advanced(${modvarname})
else()
if(NOT PerlModules_FIND_QUIETLY)
message(STATUS "Checking for perl module ${module} - failed")
message(WARNING "Checking for perl module ${module} - failed")
endif()
set(${modvarname}
"NOTFOUND"
Expand Down
2 changes: 1 addition & 1 deletion dart/collision/bullet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if(BULLET_FOUND)

set(HAVE_BULLET TRUE CACHE BOOL "Check if BULLET found." FORCE)
else()
message(STATUS "Looking for Bullet - NOT found, to use dart-collision-bullet, please install libbullet-dev")
message(WARNING "Looking for Bullet - NOT found, to use dart-collision-bullet, please install libbullet-dev")
set(HAVE_BULLET FALSE CACHE BOOL "Check if BULLET found." FORCE)
return()
endif()
Expand Down
2 changes: 1 addition & 1 deletion dart/gui/osg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if(DART_BUILD_GUI_OSG)
set(warning_msg "Could NOT find OpenSceneGraph nor OpenThreads")
endif()
endif()
message(STATUS "${warning_msg} -- we will skip dart-gui-osg\n"
message(WARNING "${warning_msg} -- we will skip dart-gui-osg\n"
"If you believe you do have both OSG and OpenThreads installed, try setting OSG_DIR")
return()
endif()
Expand Down
2 changes: 1 addition & 1 deletion dart/utils/urdf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if(urdfdom_FOUND)
message(STATUS "Looking for urdfdom - ${urdfdom_headers_VERSION} found")
endif()
else()
message(STATUS "Looking for urdfdom - NOT found, please install liburdfdom-dev")
message(WARNING "Looking for urdfdom - NOT found, to use dart-utils-urdf, please install liburdfdom-dev")
return()
endif()
if(MSVC)
Expand Down
6 changes: 3 additions & 3 deletions python/dartpy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT PythonInterp_FOUND)
message(STATUS "DART_BUILD_DARTPY is ON, but failed to find PythonInterp. "
message(WARNING "DART_BUILD_DARTPY is ON, but failed to find PythonInterp. "
"Disabling dartpy."
)
return()
endif()

find_package(PythonLibs ${DARTPY_PYTHON_VERSION} QUIET)
if(NOT PythonLibs_FOUND)
message(STATUS "DART_BUILD_DARTPY is ON, but failed to find PythonLibs. "
message(WARNING "DART_BUILD_DARTPY is ON, but failed to find PythonLibs. "
"Disabling dartpy."
)
return()
Expand All @@ -29,7 +29,7 @@ endif()
set(PYBIND11_PYTHON_VERSION ${DARTPY_PYTHON_VERSION})
find_package(pybind11 2.2.0 QUIET)
if(NOT pybind11_FOUND)
message(STATUS "DART_BUILD_DARTPY is ON, but failed to find pybind11 >= "
message(WARNING "DART_BUILD_DARTPY is ON, but failed to find pybind11 >= "
"2.2.0. Disabling dartpy."
)
return()
Expand Down
4 changes: 2 additions & 2 deletions python/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ execute_process(
ERROR_QUIET
)
if(pytest_not_found)
message(STATUS "Running the tests requires pytest. Please install it manually"
message(WARNING "Running the tests requires pytest. Please install it manually"
" (try: ${PYTHON_EXECUTABLE} -m pip install pytest)"
)
set(DARTPY_PYTEST_FOUND FALSE)
elseif(pytest_version VERSION_LESS 3.0)
message(STATUS "Running the tests requires pytest >= 3.0. Found: ${pytest_version}"
message(WARNING "Running the tests requires pytest >= 3.0. Found: ${pytest_version}"
"Please update it (try: ${PYTHON_EXECUTABLE} -m pip install -U pytest)"
)
set(DARTPY_PYTEST_FOUND FALSE)
Expand Down