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

Reduce example names to be able to run Conda CI on Windows (gz-cmake4) #476

Merged
merged 12 commits into from
Feb 25, 2025
80 changes: 40 additions & 40 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ set(example_directories
gz_conf
no_gz_prefix
prerelease
core_nodep
core_nodep_static
core_child
core_child_private
core_static_child
c_nodep
c_nodep_static
c_child
c_child_private
c_static_child
comp_deps
use_config_ifp
config_ifp
version_from_package_xml
)
if (NOT CMAKE_GENERATOR MATCHES "Visual Studio")
list(APPEND example_directories
use_component_depsA
use_component_depsB
use_component_depsC
comp_depsA
comp_depsB
comp_depsC
)
endif()

Expand All @@ -52,30 +52,30 @@ foreach(example ${example_directories})
set(example_tarball_name no_gz_prefix-0.1.0.tar.bz2)
elseif (${example} STREQUAL "prerelease")
set(example_tarball_name gz-minimal-1.0.0~pre1.tar.bz2)
elseif (${example} STREQUAL "core_nodep")
set(example_tarball_name gz-core_no_deps-0.1.0.tar.bz2)
elseif (${example} STREQUAL "c_nodep")
set(example_tarball_name gz-c_no_deps-0.1.0.tar.bz2)
set(run_codecheck true)
elseif (${example} STREQUAL "core_nodep_static")
set(example_tarball_name gz-core_no_deps_static-0.1.0.tar.bz2)
elseif (${example} STREQUAL "c_nodep_static")
set(example_tarball_name gz-c_no_deps_static-0.1.0.tar.bz2)
set(run_codecheck true)
elseif (${example} STREQUAL "core_child")
set(example_tarball_name gz-core_child-0.1.0.tar.bz2)
elseif (${example} STREQUAL "c_child")
set(example_tarball_name gz-c_child-0.1.0.tar.bz2)
set(run_codecheck true)
elseif (${example} STREQUAL "core_child_private")
set(example_tarball_name gz-core_child_private-0.1.0.tar.bz2)
elseif (${example} STREQUAL "c_child_private")
set(example_tarball_name gz-c_child_private-0.1.0.tar.bz2)
set(run_codecheck true)
elseif (${example} STREQUAL "core_static_child")
set(example_tarball_name gz-core_static_child-0.1.0.tar.bz2)
elseif (${example} STREQUAL "c_static_child")
set(example_tarball_name gz-c_static_child-0.1.0.tar.bz2)
set(run_codecheck true)
elseif (${example} STREQUAL "comp_deps")
set(example_tarball_name gz-component_deps-0.1.0.tar.bz2)
elseif (${example} STREQUAL "use_component_depsA")
set(example_tarball_name gz-use_component_depsa-0.1.0.tar.bz2)
elseif (${example} STREQUAL "use_component_depsB")
set(example_tarball_name gz-use_component_depsb-0.1.0.tar.bz2)
elseif (${example} STREQUAL "use_component_depsC")
set(example_tarball_name gz-use_component_depsc-0.1.0.tar.bz2)
elseif (${example} STREQUAL "use_config_ifp")
set(example_tarball_name gz-comp_deps-0.1.0.tar.bz2)
elseif (${example} STREQUAL "comp_depsA")
set(example_tarball_name gz-comp_depsa-0.1.0.tar.bz2)
elseif (${example} STREQUAL "comp_depsB")
set(example_tarball_name gz-comp_depsb-0.1.0.tar.bz2)
elseif (${example} STREQUAL "comp_depsC")
set(example_tarball_name gz-comp_depsc-0.1.0.tar.bz2)
elseif (${example} STREQUAL "config_ifp")
set(example_tarball_name gz-find_config-0.1.0.tar.bz2)
elseif (${example} STREQUAL "version_from_package_xml")
set(example_tarball_name gz-version_from_package_xml-8.21.65.tar.bz2)
Expand Down Expand Up @@ -183,24 +183,24 @@ endforeach()
# need to exist before they can be used there
foreach (build_type ${build_types})
shorten_build_type("${build_type}" short_bt)
add_dependencies(core_child_${short_bt} core_nodep_${short_bt})
add_dependencies(core_child_private_${short_bt} core_nodep_${short_bt})
add_dependencies(core_static_child_${short_bt} core_nodep_static_${short_bt})
if (TARGET use_component_depsA_${short_bt})
add_dependencies(use_component_depsA_${short_bt} comp_deps_${short_bt})
add_dependencies(c_child_${short_bt} c_nodep_${short_bt})
add_dependencies(c_child_private_${short_bt} c_nodep_${short_bt})
add_dependencies(c_static_child_${short_bt} c_nodep_static_${short_bt})
if (TARGET comp_depsA_${short_bt})
add_dependencies(comp_depsA_${short_bt} comp_deps_${short_bt})
endif()
if (TARGET use_component_depsB_${short_bt})
add_dependencies(use_component_depsB_${short_bt} comp_deps_${short_bt})
if (TARGET comp_depsB_${short_bt})
add_dependencies(comp_depsB_${short_bt} comp_deps_${short_bt})
endif()
if (TARGET use_component_depsC_${short_bt})
add_dependencies(use_component_depsC_${short_bt} comp_deps_${short_bt})
if (TARGET comp_depsC_${short_bt})
add_dependencies(comp_depsC_${short_bt} comp_deps_${short_bt})
endif()
endforeach()

