Skip to content

Commit

Permalink
Deprecate ign_create_docs, ign_create_packages, ign_configure_build (#…
Browse files Browse the repository at this point in the history
…253)

Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina authored May 11, 2022
1 parent 15b14f2 commit a99c66d
Show file tree
Hide file tree
Showing 19 changed files with 89 additions and 52 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ _gz_setup_target_for_codecheck()
set(IGNITION_CMAKE_DOXYGEN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen")
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"
)
2 changes: 2 additions & 0 deletions Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ release will remove the deprecated code.
**Replacement**: include/ignition/utils/SuppressWarning.hh
1. **Deprecated**: include/ignition/utilities/ExtraTestMacros.hh
**Replacement**: include/ignition/utils/ExtraTestMacros.hh
1. **Deprecated**: CMake functions and macros starting with `ign_`
**Replacement**: CMake functions and macros starting with `gz_`
22 changes: 18 additions & 4 deletions cmake/IgnConfigureBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# IgnBuildProject
# -------------------
#
# ign_configure_build()
# gz_configure_build()
#
# Configures the build rules of an ignition library project.
#
Expand All @@ -28,14 +28,28 @@
# Pass the argument QUIT_IF_BUILD_ERRORS to have this macro quit cmake when the
# build_errors
macro(ign_configure_build)

