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

[ign -> gz] CMake functions #89

Merged
merged 1 commit into from
Jun 17, 2022
Merged
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
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set(IGN_CMAKE_VER ${ignition-cmake3_VERSION_MAJOR})
#============================================================================
# Configure the project
#============================================================================
ign_configure_project(
gz_configure_project(
REPLACE_IGNITION_INCLUDE_PATH gz/plugin
VERSION_SUFFIX pre0)

Expand All @@ -32,7 +32,7 @@ message(STATUS "\n\n-- ====== Finding Dependencies ======")

#--------------------------------------
# Find libdl
ign_find_package(DL
gz_find_package(DL
REQUIRED_BY loader
PRIVATE_FOR loader
PRETTY libdl PURPOSE "Required for loading plugins")
Expand All @@ -45,29 +45,29 @@ find_program(GZ_TOOLS_PROGRAM ign)

#--------------------------------------
# Find ignition-utils
ign_find_package(ignition-utils2 REQUIRED COMPONENTS cli)
gz_find_package(ignition-utils2 REQUIRED COMPONENTS cli)
set(IGN_UTILS_VER ${ignition-utils2_VERSION_MAJOR})


#============================================================================
# Configure the build
#============================================================================
ign_configure_build(QUIT_IF_BUILD_ERRORS
gz_configure_build(QUIT_IF_BUILD_ERRORS
COMPONENTS loader register)


#============================================================================
# Create package information
#============================================================================
ign_create_packages()
gz_create_packages()

#============================================================================
# Configure documentation
#============================================================================
configure_file(${CMAKE_SOURCE_DIR}/api.md.in ${CMAKE_BINARY_DIR}/api.md)
configure_file(${CMAKE_SOURCE_DIR}/tutorials.md.in ${CMAKE_BINARY_DIR}/tutorials.md)

ign_create_docs(
gz_create_docs(
API_MAINPAGE_MD "${CMAKE_BINARY_DIR}/api.md"
TUTORIALS_MAINPAGE_MD "${CMAKE_BINARY_DIR}/tutorials.md"
)
7 changes: 3 additions & 4 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@

# Collect source files into the "sources" variable and unit test files into the
# "tests" variable
ign_get_libsources_and_unittests(sources tests)
gz_get_libsources_and_unittests(sources tests)

# Create the library target
ign_create_core_library(
gz_create_core_library(
SOURCES ${sources}
CXX_STANDARD 17)

target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC ignition-utils${IGN_UTILS_VER}::ignition-utils${IGN_UTILS_VER})

# Build the unit tests
ign_build_tests(
gz_build_tests(
TYPE UNIT
SOURCES ${tests})

Expand Down
3 changes: 1 addition & 2 deletions core/include/gz/plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

ign_install_all_headers()
gz_install_all_headers()
7 changes: 3 additions & 4 deletions loader/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@

# Collect source files into the "sources" variable and unit test files into the
# "tests" variable
ign_get_libsources_and_unittests(sources tests)
gz_get_libsources_and_unittests(sources tests)

# Disable ign_TEST if ignition-tools is not found
if (MSVC OR NOT GZ_TOOLS_PROGRAM)
list(REMOVE_ITEM tests src/ign_TEST.cc)
endif()

# Create the library target
ign_add_component(loader
gz_add_component(loader
SOURCES ${sources}
GET_TARGET_NAME loader)

target_link_libraries(${loader}
PRIVATE ${DL_TARGET})

ign_build_tests(
gz_build_tests(
TYPE UNIT
SOURCES ${tests}
LIB_DEPS ${loader}
Expand Down
4 changes: 2 additions & 2 deletions loader/conf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Used only for internal testing.
set(ign_library_path "${CMAKE_BINARY_DIR}/test/lib/$<CONFIG>/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")
set(gz_library_path "${CMAKE_BINARY_DIR}/test/lib/$<CONFIG>/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")

# Generate a configuration file for internal testing.
# Note that the major version of the library is included in the name.
Expand All @@ -13,7 +13,7 @@ file(GENERATE
INPUT "${CMAKE_CURRENT_BINARY_DIR}/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.yaml.configured")

# Used for the installed version.
set(ign_library_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")
set(gz_library_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")

# Generate the configuration file that is installed.
# Note that the major version of the library is included in the name.
Expand Down
2 changes: 1 addition & 1 deletion loader/conf/plugin.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
format: 1.0.0
library_name: @PROJECT_NAME_NO_VERSION@
library_version: @PROJECT_VERSION_FULL@
library_path: @ign_library_path@
library_path: @gz_library_path@
commands:
- plugin : Print information about plugins.
---
3 changes: 1 addition & 2 deletions register/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

ign_add_component(register INTERFACE)
gz_add_component(register INTERFACE)

install(
DIRECTORY include/
Expand Down
4 changes: 2 additions & 2 deletions test/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# This is to make test_config.h visible
include_directories("${CMAKE_BINARY_DIR}")

ign_get_sources(tests)
gz_get_sources(tests)

ign_build_tests(
gz_build_tests(
TYPE INTEGRATION
SOURCES ${tests}
LIB_DEPS
Expand Down
4 changes: 2 additions & 2 deletions test/performance/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_get_sources(tests)
gz_get_sources(tests)

# plugin_specialization test causes lcov to hang
# see ign-cmake issue 25
Expand All @@ -7,7 +7,7 @@ if("${CMAKE_BUILD_TYPE_UPPERCASE}" STREQUAL "COVERAGE")
plugin_specialization.cc)
endif()

ign_build_tests(
gz_build_tests(
TYPE PERFORMANCE
SOURCES ${tests}
LIB_DEPS
Expand Down