# test that core_child pkg-config file requires core_nodep
# and that core_child_private pkg-config file requires core_nodep privately
# test that c_child pkg-config file requires c_nodep
# and that c_child_private pkg-config file requires c_nodep privately
if (UNIX)
set(TEST_NAME core_child_requires_core_nodep)
set(TEST_NAME c_child_requires_c_nodep)
string(TIMESTAMP TEST_TIME)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/junit_pass.xml.in"
Expand All @@ -222,7 +222,7 @@ if (UNIX)

list(APPEND _env_vars "PKG_CONFIG_PATH=${example_INSTALL_DIR}/${example_PKGCONFIG_INSTALL_LIBDIR}:${FAKE_INSTALL_PREFIX}/${example_PKGCONFIG_INSTALL_LIBDIR}:$PKG_CONFIG_PATH")
add_test(${TEST_NAME}
${CMAKE_CURRENT_SOURCE_DIR}/test_core_child_requires_core_no_deps.bash
${CMAKE_CURRENT_SOURCE_DIR}/test_c_child_requires_c_no_deps.bash
)
set_tests_properties(${TEST_NAME} PROPERTIES
ENVIRONMENT "${_env_vars}")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
project(gz-core_child VERSION 0.1.0)
project(gz-c_child VERSION 0.1.0)
find_package(gz-cmake4 REQUIRED)
gz_configure_project()
gz_find_package(gz-core_no_deps REQUIRED EXTRA_ARGS NAMES gz-core_no_deps)
gz_find_package(gz-c_no_deps REQUIRED EXTRA_ARGS NAMES gz-c_no_deps)
gz_configure_build(QUIT_IF_BUILD_ERRORS)
gz_create_packages()
gz_create_docs(TAGFILES "${GZ-CORE_NO_DEPS_DOXYGEN_TAGFILE} = ${GZ-CORE_NO_DEPS_API_URL}")
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ gz_get_libsources_and_unittests(sources gtest_sources)
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
gz-core_no_deps::gz-core_no_deps)
gz-c_no_deps::gz-c_no_deps)
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources})
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
project(gz-core_child_private VERSION 0.1.0)
project(gz-c_child_private VERSION 0.1.0)
find_package(gz-cmake4 REQUIRED)
gz_configure_project()
gz_find_package(gz-core_no_deps PRIVATE REQUIRED)
gz_find_package(gz-c_no_deps PRIVATE REQUIRED)
gz_configure_build(QUIT_IF_BUILD_ERRORS)
gz_create_packages()
gz_create_docs(TAGFILES "${GZ-CORE_NO_DEPS_DOXYGEN_TAGFILE} = ${GZ-CORE_NO_DEPS_API_URL}")
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ gz_get_libsources_and_unittests(sources gtest_sources)
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PRIVATE
gz-core_no_deps::gz-core_no_deps)
gz-c_no_deps::gz-c_no_deps)
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources})
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
project(gz-core_no_deps VERSION 0.1.0)
project(gz-c_no_deps VERSION 0.1.0)
find_package(gz-cmake4 REQUIRED)
gz_configure_project(
REPLACE_INCLUDE_PATH gz/core_no_deps
REPLACE_INCLUDE_PATH gz/c_no_deps
)
gz_configure_build(QUIT_IF_BUILD_ERRORS)
gz_create_packages()
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
*
*/

