From c8666e3e35174ddaacfe52c5c2d441f80cb86ce9 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Wed, 8 Mar 2023 11:34:00 +0000 Subject: [PATCH 01/13] Use CONFIG in gz_add_benchmark to avoid Windows collisions (#341) Signed-off-by: Jose Luis Rivero --- cmake/IgnBenchmark.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/IgnBenchmark.cmake b/cmake/IgnBenchmark.cmake index c79e34b3..5ee8be4d 100644 --- a/cmake/IgnBenchmark.cmake +++ b/cmake/IgnBenchmark.cmake @@ -87,7 +87,7 @@ function(ign_add_benchmarks) file(GENERATE OUTPUT - "${CMAKE_CURRENT_BINARY_DIR}/benchmark_targets" + "${CMAKE_CURRENT_BINARY_DIR}/$/benchmark_targets" CONTENT "${BENCHMARK_TARGETS_LIST}") @@ -96,7 +96,7 @@ function(ign_add_benchmarks) COMMAND python3 ${IGNITION_CMAKE_BENCHMARK_DIR}/run_benchmarks.py --project-name ${PROJECT_NAME} --version-file ${CMAKE_CURRENT_BINARY_DIR}/version_info.json - --benchmark-targets ${CMAKE_CURRENT_BINARY_DIR}/benchmark_targets + --benchmark-targets ${CMAKE_CURRENT_BINARY_DIR}/$/benchmark_targets --results-root ${CMAKE_BINARY_DIR}/benchmark_results ) add_dependencies(run_benchmarks ${BENCHMARK_TARGETS} version_info_target) From 940e2b795eaa69df651031ceb430b5a025177c12 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Mon, 22 May 2023 11:44:58 +0200 Subject: [PATCH 02/13] Prepare for gz-cmake2 2.17.0 release (#351) * Bump version to 2.17.0 * Update Changelog --------- Signed-off-by: Jose Luis Rivero --- CMakeLists.txt | 2 +- Changelog.md | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b79a17ee..c38f39af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) #============================================================================ # Initialize the project #============================================================================ -project(ignition-cmake2 VERSION 2.16.0) +project(ignition-cmake2 VERSION 2.17.0) #-------------------------------------- # Initialize the IGNITION_CMAKE_DIR variable with the location of the cmake diff --git a/Changelog.md b/Changelog.md index 6903212d..455023d2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,4 +1,18 @@ -## Ignition CMake 2.x +## Gazebo CMake 2.x + +### Gazebo CMake 2.17.0 (2023-05-19) + +1. Use CONFIG in gz_add_benchmark to avoid Windows collisions + * [Pull request #341](https://github.com/gazebosim/ign-cmake/pull/341) + +1. LICENSE: add Apache 2.0 license text + * [Pull request #338](https://github.com/gazebosim/ign-cmake/pull/338) + +1. Disable protobuf warnings on protobuf target (#335) + * [Pull request #335](https://github.com/gazebosim/ign-cmake/pull/335) + +1. Fix FindAVDEVICE.cmake in case without pkg-config installed with ffmpeg >= 5.1 + * [Pull request #330](https://github.com/gazebosim/ign-cmake/pull/330) ### Ignition CMake 2.16.0 (2022-10-08) From 3cb9f656f78c59ee93607c28ecc7a3d48e5ed6e7 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Tue, 1 Aug 2023 14:41:49 -0500 Subject: [PATCH 03/13] Fix Github project automation for new project board (#371) Signed-off-by: Addisu Z. Taddese --- .github/workflows/triage.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml index 736670e0..152404be 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/triage.yml @@ -1,7 +1,7 @@ on: issues: types: [opened] - pull_request_target: + pull_request: types: [opened] name: Ticket opened jobs: @@ -10,10 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Add ticket to inbox - uses: technote-space/create-project-card-action@v1 + uses: actions/add-to-project@v0.5.0 with: - PROJECT: Core development - COLUMN: Inbox - GITHUB_TOKEN: ${{ secrets.TRIAGE_TOKEN }} - CHECK_ORG_PROJECT: true + project-url: https://github.com/orgs/gazebosim/projects/7 + github-token: ${{ secrets.TRIAGE_TOKEN }} From 4f5cfdf4d063eff0d883d6b415a4c48e5b945bef Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Wed, 2 Aug 2023 14:15:42 -0500 Subject: [PATCH 04/13] Use `pull_request_target` for triage workflow (#372) Using the pull_request_target event allows this to work for PRs created from a fork. Signed-off-by: Addisu Z. Taddese --- .github/workflows/triage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml index 152404be..2c94852d 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/triage.yml @@ -1,7 +1,7 @@ on: issues: types: [opened] - pull_request: + pull_request_target: types: [opened] name: Ticket opened jobs: From fdcd50e3f2987d91f1ed72d075c3d6a55cbb995a Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Thu, 3 Aug 2023 11:36:50 -0500 Subject: [PATCH 05/13] Fix pkg_config_entry when version number is not specified (#374) When `gz_find_package` is called without a VERSION argument, the `_FIND_VERSION` variable is empty. But in most of our `Find*.cmake` modules, we add a pkg-config entry that assumes the version is there. Example: ``` gz_pkg_config_entry(GzProtobuf "protobuf >= ${GzProtobuf_FIND_VERSION}") ``` The pkg-config entry will then be "protobuf >= ", which is invalid and causes the following entry to be treated as a version number. The fix here removes the operator if the version is empty. Signed-off-by: Addisu Z. Taddese --- cmake/GzPkgConfig.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/GzPkgConfig.cmake b/cmake/GzPkgConfig.cmake index 7116ff96..00f5c236 100644 --- a/cmake/GzPkgConfig.cmake +++ b/cmake/GzPkgConfig.cmake @@ -205,8 +205,11 @@ macro(ign_pkg_config_entry package string) gz_pkg_config_entry(${package} ${string}) endmacro() macro(gz_pkg_config_entry package string) - - set(${package}_PKGCONFIG_ENTRY "${string}") + # The input string may contain an operator without a version, + # e.g "protobuf >= ". But this is not valid pkg-config syntax. This regex + # search/replace will remove the operator if the version is empty. + string(REGEX REPLACE " *[<>=]+ *$" "" entry ${string}) + set(${package}_PKGCONFIG_ENTRY "${entry}") set(${package}_PKGCONFIG_TYPE PKGCONFIG_REQUIRES) endmacro() From 87c2a5429d89987816059411d4dec8c0b3369ebd Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Thu, 3 Aug 2023 12:15:49 -0500 Subject: [PATCH 06/13] Prepare for 3.3.1 (#375) Signed-off-by: Addisu Z. Taddese --- CMakeLists.txt | 2 +- Changelog.md | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b6edd58..1c184a5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) #============================================================================ # Initialize the project #============================================================================ -project(gz-cmake3 VERSION 3.3.0) +project(gz-cmake3 VERSION 3.3.1) #-------------------------------------- # Initialize the GZ_CMAKE_DIR variable with the location of the cmake diff --git a/Changelog.md b/Changelog.md index 1a36818a..e3758961 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,15 @@ ## Gazebo CMake 3.x -### Gazebo CMake 3.3.0 (2023-08-10) +### Gazebo CMake 3.3.1 (2023-08-03) + +1. Fix pkg_config_entry when version number is not specified + * [Pull request #374](https://github.com/gazebosim/gz-cmake/pull/374) + +1. Infrastructure + * [Pull request #372](https://github.com/gazebosim/gz-cmake/pull/372) + * [Pull request #371](https://github.com/gazebosim/gz-cmake/pull/371) + +### Gazebo CMake 3.3.0 (2023-07-10) 1. GzConfigureProject: improve documentation * [Pull request #364](https://github.com/gazebosim/gz-cmake/pull/364) From 8c0946b6f82466769b8acdaac764ce5e03f95d25 Mon Sep 17 00:00:00 2001 From: RobbertProost Date: Wed, 9 Aug 2023 08:23:50 +0200 Subject: [PATCH 07/13] FindIgnOgre*: fix LIBRARY_DIRS and PLUGINDIR resolution when using pkgconfig (#376) Signed-off-by: Robbert Proost --- cmake/FindIgnOGRE.cmake | 25 +++++++++---------------- cmake/FindIgnOGRE2.cmake | 11 +++++------ 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/cmake/FindIgnOGRE.cmake b/cmake/FindIgnOGRE.cmake index e00f6193..6825eb2f 100644 --- a/cmake/FindIgnOGRE.cmake +++ b/cmake/FindIgnOGRE.cmake @@ -99,15 +99,12 @@ if (NOT WIN32) set (OGRE_FOUND false) else () # set library dirs if the value is empty - if (NOT ${OGRE_LIBRARY_DIRS} OR ${OGRE_LIBRARY_DIRS} STREQUAL "") - execute_process(COMMAND pkg-config --variable=libdir OGRE - OUTPUT_VARIABLE _pkgconfig_invoke_result - RESULT_VARIABLE _pkgconfig_failed) - if(_pkgconfig_failed) + if (NOT OGRE_LIBRARY_DIRS) + pkg_get_variable(OGRE_LIBRARY_DIRS OGRE libdir) + if(NOT OGRE_LIBRARY_DIRS) IGN_BUILD_WARNING ("Failed to find OGRE's library directory. The build will succeed, but there will likely be run-time errors.") else() - # set ogre library dir and strip line break - set(OGRE_LIBRARY_DIRS ${_pkgconfig_invoke_result}) + # strip line break string(REGEX REPLACE "\n$" "" OGRE_LIBRARY_DIRS "${OGRE_LIBRARY_DIRS}") string(FIND "${OGRE_LIBRARIES}" "${OGRE_LIBRARY_DIRS}" substr_found) @@ -147,22 +144,18 @@ if (NOT WIN32) endif() endforeach() - execute_process(COMMAND pkg-config --variable=plugindir OGRE - OUTPUT_VARIABLE _pkgconfig_invoke_result - RESULT_VARIABLE _pkgconfig_failed) - if(_pkgconfig_failed) + pkg_get_variable(OGRE_PLUGINDIR OGRE plugindir) + if(NOT OGRE_PLUGINDIR) IGN_BUILD_WARNING ("Failed to find OGRE's plugin directory. The build will succeed, but there will likely be run-time errors.") else() - # This variable will be substituted into cmake/setup.sh.in - set(OGRE_PLUGINDIR ${_pkgconfig_invoke_result}) + # Seems that OGRE_PLUGINDIR can end in a newline, which will cause problems + # when we pass it to the compiler later. + string(REPLACE "\n" "" OGRE_PLUGINDIR ${OGRE_PLUGINDIR}) endif() ign_pkg_config_library_entry(IgnOGRE OgreMain) set(OGRE_RESOURCE_PATH ${OGRE_PLUGINDIR}) - # Seems that OGRE_PLUGINDIR can end in a newline, which will cause problems - # when we pass it to the compiler later. - string(REPLACE "\n" "" OGRE_RESOURCE_PATH ${OGRE_RESOURCE_PATH}) endif() #reset pkg config path diff --git a/cmake/FindIgnOGRE2.cmake b/cmake/FindIgnOGRE2.cmake index df9fb0ec..0d40efce 100644 --- a/cmake/FindIgnOGRE2.cmake +++ b/cmake/FindIgnOGRE2.cmake @@ -218,14 +218,13 @@ if (NOT WIN32) endif() # use pkg-config to find ogre plugin path - # do it here before resetting the pkg-config paths - execute_process(COMMAND pkg-config --variable=plugindir ${IGN_PKG_NAME} - OUTPUT_VARIABLE _pkgconfig_invoke_result - RESULT_VARIABLE _pkgconfig_failed) - if(_pkgconfig_failed) + # do it here before resetting the pkg-config paths + pkg_get_variable(OGRE2_PLUGINDIR ${IGN_PKG_NAME} plugindir) + + if(NOT OGRE2_PLUGINDIR) IGN_BUILD_WARNING ("Failed to find OGRE's plugin directory. The build will succeed, but there will likely be run-time errors.") else() - fix_pkgconfig_prefix_jammy_bug("${_pkgconfig_invoke_result}" OGRE2_PLUGINDIR) + fix_pkgconfig_prefix_jammy_bug("${OGRE2_PLUGINDIR}" OGRE2_PLUGINDIR) endif() # reset pkg config path From 93c205922c6ec8f5b7d8edf37536798e1a8bb0d4 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 22 Aug 2023 08:47:24 -0500 Subject: [PATCH 08/13] Disable building examples by default (#377) Signed-off-by: Michael Carroll Co-authored-by: Jose Luis Rivero --- Migration.md | 5 +++ cmake/GzBuildExamples.cmake | 78 ++++++++++++++++++++----------------- 2 files changed, 47 insertions(+), 36 deletions(-) diff --git a/Migration.md b/Migration.md index c0b90136..12c3d352 100644 --- a/Migration.md +++ b/Migration.md @@ -7,6 +7,11 @@ release will remove the deprecated code. ## Gazebo CMake 2.X to 3.X +1. **Breaking**: Examples are now built using native cmake. + Two targets will be generated for each set of examples: `EXAMPLES_Build_TEST` and `EXAMPLES_Configure_TEST` + Examples are not built by default, but instead require `BUILD_EXAMPLES:bool=True` to be set. + This is because examples require the package of interest to be installed via `make install`. + 1. **Breaking**: The project name has been changed to use the `gz-` prefix, you **must** use the `gz` prefix! * This also means that any generated code that use the project name (e.g. CMake variables, in-source macros) would have to be migrated. * Some non-exhaustive examples of this include: diff --git a/cmake/GzBuildExamples.cmake b/cmake/GzBuildExamples.cmake index 5f202385..139d5be7 100644 --- a/cmake/GzBuildExamples.cmake +++ b/cmake/GzBuildExamples.cmake @@ -40,46 +40,52 @@ # For example ${CMAKE_CURRENT_BINARY_DIR}/examples # macro(gz_build_examples) - #------------------------------------ - # Define the expected arguments - set(options) - set(oneValueArgs SOURCE_DIR BINARY_DIR) + option(BUILD_EXAMPLES "Build examples (requires a system installation of the software first)" OFF) - #------------------------------------ - # Parse the arguments - _gz_cmake_parse_arguments(gz_build_examples "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + if(NOT ${BUILD_EXAMPLES}) + message(STATUS "Building examples disabled") + else() + #------------------------------------ + # Define the expected arguments + set(options) + set(oneValueArgs SOURCE_DIR BINARY_DIR) - set(gz_build_examples_CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH}) + #------------------------------------ + # Parse the arguments + _gz_cmake_parse_arguments(gz_build_examples "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - if (gz_build_examples_CMAKE_PREFIX_PATH) - # Replace colons from environment variable with semicolon cmake list delimiter - # Only perform if string has contents, otherwise cmake will complain about REPLACE command - string(REPLACE ":" ";" gz_build_examples_CMAKE_PREFIX_PATH ${gz_build_examples_CMAKE_PREFIX_PATH}) - endif() + set(gz_build_examples_CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH}) - if (CMAKE_INSTALL_PREFIX) - list(APPEND gz_build_examples_CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX}) - endif() + if (gz_build_examples_CMAKE_PREFIX_PATH) + # Replace colons from environment variable with semicolon cmake list delimiter + # Only perform if string has contents, otherwise cmake will complain about REPLACE command + string(REPLACE ":" ";" gz_build_examples_CMAKE_PREFIX_PATH ${gz_build_examples_CMAKE_PREFIX_PATH}) + endif() - add_test( - NAME EXAMPLES_Configure_TEST - COMMAND ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} - --no-warn-unused-cli - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} - -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} - -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} - "-DCMAKE_PREFIX_PATH=${gz_build_examples_CMAKE_PREFIX_PATH}" - -S ${gz_build_examples_SOURCE_DIR} - -B ${gz_build_examples_BINARY_DIR} - ) + if (CMAKE_INSTALL_PREFIX) + list(APPEND gz_build_examples_CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX}) + endif() - add_test( - NAME EXAMPLES_Build_TEST - COMMAND ${CMAKE_COMMAND} --build ${gz_build_examples_BINARY_DIR} - --config $ - ) - set_tests_properties(EXAMPLES_Build_TEST - PROPERTIES DEPENDS "EXAMPLES_Configure_TEST") + add_test( + NAME EXAMPLES_Configure_TEST + COMMAND ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} + --no-warn-unused-cli + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} + -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} + "-DCMAKE_PREFIX_PATH=${gz_build_examples_CMAKE_PREFIX_PATH}" + -S ${gz_build_examples_SOURCE_DIR} + -B ${gz_build_examples_BINARY_DIR} + ) + + add_test( + NAME EXAMPLES_Build_TEST + COMMAND ${CMAKE_COMMAND} --build ${gz_build_examples_BINARY_DIR} + --config $ + ) + set_tests_properties(EXAMPLES_Build_TEST + PROPERTIES DEPENDS "EXAMPLES_Configure_TEST") + endif() endmacro() From f47d61101978f89b3d28304c8a5781c64aeefb3b Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 24 Aug 2023 20:06:51 -0500 Subject: [PATCH 09/13] Only link against DL in the case that it is needed (#380) Signed-off-by: Michael Carroll --- cmake/GzRelocatableBinaries.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/GzRelocatableBinaries.cmake b/cmake/GzRelocatableBinaries.cmake index 36986b45..78f66aa5 100644 --- a/cmake/GzRelocatableBinaries.cmake +++ b/cmake/GzRelocatableBinaries.cmake @@ -98,6 +98,7 @@ macro(gz_add_get_install_prefix_impl) # Write cpp for shared or module library type option(GZ_ENABLE_RELOCATABLE_INSTALL "If ON, enable the feature of providing a relocatable install prefix in shared library." OFF) + if ((target_type STREQUAL "MODULE_LIBRARY" OR target_type STREQUAL "SHARED_LIBRARY") AND GZ_ENABLE_RELOCATABLE_INSTALL) # We can't query the LOCATION property of the target due to https://cmake.org/cmake/help/v3.25/policy/CMP0026.html # We can only access the directory of the library at generation time via $ @@ -208,7 +209,10 @@ endif() # Add cpp to library target_sources(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE ${gz_add_get_install_prefix_impl_GENERATED_CPP}) +# Only link DL in the case that it is needed. +if ((target_type STREQUAL "MODULE_LIBRARY" OR target_type STREQUAL "SHARED_LIBRARY") AND GZ_ENABLE_RELOCATABLE_INSTALL) # Link DL_TARGET that provides dladdr target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE ${DL_TARGET}) +endif() endmacro() From 139f8ee08e0c766e93e9ab0eeea5b32cfcc43e68 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Fri, 25 Aug 2023 10:44:49 -0500 Subject: [PATCH 10/13] Move DL fatal message (#382) * Move DL fatal message Signed-off-by: Michael Carroll * Move error location Signed-off-by: Michael Carroll --------- Signed-off-by: Michael Carroll --- cmake/GzRelocatableBinaries.cmake | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cmake/GzRelocatableBinaries.cmake b/cmake/GzRelocatableBinaries.cmake index 78f66aa5..3b51fc55 100644 --- a/cmake/GzRelocatableBinaries.cmake +++ b/cmake/GzRelocatableBinaries.cmake @@ -74,19 +74,12 @@ macro(gz_add_get_install_prefix_impl) "gz_add_get_install_prefix_impl: missing parameter OVERRIDE_INSTALL_PREFIX_ENV_VARIABLE") endif() - if(NOT TARGET ${PROJECT_LIBRARY_TARGET_NAME}) message(FATAL_ERROR "Target ${PROJECT_LIBRARY_TARGET_NAME} required by gz_add_get_install_prefix_impl\n" "does not exist.") endif() - if(NOT TARGET ${DL_TARGET}) - message(FATAL_ERROR - "gz_add_get_install_prefix_impl called without DL_TARGET defined,\n" - "please add gz_find_package(DL) if you want to use gz_add_get_install_prefix_impl.") - endif() - get_target_property(target_type ${PROJECT_LIBRARY_TARGET_NAME} TYPE) if(NOT (target_type STREQUAL "STATIC_LIBRARY" OR target_type STREQUAL "MODULE_LIBRARY" OR target_type STREQUAL "SHARED_LIBRARY")) message(FATAL_ERROR "gz_add_get_install_prefix_impl: library ${_library} is of unsupported type ${target_type}") @@ -100,6 +93,12 @@ macro(gz_add_get_install_prefix_impl) option(GZ_ENABLE_RELOCATABLE_INSTALL "If ON, enable the feature of providing a relocatable install prefix in shared library." OFF) if ((target_type STREQUAL "MODULE_LIBRARY" OR target_type STREQUAL "SHARED_LIBRARY") AND GZ_ENABLE_RELOCATABLE_INSTALL) + if(NOT TARGET ${DL_TARGET}) + message(FATAL_ERROR + "gz_add_get_install_prefix_impl called without DL_TARGET defined,\n" + "please add gz_find_package(DL) if you want to use gz_add_get_install_prefix_impl.") + endif() + # We can't query the LOCATION property of the target due to https://cmake.org/cmake/help/v3.25/policy/CMP0026.html # We can only access the directory of the library at generation time via $ file(GENERATE OUTPUT "${gz_add_get_install_prefix_impl_GENERATED_CPP}" From ec97ec2bd0fad0ba36704832a15e68d1781c6c61 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Fri, 25 Aug 2023 12:02:51 -0500 Subject: [PATCH 11/13] Prepare for 3.4.0 Release (#381) Signed-off-by: Addisu Z. Taddese Co-authored-by: Michael Carroll --- CMakeLists.txt | 2 +- Changelog.md | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c184a5c..0a41b1e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) #============================================================================ # Initialize the project #============================================================================ -project(gz-cmake3 VERSION 3.3.1) +project(gz-cmake3 VERSION 3.4.0) #-------------------------------------- # Initialize the GZ_CMAKE_DIR variable with the location of the cmake diff --git a/Changelog.md b/Changelog.md index e3758961..3db5872a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,20 @@ ## Gazebo CMake 3.x +### Gazebo CMake 3.4.0 (2023-08-25) + +1. Only link against DL in the case that it is needed + * [Pull request #380](https://github.com/gazebosim/gz-cmake/pull/380) + * [Pull request #382](https://github.com/gazebosim/gz-cmake/pull/382) + +1. Disable building examples by default + * [Pull request #377](https://github.com/gazebosim/gz-cmake/pull/377) + +1. FindIgnOgre*: fix LIBRARY_DIRS and PLUGINDIR resolution when using pkgconfig + * [Pull request #376](https://github.com/gazebosim/gz-cmake/pull/376) + +1. Use CONFIG in gz_add_benchmark to avoid Windows collisions + * [Pull request #341](https://github.com/gazebosim/gz-cmake/pull/341) + ### Gazebo CMake 3.3.1 (2023-08-03) 1. Fix pkg_config_entry when version number is not specified From ba4b99bf04ccecad694c0bf626439503e9e36146 Mon Sep 17 00:00:00 2001 From: Martin Pecka Date: Thu, 14 Sep 2023 18:43:35 +0200 Subject: [PATCH 12/13] Fixed finding Ogre2 on Windows+Conda. (#384) Signed-off-by: Martin Pecka --- cmake/FindGzOGRE2.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/FindGzOGRE2.cmake b/cmake/FindGzOGRE2.cmake index 9e4de839..ca0f4be7 100644 --- a/cmake/FindGzOGRE2.cmake +++ b/cmake/FindGzOGRE2.cmake @@ -26,7 +26,6 @@ # to be set before calling find_package: # # GZ_OGRE2_PROJECT_NAME Possible values: OGRE2 (default) or OGRE-Next -# (Only on UNIX, not in use for Windows) # Specify the project name used in the packaging. # It will impact directly in the name of the # CMake/pkg-config modules being used. @@ -43,9 +42,6 @@ # OGRE2_RESOURCE_PATH Path to ogre plugins directory # GzOGRE2::GzOGRE2 Imported target for OGRE2 # -# On Windows, we assume that all the OGRE* defines are passed in manually -# to CMake. -# # Supports finding the following OGRE2 components: HlmsPbs, HlmsUnlit, Overlay, # PlanarReflections # @@ -147,7 +143,8 @@ macro(get_preprocessor_entry CONTENTS KEYWORD VARIABLE) endif () endmacro() -if (NOT WIN32) +find_package(PkgConfig QUIET) +if (PkgConfig_FOUND) set(PKG_CONFIG_PATH_ORIGINAL $ENV{PKG_CONFIG_PATH}) foreach (GZ_OGRE2_PROJECT_NAME "OGRE2" "OGRE-Next") message(STATUS "Looking for OGRE using the name: ${GZ_OGRE2_PROJECT_NAME}") @@ -247,6 +244,8 @@ if (NOT WIN32) set(OGRE2_INCLUDE_DIRS ${${GZ_OGRE2_PROJECT_NAME}_INCLUDE_DIRS}) # sync possible OGRE-Next to OGRE2 + unset(OGRE2_INCLUDE CACHE) + unset(OGRE2_INCLUDE) # verify ogre header can be found in the include path find_path(OGRE2_INCLUDE NAMES Ogre.h @@ -392,7 +391,7 @@ if (NOT WIN32) # because gz_pkg_check_modules does not work for it. include(GzPkgConfig) gz_pkg_config_library_entry(GzOGRE2 OgreMain) -else() #WIN32 +else() #PkgConfig_FOUND set(OGRE2_FOUND TRUE) set(OGRE_LIBRARIES "") @@ -579,3 +578,4 @@ endif() set(IgnOGRE2_FOUND ${GzOGRE2_FOUND}) # TODO(CH3): Deprecated. Remove on tock. set(IGN_PKG_NAME ${GZ_PKG_NAME}) # TODO(CH3): Deprecated. Remove on tock. + From 200de1b26edbad9ad1d7efd7c29dd4f2080edefa Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Tue, 26 Sep 2023 14:08:59 -0500 Subject: [PATCH 13/13] Prepare for 3.4.1 release (#385) Signed-off-by: Addisu Z. Taddese --- CMakeLists.txt | 2 +- Changelog.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a41b1e0..1a8e5128 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) #============================================================================ # Initialize the project #============================================================================ -project(gz-cmake3 VERSION 3.4.0) +project(gz-cmake3 VERSION 3.4.1) #-------------------------------------- # Initialize the GZ_CMAKE_DIR variable with the location of the cmake diff --git a/Changelog.md b/Changelog.md index 3db5872a..8cf2c766 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,10 @@ ## Gazebo CMake 3.x +### Gazebo CMake 3.4.1 (2023-09-26) + +1. Fixed finding Ogre2 on Windows+Conda + * [Pull request #384](https://github.com/gazebosim/gz-cmake/pull/384) + ### Gazebo CMake 3.4.0 (2023-08-25) 1. Only link against DL in the case that it is needed