diff --git a/examples/using_cli/main.cc b/examples/using_cli/main.cc index 04810f8..4982ef7 100644 --- a/examples/using_cli/main.cc +++ b/examples/using_cli/main.cc @@ -29,7 +29,7 @@ int main(int argc, char** argv) CLI::App app{"Using ignition-utils CLI wrapper"}; app.add_flag_callback("-v,--version", [](){ - std::cout << IGNITION_UTILS_VERSION_FULL << std::endl; + std::cout << GZ_UTILS_VERSION_FULL << std::endl; throw CLI::Success(); }); diff --git a/include/gz/utils/Environment.hh b/include/gz/utils/Environment.hh index 36cad0b..7e034d8 100644 --- a/include/gz/utils/Environment.hh +++ b/include/gz/utils/Environment.hh @@ -27,7 +27,7 @@ namespace ignition { namespace utils { -inline namespace IGNITION_UTILS_VERSION_NAMESPACE { +inline namespace GZ_UTILS_VERSION_NAMESPACE { /// \brief Find the environment variable '_name' and return its value. /// @@ -39,7 +39,7 @@ inline namespace IGNITION_UTILS_VERSION_NAMESPACE { /// \param[in] _allowEmpty Allow set-but-empty variables. /// (Unsupported on Windows) /// \return True if the variable was found or false otherwise. -bool IGNITION_UTILS_VISIBLE env( +bool GZ_UTILS_VISIBLE env( const std::string &_name, std::string &_value, bool _allowEmpty = false); @@ -54,7 +54,7 @@ bool IGNITION_UTILS_VISIBLE env( /// \param[in] _name Name of the environment variable. /// \param[in] _value Value of the variable to be set. /// \return True if the variable was set or false otherwise. -bool IGNITION_UTILS_VISIBLE setenv( +bool GZ_UTILS_VISIBLE setenv( const std::string &_name, const std::string &_value); /// \brief Unset the environment variable '_name'. @@ -64,7 +64,7 @@ bool IGNITION_UTILS_VISIBLE setenv( /// /// \param[in] _name Name of the environment variable. /// \return True if the variable was unset or false otherwise. -bool IGNITION_UTILS_VISIBLE unsetenv(const std::string &_name); +bool GZ_UTILS_VISIBLE unsetenv(const std::string &_name); } } // namespace utils diff --git a/include/gz/utils/config.hh.in b/include/gz/utils/config.hh.in index 0396d6d..891a97a 100644 --- a/include/gz/utils/config.hh.in +++ b/include/gz/utils/config.hh.in @@ -1,17 +1,39 @@ +/* + * Copyright (C) 2022 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. + * + */ + /* Config.hh. Generated by CMake for @PROJECT_NAME_NO_VERSION@. */ +#ifndef GZ_UTILS_CONFIG_HH_ +#define GZ_UTILS_CONFIG_HH_ + /* Version number */ -#define IGNITION_UTILS_MAJOR_VERSION ${PROJECT_VERSION_MAJOR} -#define IGNITION_UTILS_MINOR_VERSION ${PROJECT_VERSION_MINOR} -#define IGNITION_UTILS_PATCH_VERSION ${PROJECT_VERSION_PATCH} +#define GZ_UTILS_MAJOR_VERSION ${PROJECT_VERSION_MAJOR} +#define GZ_UTILS_MINOR_VERSION ${PROJECT_VERSION_MINOR} +#define GZ_UTILS_PATCH_VERSION ${PROJECT_VERSION_PATCH} -#define IGNITION_UTILS_VERSION "${PROJECT_VERSION}" -#define IGNITION_UTILS_VERSION_FULL "${PROJECT_VERSION_FULL}" +#define GZ_UTILS_VERSION "${PROJECT_VERSION}" +#define GZ_UTILS_VERSION_FULL "${PROJECT_VERSION_FULL}" -#define IGNITION_UTILS_VERSION_NAMESPACE v${PROJECT_VERSION_MAJOR} +#define GZ_UTILS_VERSION_NAMESPACE v${PROJECT_VERSION_MAJOR} -#define IGNITION_UTILS_VERSION_HEADER "Ignition ${IGN_DESIGNATION}, version ${PROJECT_VERSION_FULL}\nCopyright (C) 2020 Open Source Robotics Foundation.\nReleased under the Apache 2.0 License.\n\n" +#define GZ_UTILS_VERSION_HEADER "Ignition ${IGN_DESIGNATION}, version ${PROJECT_VERSION_FULL}\nCopyright (C) 2020 Open Source Robotics Foundation.\nReleased under the Apache 2.0 License.\n\n" #cmakedefine IGNITION_UTILS_BUILD_TYPE_PROFILE 1 #cmakedefine IGNITION_UTILS_BUILD_TYPE_DEBUG 1 #cmakedefine IGNITION_UTILS_BUILD_TYPE_RELEASE 1 + +#endif diff --git a/include/ignition/utils/config.hh b/include/ignition/utils/config.hh index fea1896..e47e286 100644 --- a/include/ignition/utils/config.hh +++ b/include/ignition/utils/config.hh @@ -16,3 +16,19 @@ */ #include + +#ifndef IGNITION_UTILS_CONFIG_HH_ +#define IGNITION_UTILS_CONFIG_HH_ + +#define IGNITION_UTILS_MAJOR_VERSION GZ_UTILS_MAJOR_VERSION +#define IGNITION_UTILS_MINOR_VERSION GZ_UTILS_MINOR_VERSION +#define IGNITION_UTILS_PATCH_VERSION GZ_UTILS_PATCH_VERSION + +#define IGNITION_UTILS_VERSION GZ_UTILS_VERSION +#define IGNITION_UTILS_VERSION_FULL GZ_UTILS_VERSION_FULL + +#define IGNITION_UTILS_VERSION_NAMESPACE GZ_UTILS_VERSION_NAMESPACE + +#define IGNITION_UTILS_VERSION_HEADER GZ_UTILS_VERSION_HEADER + +#endif diff --git a/src/Environment.cc b/src/Environment.cc index bfb6c1e..8258fb6 100644 --- a/src/Environment.cc +++ b/src/Environment.cc @@ -25,7 +25,7 @@ namespace ignition { namespace utils { -inline namespace IGNITION_UTILS_VERSION_NAMESPACE { +inline namespace GZ_UTILS_VERSION_NAMESPACE { ///////////////////////////////////////////////// bool env(const std::string &_name, std::string &_value, bool _allowEmpty) diff --git a/test/integration/implptr/implptr_test_classes.hh b/test/integration/implptr/implptr_test_classes.hh index 9acee8e..540a28a 100644 --- a/test/integration/implptr/implptr_test_classes.hh +++ b/test/integration/implptr/implptr_test_classes.hh @@ -15,8 +15,8 @@ * */ -#ifndef IGNITION_UTILS_TEST_IMPLPTR_TEST_CLASSES_HH_ -#define IGNITION_UTILS_TEST_IMPLPTR_TEST_CLASSES_HH_ +#ifndef GZ_UTILS_TEST_IMPLPTR_TEST_CLASSES_HH_ +#define GZ_UTILS_TEST_IMPLPTR_TEST_CLASSES_HH_ #include #include @@ -32,7 +32,7 @@ namespace ignition class ObjectPrivate; /// \brief A PIMPL test class that can be copied. - class IGNITION_UTILS_VISIBLE CopyableObject + class GZ_UTILS_VISIBLE CopyableObject { /// \brief Constructor public: CopyableObject(int _ivalue = 0, @@ -62,7 +62,7 @@ namespace ignition }; /// \brief A PIMPL test class that cannot be copied; it can only be moved. - class IGNITION_UTILS_VISIBLE MovableObject + class GZ_UTILS_VISIBLE MovableObject { /// \brief Constructor public: MovableObject(int _ivalue = 0, @@ -92,7 +92,7 @@ namespace ignition }; /// \brief A PIMPL test class that can be copied (alternate definition) - class IGNITION_UTILS_VISIBLE CopyableObjectAlt + class GZ_UTILS_VISIBLE CopyableObjectAlt { /// \brief Constructor public: CopyableObjectAlt(int _ivalue = 0, @@ -119,4 +119,4 @@ namespace ignition } // namespace implptr_test_classes } // namespace ignition -#endif // IGNITION_UTILS_TEST_IMPLPTR_TEST_CLASSES_HH_ +#endif // GZ_UTILS_TEST_IMPLPTR_TEST_CLASSES_HH_