Skip to content

Commit

Permalink
Migrate examples to gz
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <methylDragon@gmail.com>
  • Loading branch information
methylDragon committed Apr 21, 2022
1 parent ceb3510 commit 0199446
Show file tree
Hide file tree
Showing 23 changed files with 65 additions and 65 deletions.
26 changes: 13 additions & 13 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,36 +31,36 @@ endif()
foreach(example ${example_directories})
set(run_codecheck false)
if (${example} STREQUAL "ign_conf")
set(example_tarball_name ignition-minimal-0.1.0.tar.bz2)
set(example_tarball_name gz-minimal-0.1.0.tar.bz2)
elseif (${example} STREQUAL "no_ignition_prefix")
set(example_tarball_name no_ignition_prefix-0.1.0.tar.bz2)
elseif (${example} STREQUAL "prerelease")
set(example_tarball_name ignition-minimal-1.0.0~pre1.tar.bz2)
set(example_tarball_name gz-minimal-1.0.0~pre1.tar.bz2)
elseif (${example} STREQUAL "core_nodep")
set(example_tarball_name ignition-core_no_deps-0.1.0.tar.bz2)
set(example_tarball_name gz-core_no_deps-0.1.0.tar.bz2)
set(run_codecheck true)
elseif (${example} STREQUAL "core_nodep_static")
set(example_tarball_name ignition-core_no_deps_static-0.1.0.tar.bz2)
set(example_tarball_name gz-core_no_deps_static-0.1.0.tar.bz2)
set(run_codecheck true)
elseif (${example} STREQUAL "core_child")
set(example_tarball_name ignition-core_child-0.1.0.tar.bz2)
set(example_tarball_name gz-core_child-0.1.0.tar.bz2)
set(run_codecheck true)
elseif (${example} STREQUAL "core_child_private")
set(example_tarball_name ignition-core_child_private-0.1.0.tar.bz2)
set(example_tarball_name gz-core_child_private-0.1.0.tar.bz2)
set(run_codecheck true)
elseif (${example} STREQUAL "core_static_child")
set(example_tarball_name ignition-core_static_child-0.1.0.tar.bz2)
set(example_tarball_name gz-core_static_child-0.1.0.tar.bz2)
set(run_codecheck true)
elseif (${example} STREQUAL "comp_deps")
set(example_tarball_name ignition-component_deps-0.1.0.tar.bz2)
set(example_tarball_name gz-component_deps-0.1.0.tar.bz2)
elseif (${example} STREQUAL "use_component_depsA")
set(example_tarball_name ignition-use_component_depsa-0.1.0.tar.bz2)
set(example_tarball_name gz-use_component_depsa-0.1.0.tar.bz2)
elseif (${example} STREQUAL "use_component_depsB")
set(example_tarball_name ignition-use_component_depsb-0.1.0.tar.bz2)
set(example_tarball_name gz-use_component_depsb-0.1.0.tar.bz2)
elseif (${example} STREQUAL "use_component_depsC")
set(example_tarball_name ignition-use_component_depsc-0.1.0.tar.bz2)
set(example_tarball_name gz-use_component_depsc-0.1.0.tar.bz2)
elseif (${example} STREQUAL "use_config_ifp")
set(example_tarball_name ignition-find_config-0.1.0.tar.bz2)
set(example_tarball_name gz-find_config-0.1.0.tar.bz2)

