Skip to content

Commit

Permalink
Support building with gz-cmake3 or gz-cmake4
Browse files Browse the repository at this point in the history
Signed-off-by: Addisu Z. Taddese <[email protected]>
  • Loading branch information
azeey committed Oct 12, 2023
1 parent 2cd06a8 commit 8614ea9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,17 @@ project(gz-tools2 VERSION 2.0.0)
#============================================================================
# Find gz-cmake
#============================================================================
find_package(gz-cmake3 REQUIRED)
set(GZ_CMAKE_VER ${gz-cmake3_VERSION_MAJOR})
find_package(gz-cmake3 QUIET)
if (${gz-cmake3_FOUND})
set(GZ_CMAKE_VER ${gz-cmake3_VERSION_MAJOR})
else()
find_package(gz-cmake4 QUIET)
if (${gz-cmake4_FOUND})
set(GZ_CMAKE_VER ${gz-cmake4_VERSION_MAJOR})
else()
message(FATAL_ERROR "Could not find either gz-cmake3 or gz-cmake4")
endif()
endif()

#============================================================================
# Configure the project
Expand Down

0 comments on commit 8614ea9

Please sign in to comment.