From 7eb2147385a6921ee462ac796673d0e5f9f302e5 Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Thu, 16 Jun 2022 13:43:15 -0700 Subject: [PATCH] [ign -> gz] CMake functions Signed-off-by: Louise Poubel --- CMakeLists.txt | 12 ++++++------ core/CMakeLists.txt | 7 +++---- core/include/gz/plugin/CMakeLists.txt | 3 +-- loader/CMakeLists.txt | 7 +++---- loader/conf/CMakeLists.txt | 4 ++-- loader/conf/plugin.yaml.in | 2 +- register/CMakeLists.txt | 3 +-- test/integration/CMakeLists.txt | 4 ++-- test/performance/CMakeLists.txt | 4 ++-- 9 files changed, 21 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cf81a978..354f210d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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") @@ -45,21 +45,21 @@ 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 @@ -67,7 +67,7 @@ ign_create_packages() 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" ) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 75cfc2a8..9736ab1f 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -1,10 +1,9 @@ - # 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) @@ -12,7 +11,7 @@ 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}) diff --git a/core/include/gz/plugin/CMakeLists.txt b/core/include/gz/plugin/CMakeLists.txt index c786bcee..bf4411e8 100644 --- a/core/include/gz/plugin/CMakeLists.txt +++ b/core/include/gz/plugin/CMakeLists.txt @@ -1,2 +1 @@ - -ign_install_all_headers() +gz_install_all_headers() diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt index 816d5f1d..49ea3c23 100644 --- a/loader/CMakeLists.txt +++ b/loader/CMakeLists.txt @@ -1,7 +1,6 @@ - # 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) @@ -9,14 +8,14 @@ if (MSVC OR NOT GZ_TOOLS_PROGRAM) 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} diff --git a/loader/conf/CMakeLists.txt b/loader/conf/CMakeLists.txt index bb7f7078..f5dd31fd 100644 --- a/loader/conf/CMakeLists.txt +++ b/loader/conf/CMakeLists.txt @@ -1,5 +1,5 @@ # Used only for internal testing. -set(ign_library_path "${CMAKE_BINARY_DIR}/test/lib/$/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}") +set(gz_library_path "${CMAKE_BINARY_DIR}/test/lib/$/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. @@ -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. diff --git a/loader/conf/plugin.yaml.in b/loader/conf/plugin.yaml.in index f878d39c..bb71ff24 100644 --- a/loader/conf/plugin.yaml.in +++ b/loader/conf/plugin.yaml.in @@ -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. --- diff --git a/register/CMakeLists.txt b/register/CMakeLists.txt index 0b349215..fc0034f3 100644 --- a/register/CMakeLists.txt +++ b/register/CMakeLists.txt @@ -1,5 +1,4 @@ - -ign_add_component(register INTERFACE) +gz_add_component(register INTERFACE) install( DIRECTORY include/ diff --git a/test/integration/CMakeLists.txt b/test/integration/CMakeLists.txt index f0d98aec..30c7a93d 100644 --- a/test/integration/CMakeLists.txt +++ b/test/integration/CMakeLists.txt @@ -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 diff --git a/test/performance/CMakeLists.txt b/test/performance/CMakeLists.txt index a218eb70..001a533c 100644 --- a/test/performance/CMakeLists.txt +++ b/test/performance/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_get_sources(tests) +gz_get_sources(tests) # plugin_specialization test causes lcov to hang # see ign-cmake issue 25 @@ -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