#include <gz/core_no_deps/Export.hh>
#include <gz/c_no_deps/Export.hh>

namespace gz
{
namespace core_no_deps
namespace c_no_deps
{
class GZ_CORE_NO_DEPS_VISIBLE AlmostEmpty
class GZ_C_NO_DEPS_VISIBLE AlmostEmpty
{
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
gz_get_libsources_and_unittests(sources gtest_sources)
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources})
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources})
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
project(gz-core_no_deps_static VERSION 0.1.0)
project(gz-c_no_deps_static VERSION 0.1.0)
find_package(gz-cmake4 REQUIRED)
gz_configure_project(
REPLACE_INCLUDE_PATH gz/core_no_deps_static
REPLACE_INCLUDE_PATH gz/c_no_deps_static
)
OPTION(BUILD_SHARED_LIBS OFF)
gz_configure_build(QUIT_IF_BUILD_ERRORS)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# core\_nodep\_static example
# c\_nodep\_static example

This package sets the `BUILD_SHARED_LIBS` cmake variable to `OFF`,
ensuring that a static library will be created.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
*
*/

#include <gz/core_no_deps_static/Export.hh>
#include <gz/c_no_deps_static/Export.hh>

namespace gz
{
namespace core_no_deps
namespace c_no_deps
{
class GZ_CORE_NO_DEPS_STATIC_VISIBLE AlmostEmpty
class GZ_C_NO_DEPS_STATIC_VISIBLE AlmostEmpty
{
public: AlmostEmpty() = default;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
project(gz-core_static_child VERSION 0.1.0)
project(gz-c_static_child VERSION 0.1.0)
find_package(gz-cmake4 REQUIRED)
gz_configure_project()
gz_find_package(gz-core_no_deps_static REQUIRED)
gz_find_package(gz-c_no_deps_static REQUIRED)
gz_configure_build(QUIT_IF_BUILD_ERRORS)
gz_create_packages()
gz_create_docs(TAGFILES "${GZ-CORE_NO_DEPS_STATIC_DOXYGEN_TAGFILE} = ${GZ-CORE_NO_DEPS_STATIC_API_URL}")
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# core\_static\_child example
# c\_static\_child example

This package links against that static library provided by
the `core_no_deps_static` package.
the `c_no_deps_static` package.

To build, ensure that `core_no_deps_static` has been installed somewhere
To build, ensure that `c_no_deps_static` has been installed somewhere
in your `CMAKE_PREFIX_PATH` and then run:

~~~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ gz_get_libsources_and_unittests(sources gtest_sources)
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
gz-component_deps::gz-component_deps-child)
gz-c_no_deps_static::gz-c_no_deps_static)
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources})
4 changes: 2 additions & 2 deletions examples/comp_deps/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
project(gz-component_deps VERSION 0.1.0)
project(gz-comp_deps VERSION 0.1.0)
find_package(gz-cmake4 REQUIRED)
gz_configure_project(
REPLACE_INCLUDE_PATH gz/component_deps
REPLACE_INCLUDE_PATH gz/comp_deps
)
gz_configure_build(QUIT_IF_BUILD_ERRORS
COMPONENTS child parent)
Expand Down
2 changes: 1 addition & 1 deletion examples/comp_deps/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# component\_deps
# comp\_deps

