Skip to content

Commit

Permalink
Support new gz/ include folder
Browse files Browse the repository at this point in the history
* REPLACE_IGNITION_INCLUDE_PATH gz/utils
* Include from gz/* in header files
* Update header guards to use GZ_*
* Add gz subdirectory in CMakeLists.txt

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
  • Loading branch information
scpeters committed Apr 18, 2022
1 parent b2e1098 commit 7c6e7e8
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 41 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ find_package(ignition-cmake3 REQUIRED)
# Configure the project
#============================================================================
set(c++standard 17)
ign_configure_project(VERSION_SUFFIX pre1)
ign_configure_project(
REPLACE_IGNITION_INCLUDE_PATH gz/utils
VERSION_SUFFIX pre1)

#============================================================================
# Set project-specific options
Expand Down
2 changes: 1 addition & 1 deletion include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
add_subdirectory(ignition)
add_subdirectory(gz)
10 changes: 5 additions & 5 deletions include/gz/utils/Environment.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*
*/

#ifndef IGNITION_UTILS_ENVIRONMENT_HH_
#define IGNITION_UTILS_ENVIRONMENT_HH_
#ifndef GZ_UTILS_ENVIRONMENT_HH_
#define GZ_UTILS_ENVIRONMENT_HH_

#include <ignition/utils/config.hh>
#include <ignition/utils/Export.hh>
#include <gz/utils/config.hh>
#include <gz/utils/Export.hh>

#include <string>

Expand Down Expand Up @@ -70,5 +70,5 @@ bool IGNITION_UTILS_VISIBLE unsetenv(const std::string &_name);
} // namespace utils
} // namespace ignition

#endif // IGNITION_UTILS_ENVIRONMENT_HH_
#endif // GZ_UTILS_ENVIRONMENT_HH_

8 changes: 4 additions & 4 deletions include/gz/utils/ExtraTestMacros.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*
*/

#ifndef IGNITION_UTILS_EXTRATESTMACROS_HH
#define IGNITION_UTILS_EXTRATESTMACROS_HH
#ifndef GZ_UTILS_EXTRATESTMACROS_HH
#define GZ_UTILS_EXTRATESTMACROS_HH

#include <ignition/utils/detail/ExtraTestMacros.hh>
#include <gz/utils/detail/ExtraTestMacros.hh>

/// \brief Restrict the execution of the test for the Windows platform.
/// The test will be compiled on Windows too but will never be run as
Expand All @@ -44,4 +44,4 @@
#define IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(TestName) \
DETAIL_IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(TestName)

#endif // IGNITION_UTILS_EXTRATESTMACROS_HH
#endif // GZ_UTILS_EXTRATESTMACROS_HH
14 changes: 7 additions & 7 deletions include/gz/utils/ImplPtr.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
*
*/

#ifndef IGNITION_UTILS__IMPLPTR_HH_
#define IGNITION_UTILS__IMPLPTR_HH_
#ifndef GZ_UTILS__IMPLPTR_HH_
#define GZ_UTILS__IMPLPTR_HH_

#include <memory>
#include <utility>

#include <ignition/utils/detail/DefaultOps.hh>
#include <ignition/utils/SuppressWarning.hh>
#include <ignition/utils/Export.hh>
#include <gz/utils/detail/DefaultOps.hh>
#include <gz/utils/SuppressWarning.hh>
#include <gz/utils/Export.hh>

namespace ignition
{
Expand Down Expand Up @@ -255,6 +255,6 @@ namespace ignition
IGN_UTILS_UNIQUE_IMPL_PTR_FWD(Implementation, memberName)


#include <ignition/utils/detail/ImplPtr.hh>
#include <gz/utils/detail/ImplPtr.hh>

#endif // IGNITION_UTILS__IMPLPTR_HH_
#endif // GZ_UTILS__IMPLPTR_HH_
6 changes: 3 additions & 3 deletions include/gz/utils/NeverDestroyed.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*
*/

#ifndef IGNITION_UTILS_NEVERDESTROYED_HH_
#define IGNITION_UTILS_NEVERDESTROYED_HH_
#ifndef GZ_UTILS_NEVERDESTROYED_HH_
#define GZ_UTILS_NEVERDESTROYED_HH_

#include <new>
#include <type_traits>
Expand Down Expand Up @@ -159,4 +159,4 @@ class NeverDestroyed
} // namespace utils
} // namespace ignition

#endif // IGNITION_UTILS_NEVERDESTROYED_HH_
#endif // GZ_UTILS_NEVERDESTROYED_HH_
8 changes: 4 additions & 4 deletions include/gz/utils/SuppressWarning.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*
*/

