Skip to content

Commit

Permalink
Rename CMake project to gz (#352)
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <louise@openrobotics.org>
  • Loading branch information
chapulina authored and luca-della-vedova committed Jul 27, 2022
1 parent cb8a95d commit c12d1f1
Show file tree
Hide file tree
Showing 15 changed files with 76 additions and 76 deletions.
22 changes: 11 additions & 11 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
load(
"//ign_bazel:build_defs.bzl",
"//gz_bazel:build_defs.bzl",
"IGNITION_FEATURES",
"IGNITION_ROOT",
"IGNITION_VISIBILITY",
"generate_include_header",
"ign_config_header",
"ign_export_header",
"gz_config_header",
"gz_export_header",
)

package(
Expand All @@ -26,15 +26,15 @@ PROJECT_MINOR = 0
PROJECT_PATCH = 0

# Generates config.hh based on the version numbers in CMake code.
ign_config_header(
gz_config_header(
name = "config",
src = "include/gz/common/config.hh.in",
cmakelists = ["CMakeLists.txt"],
project_name = PROJECT_NAME,
project_version = (PROJECT_MAJOR, PROJECT_MINOR, PROJECT_PATCH),
)

ign_export_header(
gz_export_header(
name = "include/gz/common/Export.hh",
export_base = "IGNITION_COMMON",
lib_name = "ignition-common",
Expand Down Expand Up @@ -72,14 +72,14 @@ public_headers = public_headers_no_gen + [
]

cc_library(
name = "ign_common",
name = "gz_common",
srcs = sources + private_headers,
hdrs = public_headers,
includes = ["include"],
linkopts = ["-ldl"],
deps = [
"@uuid",
IGNITION_ROOT + "ign_math",
IGNITION_ROOT + "gz_math",
],
)

Expand All @@ -88,7 +88,7 @@ cc_binary(
includes = ["include"],
linkopts = ["-Wl,-soname,libignition-common5.so"],
linkshared = True,
deps = [":ign_common"],
deps = [":gz_common"],
)

test_srcs = glob(
Expand All @@ -101,9 +101,9 @@ test_srcs = glob(
srcs = [src],
data = [":libignition-common5.so"],
deps = [
":ign_common",
IGNITION_ROOT + "ign_bazel:utilities",
IGNITION_ROOT + "ign_common/test:test_utils",
":gz_common",
IGNITION_ROOT + "gz_bazel:utilities",
IGNITION_ROOT + "gz_common/test:test_utils",
"@gtest",
"@gtest//:gtest_main",
],
Expand Down
22 changes: 11 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
#============================================================================
# Initialize the project
#============================================================================
project(ignition-common5 VERSION 5.0.0)
set(IGN_COMMON_VER ${PROJECT_VERSION_MAJOR})
project(gz-common5 VERSION 5.0.0)
set(GZ_COMMON_VER ${PROJECT_VERSION_MAJOR})

#============================================================================
# Find ignition-cmake
# Find gz-cmake
#============================================================================
find_package(ignition-cmake3 REQUIRED)
set(IGN_CMAKE_VER ${ignition-cmake3_VERSION_MAJOR})
find_package(gz-cmake3 REQUIRED)
set(GZ_CMAKE_VER ${gz-cmake3_VERSION_MAJOR})

#============================================================================
# Configure the project
Expand Down Expand Up @@ -50,14 +50,14 @@ endif()
message(STATUS "\n\n-- ====== Finding Dependencies ======")

#--------------------------------------
# Find ignition-math
gz_find_package(ignition-math7 REQUIRED_BY geospatial graphics events)
set(IGN_MATH_VER ${ignition-math7_VERSION_MAJOR})
# Find gz-math
gz_find_package(gz-math7 REQUIRED_BY geospatial graphics events)
set(GZ_MATH_VER ${gz-math7_VERSION_MAJOR})

#--------------------------------------
# Find ignition-utils
gz_find_package(ignition-utils2 REQUIRED)
set(IGN_UTILS_VER ${ignition-utils2_VERSION_MAJOR})
# Find gz-utils
gz_find_package(gz-utils2 REQUIRED)
set(GZ_UTILS_VER ${gz-utils2_VERSION_MAJOR})

#--------------------------------------
# Find Tinyxml2
Expand Down
14 changes: 7 additions & 7 deletions av/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
load(
"//ign_bazel:build_defs.bzl",
"//gz_bazel:build_defs.bzl",
"IGNITION_ROOT",
"IGNITION_VISIBILITY",
"generate_include_header",
"ign_export_header",
"gz_export_header",
)

package(
Expand All @@ -29,7 +29,7 @@ sources = glob(

test_sources = glob(["src/*_TEST.cc"])

ign_export_header(
gz_export_header(
name = "include/gz/common/av/Export.hh",
export_base = "IGNITION_COMMON_AV",
lib_name = "ignition-common-av",
Expand All @@ -55,7 +55,7 @@ cc_library(
hdrs = public_headers,
includes = ["include"],
deps = [
IGNITION_ROOT + "ign_common",
IGNITION_ROOT + "gz_common",
"@ffmpeg//:avcodec",
"@ffmpeg//:avdevice",
"@ffmpeg//:avformat",
Expand All @@ -76,12 +76,12 @@ cc_binary(
name = src.replace("/", "_").replace(".cc", "").replace("src_", ""),
srcs = [src],
data = [
IGNITION_ROOT + "ign_common/test:data",
IGNITION_ROOT + "gz_common/test:data",
],
deps = [
":av",
IGNITION_ROOT + "ign_common/test:test_utils",
IGNITION_ROOT + "ign_bazel:utilities",
IGNITION_ROOT + "gz_common/test:test_utils",
IGNITION_ROOT + "gz_bazel:utilities",
"@gtest",
"@gtest//:gtest_main",
],
Expand Down
2 changes: 1 addition & 1 deletion av/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ gz_build_tests(
SOURCES ${gtest_sources}
LIB_DEPS
${av_target}
ignition-common${IGN_COMMON_VER}-testing
gz-common${GZ_COMMON_VER}-testing
)
10 changes: 5 additions & 5 deletions events/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
load(
"//ign_bazel:build_defs.bzl",
"//gz_bazel:build_defs.bzl",
"IGNITION_ROOT",
"IGNITION_VISIBILITY",
"generate_include_header",
"ign_export_header",
"gz_export_header",
)

package(
Expand All @@ -26,7 +26,7 @@ sources = glob(

test_sources = glob(["src/*_TEST.cc"])

ign_export_header(
gz_export_header(
name = "include/ignition/common/events/Export.hh",
export_base = "IGNITION_COMMON_EVENTS",
lib_name = "ignition-common-events",
Expand All @@ -52,7 +52,7 @@ cc_library(
hdrs = public_headers,
includes = ["include"],
deps = [
IGNITION_ROOT + "ign_common",
IGNITION_ROOT + "gz_common",
],
)

Expand All @@ -69,7 +69,7 @@ cc_binary(
srcs = [src],
deps = [
":events",
IGNITION_ROOT + "ign_common/test:test_utils",
IGNITION_ROOT + "gz_common/test:test_utils",
"@gtest",
"@gtest//:gtest_main",
],
Expand Down
4 changes: 2 additions & 2 deletions events/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ gz_add_component(events SOURCES ${sources} GET_TARGET_NAME events_target)

target_link_libraries(${events_target}
PUBLIC
ignition-math${IGN_MATH_VER}::ignition-math${IGN_MATH_VER})
gz-math${GZ_MATH_VER}::gz-math${GZ_MATH_VER})

gz_build_tests(
TYPE UNIT
SOURCES ${gtest_sources}
LIB_DEPS
${events_target}
ignition-common${IGN_COMMON_VER}-testing
gz-common${GZ_COMMON_VER}-testing
)
16 changes: 8 additions & 8 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

# Find the ignition-common library
find_package(ignition-common5 QUIET REQUIRED COMPONENTS events profiler)
set(IGN_COMMON_VER ${ignition-common5_VERSION_MAJOR})
# Find the gz-common library
find_package(gz-common5 QUIET REQUIRED COMPONENTS events profiler)
set(GZ_COMMON_VER ${gz-common5_VERSION_MAJOR})

add_executable(assert_example assert_example.cc)
target_link_libraries(assert_example ignition-common${IGN_COMMON_VER}::core)
target_link_libraries(assert_example gz-common${GZ_COMMON_VER}::core)

add_executable(console_example console.cc)
target_link_libraries(console_example ignition-common${IGN_COMMON_VER}::core)
target_link_libraries(console_example gz-common${GZ_COMMON_VER}::core)

add_executable(events_example events.cc)
target_link_libraries(events_example ignition-common${IGN_COMMON_VER}::events)
target_link_libraries(events_example gz-common${GZ_COMMON_VER}::events)

add_executable(profiler_example profiler.cc)
target_link_libraries(profiler_example ignition-common${IGN_COMMON_VER}::profiler)
target_link_libraries(profiler_example gz-common${GZ_COMMON_VER}::profiler)
target_compile_definitions(profiler_example PUBLIC "GZ_PROFILER_ENABLE=1")

add_executable(logging_performance logging_performance.cc)
target_link_libraries(logging_performance ignition-common${IGN_COMMON_VER}::core)
target_link_libraries(logging_performance gz-common${GZ_COMMON_VER}::core)

6 changes: 3 additions & 3 deletions geospatial/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ gz_add_component(geospatial
target_link_libraries(${geospatial_target}
PUBLIC
${PROJECT_LIBRARY_TARGET_NAME}-graphics
ignition-math${IGN_MATH_VER}::ignition-math${IGN_MATH_VER}
ignition-utils${IGN_UTILS_VER}::ignition-utils${IGN_UTILS_VER}
gz-math${GZ_MATH_VER}::gz-math${GZ_MATH_VER}
gz-utils${GZ_UTILS_VER}::gz-utils${GZ_UTILS_VER}
PRIVATE
${GDAL_LIBRARY})

Expand All @@ -20,5 +20,5 @@ target_include_directories(${geospatial_target}
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources}
LIB_DEPS
${geospatial_target}
ignition-common${IGN_COMMON_VER}-testing
gz-common${GZ_COMMON_VER}-testing
)
14 changes: 7 additions & 7 deletions graphics/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
load(
"//ign_bazel:build_defs.bzl",
"//gz_bazel:build_defs.bzl",
"IGNITION_ROOT",
"IGNITION_VISIBILITY",
"generate_include_header",
"ign_export_header",
"gz_export_header",
)

package(
Expand All @@ -26,7 +26,7 @@ sources = glob(

test_sources = glob(["src/*_TEST.cc"])

ign_export_header(
gz_export_header(
name = "include/gz/common/graphics/Export.hh",
export_base = "IGNITION_COMMON_GRAPHICS",
lib_name = "ignition-common-graphics",
Expand Down Expand Up @@ -57,8 +57,8 @@ cc_library(
"@glib",
"@gts",
"@tinyxml2",
IGNITION_ROOT + "ign_common",
IGNITION_ROOT + "ign_utils",
IGNITION_ROOT + "gz_common",
IGNITION_ROOT + "gz_utils",
],
)

Expand All @@ -74,11 +74,11 @@ cc_binary(
name = src.replace("/", "_").replace(".cc", "").replace("src_", ""),
srcs = [src],
data = [
IGNITION_ROOT + "ign_common/test:data",
IGNITION_ROOT + "gz_common/test:data",
],
deps = [
":graphics",
IGNITION_ROOT + "ign_common/test:test_utils",
IGNITION_ROOT + "gz_common/test:test_utils",
"@gtest",
"@gtest//:gtest_main",
],
Expand Down
10 changes: 5 additions & 5 deletions graphics/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ gz_add_component(graphics SOURCES ${sources} GET_TARGET_NAME graphics_target)

target_link_libraries(${graphics_target}
PUBLIC
ignition-math${IGN_MATH_VER}::ignition-math${IGN_MATH_VER}
ignition-utils${IGN_UTILS_VER}::ignition-utils${IGN_UTILS_VER}
gz-math${GZ_MATH_VER}::gz-math${GZ_MATH_VER}
gz-utils${GZ_UTILS_VER}::gz-utils${GZ_UTILS_VER}
PRIVATE
GTS::GTS
FreeImage::FreeImage
Expand All @@ -25,7 +25,7 @@ gz_build_tests(
SOURCES ${gtest_sources}
LIB_DEPS
${graphics_target}
ignition-common${IGN_COMMON_VER}-testing
gz-common${GZ_COMMON_VER}-testing
)

message ("ASSIMP INCLUDE IS ${ASSIMP_INCLUDE_DIRS}")
Expand All @@ -50,7 +50,7 @@ else()

# Otherwise, add its source directory to our target's PRIVATE include
# directories. We do not want this to be visible to consumers of
# ignition-common.
# gz-common.
target_include_directories(${graphics_target}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tinyxml2
${ASSIMP_INCLUDE_DIRS})
Expand All @@ -62,7 +62,7 @@ else()
target_include_directories(UNIT_ColladaExporter_TEST PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tinyxml2)
# We also need to add this as a source file to the collada exporter test's
# target, because we do not export the tinyxml2 symbols that get generated
# in the ignition-common library. Therefore, the collada exporter test
# in the gz-common library. Therefore, the collada exporter test
# cannot link to those symbols and must generate its own.
target_sources(UNIT_ColladaExporter_TEST PRIVATE tinyxml2/tinyxml2.cpp)

Expand Down
8 changes: 4 additions & 4 deletions profiler/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
load(
"//ign_bazel:build_defs.bzl",
"//gz_bazel:build_defs.bzl",
"IGNITION_ROOT",
"IGNITION_VISIBILITY",
"cmake_configure_file",
"generate_include_header",
"ign_export_header",
"gz_export_header",
)

package(
Expand Down Expand Up @@ -53,7 +53,7 @@ cmake_configure_file(
visibility = ["//visibility:private"],
)

ign_export_header(
gz_export_header(
name = "include/gz/common/profiler/Export.hh",
export_base = "IGNITION_COMMON_PROFILER",
lib_name = "ignition-common-profiler",
Expand Down Expand Up @@ -94,7 +94,7 @@ cc_library(
],
includes = ["include"],
deps = [
IGNITION_ROOT + "ign_common",
IGNITION_ROOT + "gz_common",
":remotery",
],
)
Expand Down
2 changes: 1 addition & 1 deletion profiler/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ gz_build_tests(
SOURCES ${PROFILER_TESTS}
LIB_DEPS
${profiler_target}
ignition-common${IGN_COMMON_VER}-testing
gz-common${GZ_COMMON_VER}-testing
TEST_LIST profiler_tests)

if(TARGET UNIT_Profiler_Remotery_TEST)
Expand Down
Loading

0 comments on commit c12d1f1

Please sign in to comment.