else()
set(example_tarball_name)
Expand Down Expand Up @@ -192,7 +192,7 @@ if (UNIX)
@ONLY)
set(_env_vars)
# On Debian and if the install prefix is /usr, the default CMAKE_INSTALL_LIBDIR of this project
# as set by GNUInstallDirs will be different from the one of the example project,
# as set by GNUInstallDirs will be different from the one of the example project,
# so let's hardcode it in that case
if(EXISTS "/etc/debian_version" AND "${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
set(example_PKGCONFIG_INSTALL_LIBDIR "lib/pkgconfig")
Expand Down
2 changes: 1 addition & 1 deletion examples/comp_deps/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-component_deps VERSION 0.1.0)
project(gz-component_deps VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_configure_build(QUIT_IF_BUILD_ERRORS
Expand Down
6 changes: 3 additions & 3 deletions examples/core_child/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-core_child VERSION 0.1.0)
project(gz-core_child VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_find_package(ignition-core_no_deps REQUIRED)
ign_find_package(gz-core_no_deps REQUIRED)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
ign_create_docs(TAGFILES "${IGNITION-CORE_NO_DEPS_DOXYGEN_TAGFILE} = ${IGNITION-CORE_NO_DEPS_API_URL}")
ign_create_docs(TAGFILES "${GZ-CORE_NO_DEPS_DOXYGEN_TAGFILE} = ${GZ-CORE_NO_DEPS_API_URL}")
2 changes: 1 addition & 1 deletion examples/core_child/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ ign_get_libsources_and_unittests(sources gtest_sources)
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
ignition-core_no_deps::ignition-core_no_deps)
gz-core_no_deps::gz-core_no_deps)
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources})
6 changes: 3 additions & 3 deletions examples/core_child_private/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-core_child_private VERSION 0.1.0)
project(gz-core_child_private VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_find_package(ignition-core_no_deps PRIVATE REQUIRED)
ign_find_package(gz-core_no_deps PRIVATE REQUIRED)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
ign_create_docs(TAGFILES "${IGNITION-CORE_NO_DEPS_DOXYGEN_TAGFILE} = ${IGNITION-CORE_NO_DEPS_API_URL}")
ign_create_docs(TAGFILES "${GZ-CORE_NO_DEPS_DOXYGEN_TAGFILE} = ${GZ-CORE_NO_DEPS_API_URL}")
2 changes: 1 addition & 1 deletion examples/core_child_private/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ ign_get_libsources_and_unittests(sources gtest_sources)
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PRIVATE
ignition-core_no_deps::ignition-core_no_deps)
gz-core_no_deps::gz-core_no_deps)
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources})
2 changes: 1 addition & 1 deletion examples/core_nodep/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-core_no_deps VERSION 0.1.0)
project(gz-core_no_deps VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_configure_build(QUIT_IF_BUILD_ERRORS)
Expand Down
2 changes: 1 addition & 1 deletion examples/core_nodep_static/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-core_no_deps_static VERSION 0.1.0)
project(gz-core_no_deps_static VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
OPTION(BUILD_SHARED_LIBS OFF)
Expand Down
6 changes: 3 additions & 3 deletions examples/core_static_child/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-core_static_child VERSION 0.1.0)
project(gz-core_static_child VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_find_package(ignition-core_no_deps_static REQUIRED)
ign_find_package(gz-core_no_deps_static REQUIRED)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
ign_create_docs(TAGFILES "${IGNITION-CORE_NO_DEPS_STATIC_DOXYGEN_TAGFILE} = ${IGNITION-CORE_NO_DEPS_STATIC_API_URL}")
ign_create_docs(TAGFILES "${GZ-CORE_NO_DEPS_STATIC_DOXYGEN_TAGFILE} = ${GZ-CORE_NO_DEPS_STATIC_API_URL}")
2 changes: 1 addition & 1 deletion examples/core_static_child/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ ign_get_libsources_and_unittests(sources gtest_sources)
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
ignition-core_no_deps_static::ignition-core_no_deps_static)
gz-core_no_deps_static::gz-core_no_deps_static)
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources})
2 changes: 1 addition & 1 deletion examples/find_ogre2/ogre-2.1/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-ogre-2.1 VERSION 0.1.0)
project(gz-ogre-2.1 VERSION 0.1.0)

find_package(ignition-cmake3 REQUIRED)

Expand Down
2 changes: 1 addition & 1 deletion examples/find_ogre2/ogre-2.2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-ogre-2.2 VERSION 0.1.0)
project(gz-ogre-2.2 VERSION 0.1.0)

find_package(ignition-cmake3 REQUIRED)

