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

test, not for merging #460

Closed
wants to merge 6 commits into from
Closed
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
46 changes: 29 additions & 17 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ set(example_directories
core_child
core_child_private
core_static_child
comp_deps
component_deps
use_config_ifp
)
if (NOT CMAKE_GENERATOR MATCHES "Visual Studio")
list(APPEND example_directories
use_component_depsA
use_component_depsB
use_component_depsC
use_component_deps_a
use_component_deps_b
use_component_deps_c
export_component_deps_cmake
export_component_deps_pkgconfig
)
endif()

Expand All @@ -51,14 +53,18 @@ foreach(example ${example_directories})
elseif (${example} STREQUAL "core_static_child")
set(example_tarball_name gz-core_static_child-0.1.0.tar.bz2)
set(run_codecheck true)
elseif (${example} STREQUAL "comp_deps")
elseif (${example} STREQUAL "component_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 "export_component_deps_cmake")
set(example_tarball_name gz-export_component_deps_cmake-0.1.0.tar.bz2)
elseif (${example} STREQUAL "export_component_deps_pkgconfig")
set(example_tarball_name gz-export_component_deps_pkgconfig-0.1.0.tar.bz2)
elseif (${example} STREQUAL "use_component_deps_a")
set(example_tarball_name gz-use_component_deps_a-0.1.0.tar.bz2)
elseif (${example} STREQUAL "use_component_deps_b")
set(example_tarball_name gz-use_component_deps_b-0.1.0.tar.bz2)
elseif (${example} STREQUAL "use_component_deps_c")
set(example_tarball_name gz-use_component_deps_c-0.1.0.tar.bz2)
elseif (${example} STREQUAL "use_config_ifp")
set(example_tarball_name gz-find_config-0.1.0.tar.bz2)

Expand Down Expand Up @@ -166,14 +172,20 @@ foreach (build_type ${build_types})
add_dependencies(core_child_${build_type} core_nodep_${build_type})
add_dependencies(core_child_private_${build_type} core_nodep_${build_type})
add_dependencies(core_static_child_${build_type} core_nodep_static_${build_type})
if (TARGET use_component_depsA_${build_type})
add_dependencies(use_component_depsA_${build_type} comp_deps_${build_type})
if (TARGET use_component_deps_a_${build_type})
add_dependencies(use_component_deps_a_${build_type} component_deps_${build_type})
endif()
if (TARGET use_component_depsB_${build_type})
add_dependencies(use_component_depsB_${build_type} comp_deps_${build_type})
if (TARGET use_component_deps_b_${build_type})
add_dependencies(use_component_deps_b_${build_type} component_deps_${build_type})
endif()
if (TARGET use_component_depsC_${build_type})
add_dependencies(use_component_depsC_${build_type} comp_deps_${build_type})
if (TARGET use_component_deps_c_${build_type})
add_dependencies(use_component_deps_c_${build_type} component_deps_${build_type})
endif()
if (TARGET export_component_deps_cmake_${build_type})
add_dependencies(export_component_deps_cmake_${build_type} use_component_deps_c_${build_type})
endif()
if (TARGET export_component_deps_pkgconfig_${build_type})
add_dependencies(export_component_deps_pkgconfig_${build_type} use_component_deps_c_${build_type})
endif()
endforeach()

Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions examples/export_component_deps_cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
project(gz-export_component_deps_cmake VERSION 0.1.0)
find_package(gz-cmake4 REQUIRED)
gz_configure_project()
gz_find_package(gz-use_component_deps_c REQUIRED)
gz_configure_build(QUIT_IF_BUILD_ERRORS)
gz_create_packages()
gz_create_docs()
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
* limitations under the License.
*
*/

#include <gz/use_component_deps_c/AlmostEmpty.hh>
6 changes: 6 additions & 0 deletions examples/export_component_deps_cmake/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-use_component_deps_c::gz-use_component_deps_c)
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources})
9 changes: 9 additions & 0 deletions examples/export_component_deps_pkgconfig/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
project(gz-export_component_deps_pkgconfig VERSION 0.1.0)
find_package(gz-cmake4 REQUIRED)
gz_configure_project()
include(GzPkgConfig)
gz_pkg_check_modules(gz-use_component_deps_c "gz-use_component_deps_c")
gz_configure_build(QUIT_IF_BUILD_ERRORS)
gz_create_packages()
gz_create_docs()
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
* limitations under the License.
*
*/

#include <gz/use_component_deps_c/AlmostEmpty.hh>
6 changes: 6 additions & 0 deletions examples/export_component_deps_pkgconfig/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-use_component_deps_c::gz-use_component_deps_c)
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources})
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
project(gz-use_component_depsA VERSION 0.1.0)
project(gz-use_component_deps_a VERSION 0.1.0)
find_package(gz-cmake4 REQUIRED)
gz_configure_project()
gz_find_package(gz-component_deps REQUIRED COMPONENTS parent child)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# use\_component\_depsA
# use\_component\_deps\_a

This package uses the `child` and `parent` components of `component\_deps`
and calls `gz_find_package` with the components specified
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#include <gz/component_deps/child/empty.hh>
#include <gz/component_deps/parent/empty.hh>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gz_install_all_headers()
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (C) 2024 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
* limitations under the License.
*
*/

#include <gz/use_component_deps_a/AlmostEmpty.hh>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
project(gz-use_component_depsB VERSION 0.1.0)
project(gz-use_component_deps_b VERSION 0.1.0)
find_package(gz-cmake4 REQUIRED)
gz_configure_project()
gz_find_package(gz-component_deps REQUIRED COMPONENTS child parent)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# use\_component\_depsB
# use\_component\_deps\_b

This package uses the `child` and `parent` components of `component\_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 `use_component_depsA`.
this package is identical to `use_component_deps_a`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#include <gz/component_deps/child/empty.hh>
#include <gz/component_deps/parent/empty.hh>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gz_install_all_headers()
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (C) 2024 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
18 changes: 18 additions & 0 deletions examples/use_component_deps_b/src/AlmostEmpty.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (C) 2018 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#include <gz/use_component_deps_b/AlmostEmpty.hh>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
project(gz-use_component_depsC VERSION 0.1.0)
project(gz-use_component_deps_c VERSION 0.1.0)
find_package(gz-cmake4 REQUIRED)
gz_configure_project()
gz_find_package(gz-component_deps REQUIRED COMPONENTS child)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# use\_component\_depsC
# use\_component\_deps\_c

This package uses the `child` component of `component\_deps`
but should also find the `parent` component indirectly.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#include <gz/component_deps/child/empty.hh>
#include <gz/component_deps/parent/empty.hh>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gz_install_all_headers()
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (C) 2024 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
18 changes: 18 additions & 0 deletions examples/use_component_deps_c/src/AlmostEmpty.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (C) 2018 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#include <gz/use_component_deps_c/AlmostEmpty.hh>
Loading