#============================================================================
# Parse the arguments that are passed in
# TODO(chapulina) Enable warnings after all libraries have migrated.
# message(WARNING "ign_configure_build is deprecated, use gz_configure_build instead.")
set(options HIDE_SYMBOLS_BY_DEFAULT QUIT_IF_BUILD_ERRORS)
set(oneValueArgs)
set(multiValueArgs COMPONENTS)
cmake_parse_arguments(gz_configure_build "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

set(gz_configure_build_skip_parsing true)
gz_configure_build()
endmacro()
macro(gz_configure_build)

# Deprecated, remove skip parsing logic in version 4
if (NOT gz_configure_build_skip_parsing)
#============================================================================
# Parse the arguments that are passed in
set(options HIDE_SYMBOLS_BY_DEFAULT QUIT_IF_BUILD_ERRORS)
set(oneValueArgs)
set(multiValueArgs COMPONENTS)
cmake_parse_arguments(gz_configure_build "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
endif()

#============================================================================
# Examine the build type. If we do not recognize the type, we will generate
# an error, so this must come before the error handling.
Expand Down
29 changes: 22 additions & 7 deletions cmake/IgnCreateDocs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# IgnCreatePackage
# ----------------
#
# ign_create_docs
# gz_create_docs
#
# Creates documentation for an ignition library project.
#
Expand All @@ -22,7 +22,7 @@
# limitations under the License.

#################################################
# ign_create_docs(
# gz_create_docs(
# [API_MAINPAGE_MD <api_markdown_mainpage>]
# [AUTOGENERATED_DOC <generated doc dir>]
# [TUTORIALS_MAINPAGE_MD <tutorials_markdown_mainpage>]
Expand All @@ -41,22 +41,37 @@
# TAGFILES: Optional. Specify tagfiles for doxygen to use. It should be a list of strings like:
# "${IGNITION-<DESIGNATION>_DOXYGEN_TAGFILE} = ${IGNITION-<DESIGNATION>_API_URL}"
function(ign_create_docs)
# TODO(chapulina) Enable warnings after all libraries have migrated.
# message(WARNING "ign_create_docs is deprecated, use gz_create_docs instead.")

#------------------------------------
# Define the expected arguments
set(options)
set(oneValueArgs API_MAINPAGE_MD AUTOGENERATED_DOC TUTORIALS_MAINPAGE_MD)
set(multiValueArgs "TAGFILES" "ADDITIONAL_INPUT_DIRS" "IMAGE_PATH_DIRS")
_gz_cmake_parse_arguments(gz_create_docs "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

set(gz_create_docs_skip_parsing true)
gz_create_docs()
endfunction()
function(gz_create_docs)

option(BUILD_DOCS "Build docs" ON)
if (NOT ${BUILD_DOCS})
message(STATUS "Building Documentation disabled via BUILD_DOCS=OFF")
return()
endif()

#------------------------------------
# Parse the arguments
_gz_cmake_parse_arguments(gz_create_docs "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
# Deprecated, remove skip parsing logic in version 4
if (NOT gz_create_docs_skip_parsing)
#------------------------------------
# Define the expected arguments
set(options)
set(oneValueArgs API_MAINPAGE_MD AUTOGENERATED_DOC TUTORIALS_MAINPAGE_MD)
set(multiValueArgs "TAGFILES" "ADDITIONAL_INPUT_DIRS" "IMAGE_PATH_DIRS")

#------------------------------------
# Parse the arguments
_gz_cmake_parse_arguments(gz_create_docs "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
endif()

set(required_html_files
"doxygen/html/annotated.html"
Expand Down
16 changes: 11 additions & 5 deletions cmake/IgnPackaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Sets up package information for an ignition library project.
# This function is internal to gz-cmake.
#
# ign_create_package
# gz_create_package
#
# Creates a package for an ignition library project
#
Expand Down Expand Up @@ -148,6 +148,12 @@ macro(_gz_setup_packages)
endmacro()

macro(ign_create_packages)
# TODO(chapulina) Enable warnings after all libraries have migrated.
# message(WARNING "ign_create_packages is deprecated, use gz_create_packages instead.")

gz_create_packages()
endmacro()
macro(gz_create_packages)

#============================================================================
# Load platform-specific build hooks if present.
Expand All @@ -168,8 +174,8 @@ endmacro()
# If the target is a component, pass in the COMPONENT argument followed by the
# component's name.
#
# NOTE: This will be called automatically by ign_create_core_library(~) and
# ign_add_component(~), so users of ignition-cmake should not call this
# NOTE: This will be called automatically by gz_create_core_library(~) and
# gz_add_component(~), so users of ignition-cmake should not call this
# function.
#
# NOTE: For ignition-cmake developers, the variables needed by ignition.pc.in or
Expand Down Expand Up @@ -228,8 +234,8 @@ endfunction()
# variable names (like SDFormat_LIBRARIES), the LEGACY_PROJECT_PREFIX argument
# can be used to specify the prefix of these variables.
#
# NOTE: This will be called automatically by ign_create_core_library(~) and
# ign_add_component(~), so users of ignition-cmake should not call this
# NOTE: This will be called automatically by gz_create_core_library(~) and
# gz_add_component(~), so users of ignition-cmake should not call this
# function.
#
# NOTE: For ignition-cmake developers, some of the variables needed by
Expand Down
6 changes: 3 additions & 3 deletions examples/comp_deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-component_deps VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_configure_build(QUIT_IF_BUILD_ERRORS
gz_configure_build(QUIT_IF_BUILD_ERRORS
COMPONENTS child parent)
ign_create_packages()
ign_create_docs()
gz_create_packages()
gz_create_docs()
6 changes: 3 additions & 3 deletions examples/core_child/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ project(ignition-core_child VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_find_package(ignition-core_no_deps REQUIRED)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
ign_create_docs(TAGFILES "${IGNITION-CORE_NO_DEPS_DOXYGEN_TAGFILE} = ${IGNITION-CORE_NO_DEPS_API_URL}")
gz_configure_build(QUIT_IF_BUILD_ERRORS)
gz_create_packages()
gz_create_docs(TAGFILES "${IGNITION-CORE_NO_DEPS_DOXYGEN_TAGFILE} = ${IGNITION-CORE_NO_DEPS_API_URL}")
6 changes: 3 additions & 3 deletions examples/core_child_private/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ project(ignition-core_child_private VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_find_package(ignition-core_no_deps PRIVATE REQUIRED)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
ign_create_docs(TAGFILES "${IGNITION-CORE_NO_DEPS_DOXYGEN_TAGFILE} = ${IGNITION-CORE_NO_DEPS_API_URL}")
gz_configure_build(QUIT_IF_BUILD_ERRORS)
gz_create_packages()
gz_create_docs(TAGFILES "${IGNITION-CORE_NO_DEPS_DOXYGEN_TAGFILE} = ${IGNITION-CORE_NO_DEPS_API_URL}")
6 changes: 3 additions & 3 deletions examples/core_nodep/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-core_no_deps VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
ign_create_docs()
gz_configure_build(QUIT_IF_BUILD_ERRORS)
gz_create_packages()
gz_create_docs()
6 changes: 3 additions & 3 deletions examples/core_nodep_static/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ project(ignition-core_no_deps_static VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
OPTION(BUILD_SHARED_LIBS OFF)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
ign_create_docs()
gz_configure_build(QUIT_IF_BUILD_ERRORS)
gz_create_packages()
gz_create_docs()
6 changes: 3 additions & 3 deletions examples/core_static_child/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ project(ignition-core_static_child VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_find_package(ignition-core_no_deps_static REQUIRED)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
ign_create_docs(TAGFILES "${IGNITION-CORE_NO_DEPS_STATIC_DOXYGEN_TAGFILE} = ${IGNITION-CORE_NO_DEPS_STATIC_API_URL}")
gz_configure_build(QUIT_IF_BUILD_ERRORS)
gz_create_packages()
gz_create_docs(TAGFILES "${IGNITION-CORE_NO_DEPS_STATIC_DOXYGEN_TAGFILE} = ${IGNITION-CORE_NO_DEPS_STATIC_API_URL}")
2 changes: 1 addition & 1 deletion examples/ign_conf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-minimal0 VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_configure_build(QUIT_IF_BUILD_ERRORS)
gz_configure_build(QUIT_IF_BUILD_ERRORS)
6 changes: 3 additions & 3 deletions examples/no_ignition_prefix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ find_package(ignition-cmake3 REQUIRED)
ign_configure_project(
NO_IGNITION_PREFIX
REPLACE_IGNITION_INCLUDE_PATH no_ign)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
ign_create_docs()
gz_configure_build(QUIT_IF_BUILD_ERRORS)
gz_create_packages()
gz_create_docs()
2 changes: 1 addition & 1 deletion examples/prerelease/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-minimal1 VERSION 1.0.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project(VERSION_SUFFIX pre1)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
gz_configure_build(QUIT_IF_BUILD_ERRORS)
2 changes: 1 addition & 1 deletion examples/sanitizers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-sanitizers VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_configure_build(QUIT_IF_BUILD_ERRORS)
gz_configure_build(QUIT_IF_BUILD_ERRORS)
6 changes: 3 additions & 3 deletions examples/use_component_depsA/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ project(ignition-use_component_depsA VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_find_package(ignition-component_deps REQUIRED COMPONENTS parent child)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
ign_create_docs()
gz_configure_build(QUIT_IF_BUILD_ERRORS)
gz_create_packages()
gz_create_docs()
6 changes: 3 additions & 3 deletions examples/use_component_depsB/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ project(ignition-use_component_depsB VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_find_package(ignition-component_deps REQUIRED COMPONENTS child parent)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
ign_create_docs()
gz_configure_build(QUIT_IF_BUILD_ERRORS)
gz_create_packages()
gz_create_docs()
6 changes: 3 additions & 3 deletions examples/use_component_depsC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ project(ignition-use_component_depsC VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_find_package(ignition-component_deps REQUIRED COMPONENTS child)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
ign_create_docs()
gz_configure_build(QUIT_IF_BUILD_ERRORS)
gz_create_packages()
gz_create_docs()
4 changes: 2 additions & 2 deletions examples/use_config_ifp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ else()
message(SEND_ERROR "Couldn't find correct package in CONFIG mode.\nign_find_package CONFIG test failed")
endif()
ign_configure_project()
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
gz_configure_build(QUIT_IF_BUILD_ERRORS)
gz_create_packages()

0 comments on commit a99c66d

Please sign in to comment.