A package with two components (`child` and `parent`) with a dependency
relationship between the components (`child` links against `parent`).
6 changes: 3 additions & 3 deletions examples/comp_deps/src/AlmostEmpty.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
*
*/

#include <gz/component_deps/Export.hh>
#include <gz/comp_deps/Export.hh>

namespace gz
{
namespace component_deps
namespace c_deps
{
class GZ_COMPONENT_DEPS_VISIBLE AlmostEmpty
class GZ_COMP_DEPS_VISIBLE AlmostEmpty
{
};
}
Expand Down
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some of these files are mixed up; this is _depsC -> _depsA

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made some changes in 85ce09d which I believe are correct but the git diff is still confused

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
project(gz-use_component_depsC VERSION 0.1.0)
project(gz-comp_depsA VERSION 0.1.0)
find_package(gz-cmake4 REQUIRED)
gz_configure_project()
gz_find_package(gz-component_deps REQUIRED COMPONENTS child)
gz_find_package(gz-comp_deps REQUIRED COMPONENTS parent child)
gz_configure_build(QUIT_IF_BUILD_ERRORS)
gz_create_packages()
gz_create_docs()
5 changes: 5 additions & 0 deletions examples/comp_depsA/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# comp\_depsA

This package uses the `child` and `parent` components of `comp_deps`
and calls `gz_find_package` with the components specified
in the order `parent child`.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ gz_get_libsources_and_unittests(sources gtest_sources)
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
gz-component_deps::gz-component_deps-child)
gz-comp_deps::gz-comp_deps-child)
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources})
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
project(gz-use_component_depsA VERSION 0.1.0)
project(comp_depsB VERSION 0.1.0)
find_package(gz-cmake4 REQUIRED)
gz_configure_project()
gz_find_package(gz-component_deps REQUIRED COMPONENTS parent child)
gz_find_package(gz-comp_deps REQUIRED COMPONENTS child parent)
gz_configure_build(QUIT_IF_BUILD_ERRORS)
gz_create_packages()
gz_create_docs()
7 changes: 7 additions & 0 deletions examples/comp_depsB/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# comp\_depsB

This package uses the `child` and `parent` components of `comp_deps`
and calls `gz_find_package` with the components specified
in the order `child parent`.
Aside from the order in which the components are specified,
this package is identical to `comp_depsA`.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ gz_get_libsources_and_unittests(sources gtest_sources)
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
gz-component_deps::gz-component_deps-child)
gz-comp_deps::gz-comp_deps-child)
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources})
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
project(gz-use_component_depsB VERSION 0.1.0)
project(comp_depsC VERSION 0.1.0)
find_package(gz-cmake4 REQUIRED)
gz_configure_project()
gz_find_package(gz-component_deps REQUIRED COMPONENTS child parent)
gz_find_package(gz-comp_deps REQUIRED COMPONENTS child)
gz_configure_build(QUIT_IF_BUILD_ERRORS)
gz_create_packages()
gz_create_docs()
4 changes: 4 additions & 0 deletions examples/comp_depsC/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# comp\_depsC

This package uses the `child` component of `comp_deps`
but should also find the `parent` component indirectly.
6 changes: 6 additions & 0 deletions examples/comp_depsC/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gz_get_libsources_and_unittests(sources gtest_sources)
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
gz-comp_deps::gz-comp_deps-child)
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources})
1 change: 1 addition & 0 deletions examples/config_ifp/Findgz-find_config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(CONFIG_TEST "The package was found using MODULE mode")
File renamed without changes.
1 change: 1 addition & 0 deletions examples/config_ifp/gz-find_configConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(CONFIG_TEST "The package was found using CONFIG mode")
6 changes: 0 additions & 6 deletions examples/core_static_child/src/CMakeLists.txt

This file was deleted.

Loading