Expand Down
2 changes: 1 addition & 1 deletion examples/ign_conf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-minimal0 VERSION 0.1.0)
project(gz-minimal0 VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_configure_build(QUIT_IF_BUILD_ERRORS)
2 changes: 1 addition & 1 deletion examples/prerelease/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-minimal1 VERSION 1.0.0)
project(gz-minimal1 VERSION 1.0.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project(VERSION_SUFFIX pre1)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
2 changes: 1 addition & 1 deletion examples/sanitizers/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-sanitizers VERSION 0.1.0)
project(gz-sanitizers VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_configure_build(QUIT_IF_BUILD_ERRORS)
36 changes: 18 additions & 18 deletions examples/test_core_child_requires_core_no_deps.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,40 @@
TEST_STATUS=0

echo
echo Expect ignition-core_child to require ignition-core_no_deps
pkg-config ignition-core_child --print-requires
if ! pkg-config ignition-core_child --print-requires \
| grep ignition-core_no_deps
echo Expect gz-core_child to require gz-core_no_deps
pkg-config gz-core_child --print-requires
if ! pkg-config gz-core_child --print-requires \
| grep gz-core_no_deps
then
echo oops
TEST_STATUS=1
fi

echo
echo Expect ignition-core_child to not privately require ignition-core_no_deps
pkg-config ignition-core_child --print-requires-private
if pkg-config ignition-core_child --print-requires-private \
| grep ignition-core_no_deps
echo Expect gz-core_child to not privately require gz-core_no_deps
pkg-config gz-core_child --print-requires-private
if pkg-config gz-core_child --print-requires-private \
| grep gz-core_no_deps
then
echo oops
TEST_STATUS=1
fi

echo
echo Expect ignition-core_child_private to privately require ignition-core_no_deps
pkg-config ignition-core_child_private --print-requires-private
if ! pkg-config ignition-core_child_private --print-requires-private \
| grep ignition-core_no_deps
echo Expect gz-core_child_private to privately require gz-core_no_deps
pkg-config gz-core_child_private --print-requires-private
if ! pkg-config gz-core_child_private --print-requires-private \
| grep gz-core_no_deps
then
echo oops
TEST_STATUS=1
fi

echo
echo Expect ignition-core_child_private to not require ignition-core_no_deps
pkg-config ignition-core_child_private --print-requires
if pkg-config ignition-core_child_private --print-requires \
| grep ignition-core_no_deps
echo Expect gz-core_child_private to not require gz-core_no_deps
pkg-config gz-core_child_private --print-requires
if pkg-config gz-core_child_private --print-requires \
| grep gz-core_no_deps
then
echo oops
TEST_STATUS=1
Expand All @@ -44,11 +44,11 @@ fi
echo
if [[ $TEST_STATUS -eq 0 ]]
then
echo Successfully detected ignition-core_nodep requirements
echo Successfully detected gz-core_nodep requirements
cp core_child_requires_core_nodep_pass.xml ../test_results/core_child_requires_core_nodep.xml
exit 0
else
echo Could not detect all ignition-core_nodep requirements correctly
echo Could not detect all gz-core_nodep requirements correctly
cp core_child_requires_core_nodep_fail.xml ../test_results/core_child_requires_core_nodep.xml
exit 1
fi
4 changes: 2 additions & 2 deletions examples/use_component_depsA/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-use_component_depsA VERSION 0.1.0)
project(gz-use_component_depsA VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_find_package(ignition-component_deps REQUIRED COMPONENTS parent child)
ign_find_package(gz-component_deps REQUIRED COMPONENTS parent child)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
ign_create_docs()
2 changes: 1 addition & 1 deletion examples/use_component_depsA/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ ign_get_libsources_and_unittests(sources gtest_sources)
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
ignition-component_deps::ignition-component_deps-child)
gz-component_deps::gz-component_deps-child)
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources})
4 changes: 2 additions & 2 deletions examples/use_component_depsB/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-use_component_depsB VERSION 0.1.0)
project(gz-use_component_depsB VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_find_package(ignition-component_deps REQUIRED COMPONENTS child parent)
ign_find_package(gz-component_deps REQUIRED COMPONENTS child parent)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
ign_create_docs()
2 changes: 1 addition & 1 deletion examples/use_component_depsB/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ ign_get_libsources_and_unittests(sources gtest_sources)
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
ignition-component_deps::ignition-component_deps-child)
gz-component_deps::gz-component_deps-child)
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources})
4 changes: 2 additions & 2 deletions examples/use_component_depsC/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-use_component_depsC VERSION 0.1.0)
project(gz-use_component_depsC VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_find_package(ignition-component_deps REQUIRED COMPONENTS child)
ign_find_package(gz-component_deps REQUIRED COMPONENTS child)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
ign_create_docs()
2 changes: 1 addition & 1 deletion examples/use_component_depsC/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ ign_get_libsources_and_unittests(sources gtest_sources)
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
ignition-component_deps::ignition-component_deps-child)
gz-component_deps::gz-component_deps-child)
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources})
10 changes: 5 additions & 5 deletions examples/use_config_ifp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-find_config VERSION 0.1.0)
project(gz-find_config VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/")
set(ignition-find_config_DIR "${CMAKE_SOURCE_DIR}/")
#ign_find_package(ignition-find_config) will search for Findignition-find_config.cmake before ignition-find_configConfig.cmake
ign_find_package(ignition-find_config)
set(gz-find_config_DIR "${CMAKE_SOURCE_DIR}/")
#ign_find_package(gz-find_config) will search for Findgz-find_config.cmake before gz-find_configConfig.cmake
ign_find_package(gz-find_config)
if(CONFIG_TEST MATCHES "The package was found using MODULE mode")
message(STATUS "The package was found using MODULE mode")
else()
message(SEND_ERROR "Couldn't find correct package in MODULE mode.\nign_find_package CONFIG test failed")
endif()
#After CONFIG arguemnt ign_find_package will skip MODULE mode and search for ignition-find_configConfig.cmake directly
ign_find_package(ignition-find_config CONFIG)
ign_find_package(gz-find_config CONFIG)
if(CONFIG_TEST MATCHES "The package was found using CONFIG mode")
message(STATUS "The package was found using CONFIG mode")
else()
Expand Down

0 comments on commit 0199446

Please sign in to comment.