#ifndef IGNITION_UTILS__SUPPRESSWARNING_HH_
#define IGNITION_UTILS__SUPPRESSWARNING_HH_
#ifndef GZ_UTILS__SUPPRESSWARNING_HH_
#define GZ_UTILS__SUPPRESSWARNING_HH_

#include <ignition/utils/detail/SuppressWarning.hh>
#include <gz/utils/detail/SuppressWarning.hh>

// This header contains cross-platform macros for suppressing warnings. Please
// only use these macros responsibly when you are certain that the compiler is
Expand Down Expand Up @@ -88,4 +88,4 @@
// TODO(anyone): Add more warning types as they become relevant.
// Do not add warning types to suppress unless they are genuinely necessary.

#endif // IGNITION_UTILS__SUPPRESSWARNING_HH_
#endif // GZ_UTILS__SUPPRESSWARNING_HH_
6 changes: 3 additions & 3 deletions include/gz/utils/detail/DefaultOps.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*
*/

#ifndef IGNITION_UTILS__DETAIL__DEFAULTOPS_HH_
#define IGNITION_UTILS__DETAIL__DEFAULTOPS_HH_
#ifndef GZ_UTILS__DETAIL__DEFAULTOPS_HH_
#define GZ_UTILS__DETAIL__DEFAULTOPS_HH_

#include <type_traits>

Expand Down Expand Up @@ -80,5 +80,5 @@ namespace ignition
} // namespace utils
} // namespace ignition

#endif // IGNITION_UTILS__DETAIL__DEFAULTOPS_HH_
#endif // GZ_UTILS__DETAIL__DEFAULTOPS_HH_

8 changes: 4 additions & 4 deletions include/gz/utils/detail/ExtraTestMacros.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*
*/

#ifndef IGNITION_UTILS_DETAIL_EXTRATESTMACROS_HH
#define IGNITION_UTILS_DETAIL_EXTRATESTMACROS_HH
#ifndef GZ_UTILS_DETAIL_EXTRATESTMACROS_HH
#define GZ_UTILS_DETAIL_EXTRATESTMACROS_HH

#include <ignition/utils/SuppressWarning.hh>
#include <gz/utils/SuppressWarning.hh>

#define DETAIL_IGN_UTILS_ADD_DISABLED_PREFIX(x) DISABLED_##x

Expand Down Expand Up @@ -59,4 +59,4 @@
#endif // defined __linux__


#endif // IGNITION_UTILS_DETAIL_EXTRATESTMACROS_HH
#endif // GZ_UTILS_DETAIL_EXTRATESTMACROS_HH
8 changes: 4 additions & 4 deletions include/gz/utils/detail/ImplPtr.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*
*/

#ifndef IGNITION_UTILS__DETAIL__IMPLPTR_HH_
#define IGNITION_UTILS__DETAIL__IMPLPTR_HH_
#ifndef GZ_UTILS__DETAIL__IMPLPTR_HH_
#define GZ_UTILS__DETAIL__IMPLPTR_HH_

#include <ignition/utils/ImplPtr.hh>
#include <gz/utils/ImplPtr.hh>

#include <utility>

Expand Down Expand Up @@ -148,4 +148,4 @@ namespace ignition
} // namespace utils
} // namespace ignition

#endif // IGNITION_UTILS__DETAIL__IMPLPTR_HH_
#endif // GZ_UTILS__DETAIL__IMPLPTR_HH_
8 changes: 4 additions & 4 deletions include/gz/utils/detail/SuppressWarning.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*
*/

#ifndef IGNITION_UTILS__DETAIL__SUPPRESSWARNING_HH_
#define IGNITION_UTILS__DETAIL__SUPPRESSWARNING_HH_
#ifndef GZ_UTILS__DETAIL__SUPPRESSWARNING_HH_
#define GZ_UTILS__DETAIL__SUPPRESSWARNING_HH_

#include <ignition/utils/SuppressWarning.hh>
#include <gz/utils/SuppressWarning.hh>

#ifndef DETAIL_IGN_UTILS_STRINGIFY
#define DETAIL_IGN_UTILS_STRINGIFY(x) #x
Expand Down Expand Up @@ -238,4 +238,4 @@

#endif

#endif // IGNITION_UTILS__DETAIL__SUPPRESSWARNING_HH_
#endif // GZ_UTILS__DETAIL__SUPPRESSWARNING_HH_
2 changes: 1 addition & 1 deletion include/gz/utils/utils.hh.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Automatically generated
#include <ignition/utils/config.hh>
#include <gz/utils/config.hh>
${ign_headers}

0 comments on commit 7c6e7e8

Please sign in to comment.