diff --git a/cmake/FindAVCODEC.cmake b/cmake/FindAVCODEC.cmake index b99043bb..8d0bb263 100644 --- a/cmake/FindAVCODEC.cmake +++ b/cmake/FindAVCODEC.cmake @@ -20,9 +20,9 @@ ign_pkg_check_modules_quiet(AVCODEC libavcodec) if(NOT AVCODEC_FOUND) include(IgnManualSearch) - ign_manual_search(AVCODEC - HEADER_NAMES "libavcodec/avcodec.h" - LIBRARY_NAMES "avcodec") + gz_manual_search(AVCODEC + HEADER_NAMES "libavcodec/avcodec.h" + LIBRARY_NAMES "avcodec") endif() include(FindPackageHandleStandardArgs) diff --git a/cmake/FindAVDEVICE.cmake b/cmake/FindAVDEVICE.cmake index c681bf2b..a731b13c 100644 --- a/cmake/FindAVDEVICE.cmake +++ b/cmake/FindAVDEVICE.cmake @@ -24,9 +24,9 @@ ign_pkg_check_modules_quiet(AVDEVICE "libavdevice >= ${av_major}.${av_minor}.${a if(NOT AVDEVICE_FOUND) include(IgnManualSearch) - ign_manual_search(AVDEVICE - HEADER_NAMES "libavdevice/avdevice.h" - LIBRARY_NAMES "avdevice") + gz_manual_search(AVDEVICE + HEADER_NAMES "libavdevice/avdevice.h" + LIBRARY_NAMES "avdevice") # Version check if(AVDEVICE_FOUND) diff --git a/cmake/FindAVFORMAT.cmake b/cmake/FindAVFORMAT.cmake index 5f253873..241d9ad7 100644 --- a/cmake/FindAVFORMAT.cmake +++ b/cmake/FindAVFORMAT.cmake @@ -20,9 +20,9 @@ ign_pkg_check_modules_quiet(AVFORMAT libavformat) if(NOT AVFORMAT_FOUND) include(IgnManualSearch) - ign_manual_search(AVFORMAT - HEADER_NAMES "libavformat/avformat.h" - LIBRARY_NAMES "avformat") + gz_manual_search(AVFORMAT + HEADER_NAMES "libavformat/avformat.h" + LIBRARY_NAMES "avformat") endif() include(FindPackageHandleStandardArgs) diff --git a/cmake/FindAVUTIL.cmake b/cmake/FindAVUTIL.cmake index 0bf8e6a5..57d2128d 100644 --- a/cmake/FindAVUTIL.cmake +++ b/cmake/FindAVUTIL.cmake @@ -20,9 +20,9 @@ ign_pkg_check_modules_quiet(AVUTIL libavutil) if(NOT AVUTIL_FOUND) include(IgnManualSearch) - ign_manual_search(AVUTIL - HEADER_NAMES "libavutil/avutil.h" - LIBRARY_NAMES "avutil") + gz_manual_search(AVUTIL + HEADER_NAMES "libavutil/avutil.h" + LIBRARY_NAMES "avutil") endif() include(FindPackageHandleStandardArgs) diff --git a/cmake/FindSWSCALE.cmake b/cmake/FindSWSCALE.cmake index dcb36a9e..226c6f90 100644 --- a/cmake/FindSWSCALE.cmake +++ b/cmake/FindSWSCALE.cmake @@ -20,9 +20,9 @@ ign_pkg_check_modules_quiet(SWSCALE libswscale) if(NOT SWSCALE_FOUND) include(IgnManualSearch) - ign_manual_search(SWSCALE - HEADER_NAMES "libswscale/swscale.h" - LIBRARY_NAMES "swscale") + gz_manual_search(SWSCALE + HEADER_NAMES "libswscale/swscale.h" + LIBRARY_NAMES "swscale") endif() include(FindPackageHandleStandardArgs) diff --git a/cmake/FindUUID.cmake b/cmake/FindUUID.cmake index e28ccfbb..254413ab 100644 --- a/cmake/FindUUID.cmake +++ b/cmake/FindUUID.cmake @@ -22,10 +22,10 @@ if (UNIX) if(NOT UUID_FOUND) include(IgnManualSearch) - ign_manual_search(UUID - HEADER_NAMES "uuid.h" - LIBRARY_NAMES "uuid libuuid" - PATH_SUFFIXES "uuid") + gz_manual_search(UUID + HEADER_NAMES "uuid.h" + LIBRARY_NAMES "uuid libuuid" + PATH_SUFFIXES "uuid") endif() # The pkg-config or the manual search will place diff --git a/cmake/IgnManualSearch.cmake b/cmake/IgnManualSearch.cmake index 787909a8..363ee3e7 100644 --- a/cmake/IgnManualSearch.cmake +++ b/cmake/IgnManualSearch.cmake @@ -14,7 +14,7 @@ # limitations under the License. # ######################################## -# ign_manual_search( [INTERFACE] +# gz_manual_search( [INTERFACE] # [HEADER_NAMES ] # [LIBRARY_NAMES ] # [TARGET_NAME ] @@ -42,17 +42,32 @@ # PATH_SUFFIXES: Optional. Parameter forwarded to the find_path and find_library calls. # macro(ign_manual_search package) + # TODO(chapulina) Enable warnings after all libraries have migrated. + # message(WARNING "ign_manual_search is deprecated, use gz_manual_search instead.") - #------------------------------------ - # Define the expected arguments set(options INTERFACE) set(oneValueArgs "TARGET_NAME") set(multiValueArgs "HEADER_NAMES" "LIBRARY_NAMES" "PATH_SUFFIXES") - - #------------------------------------ - # Parse the arguments _gz_cmake_parse_arguments(gz_manual_search "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + set(gz_manual_search_skip_parsing true) + gz_manual_search(${PACKAGE_NAME}) +endmacro() +macro(gz_manual_search PACKAGE_NAME) + + # Deprecated, remove skip parsing logic in version 4 + if (NOT gz_manual_search_skip_parsing) + #------------------------------------ + # Define the expected arguments + set(options INTERFACE) + set(oneValueArgs "TARGET_NAME") + set(multiValueArgs "HEADER_NAMES" "LIBRARY_NAMES" "PATH_SUFFIXES") + + #------------------------------------ + # Parse the arguments + _gz_cmake_parse_arguments(gz_manual_search "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + endif() + if(gz_manual_search_INTERFACE) set(_gz_manual_search_interface_option INTERFACE) else() diff --git a/cmake/IgnPackaging.cmake b/cmake/IgnPackaging.cmake index ed06a4ce..2fad5d1d 100644 --- a/cmake/IgnPackaging.cmake +++ b/cmake/IgnPackaging.cmake @@ -7,7 +7,7 @@ # Sets up package information for an ignition library project. # This function is internal to gz-cmake. # -# gz_create_package +# gz_create_packages # # Creates a package for an ignition library project # diff --git a/cmake/IgnUtils.cmake b/cmake/IgnUtils.cmake index 59834fda..82b7903e 100644 --- a/cmake/IgnUtils.cmake +++ b/cmake/IgnUtils.cmake @@ -522,7 +522,7 @@ endmacro() # current subdirectory if "src/" does not exist. They will be collated into # library source files and unittest source files . # -# These output variables can be consumed directly by ign_create_core_library(~), +# These output variables can be consumed directly by gz_create_core_library(~), # ign_add_component(~), gz_build_tests(~), and ign_build_executables(~). function(ign_get_libsources_and_unittests lib_sources_var tests_var) # TODO(chapulina) Enable warnings after all libraries have migrated. @@ -851,7 +851,7 @@ endfunction() # # ) # -# Handles the C++ standard argument for ign_create_core_library(~) and +# Handles the C++ standard argument for gz_create_core_library(~) and # ign_add_component(~). # # NOTE: This is only meant for internal ign-cmake use. @@ -897,7 +897,7 @@ macro(_gz_handle_cxx_standard prefix target pkgconfig_cflags) endmacro() ################################################# -# ign_create_core_library(SOURCES +# gz_create_core_library(SOURCES # [CXX_STANDARD <11|14|17>] # [PRIVATE_CXX_STANDARD <11|14|17>] # [INTERFACE_CXX_STANDARD <11|14|17>] @@ -941,21 +941,40 @@ endmacro() # are not allowed to use either of them if you use the CXX_STANDARD argument. # function(ign_create_core_library) + # TODO(chapulina) Enable warnings after all libraries have migrated. + # message(WARNING "ign_create_core_library is deprecated, use gz_create_core_library instead.") - #------------------------------------ - # Define the expected arguments set(options INTERFACE) set(oneValueArgs INCLUDE_SUBDIR LEGACY_PROJECT_PREFIX CXX_STANDARD PRIVATE_CXX_STANDARD INTERFACE_CXX_STANDARD GET_TARGET_NAME) set(multiValueArgs SOURCES) - - #------------------------------------ - # Parse the arguments cmake_parse_arguments(gz_create_core_library "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + set(gz_create_core_library_skip_parsing true) + gz_create_core_library() + + if(gz_create_core_library_GET_TARGET_NAME) + set(${gz_create_core_library_GET_TARGET_NAME} ${${gz_create_core_library_GET_TARGET_NAME}} PARENT_SCOPE) + endif() +endfunction() +function(gz_create_core_library) + + # Deprecated, remove skip parsing logic in version 4 + if (NOT gz_create_core_library_skip_parsing) + #------------------------------------ + # Define the expected arguments + set(options INTERFACE) + set(oneValueArgs INCLUDE_SUBDIR LEGACY_PROJECT_PREFIX CXX_STANDARD PRIVATE_CXX_STANDARD INTERFACE_CXX_STANDARD GET_TARGET_NAME) + set(multiValueArgs SOURCES) + + #------------------------------------ + # Parse the arguments + cmake_parse_arguments(gz_create_core_library "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + endif() + if(gz_create_core_library_SOURCES) set(sources ${gz_create_core_library_SOURCES}) elseif(NOT gz_create_core_library_INTERFACE) - message(FATAL_ERROR "You must specify SOURCES for ign_create_core_library(~)!") + message(FATAL_ERROR "You must specify SOURCES for gz_create_core_library(~)!") endif() if(gz_create_core_library_INTERFACE) @@ -1096,7 +1115,7 @@ endfunction() # with the core library), but the component itself does not need to link to # the core library. # -# See the documentation of ign_create_core_library(~) for more information about +# See the documentation of gz_create_core_library(~) for more information about # specifying the C++ standard. If your component publicly depends on the core # library, then you probably do not need to specify the standard, because it # will get inherited from the core library. @@ -1342,7 +1361,7 @@ endmacro() ################################################# # This is only meant for internal use by ignition-cmake. If you are a consumer -# of ignition-cmake, please use ign_create_core_library(~) or +# of ignition-cmake, please use gz_create_core_library(~) or # ign_add_component(~) instead of this. # # _gz_add_library_or_component(LIB_NAME diff --git a/examples/comp_deps/src/CMakeLists.txt b/examples/comp_deps/src/CMakeLists.txt index 2f1060a2..91984fdf 100644 --- a/examples/comp_deps/src/CMakeLists.txt +++ b/examples/comp_deps/src/CMakeLists.txt @@ -1,3 +1,3 @@ gz_get_libsources_and_unittests(sources gtest_sources) -ign_create_core_library(SOURCES ${sources}) +gz_create_core_library(SOURCES ${sources}) diff --git a/examples/core_child/src/CMakeLists.txt b/examples/core_child/src/CMakeLists.txt index e08a4323..3ad5f65f 100644 --- a/examples/core_child/src/CMakeLists.txt +++ b/examples/core_child/src/CMakeLists.txt @@ -1,5 +1,5 @@ gz_get_libsources_and_unittests(sources gtest_sources) -ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11) +gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11) target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} PUBLIC ignition-core_no_deps::ignition-core_no_deps) diff --git a/examples/core_child_private/src/CMakeLists.txt b/examples/core_child_private/src/CMakeLists.txt index 07e40d4d..ba4b1db4 100644 --- a/examples/core_child_private/src/CMakeLists.txt +++ b/examples/core_child_private/src/CMakeLists.txt @@ -1,5 +1,5 @@ gz_get_libsources_and_unittests(sources gtest_sources) -ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11) +gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11) target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE ignition-core_no_deps::ignition-core_no_deps) diff --git a/examples/core_nodep/src/CMakeLists.txt b/examples/core_nodep/src/CMakeLists.txt index 6724df79..2469d5fb 100644 --- a/examples/core_nodep/src/CMakeLists.txt +++ b/examples/core_nodep/src/CMakeLists.txt @@ -1,3 +1,3 @@ gz_get_libsources_and_unittests(sources gtest_sources) -ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11) +gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11) gz_build_tests(TYPE UNIT SOURCES ${gtest_sources}) diff --git a/examples/core_nodep_static/src/CMakeLists.txt b/examples/core_nodep_static/src/CMakeLists.txt index 6724df79..2469d5fb 100644 --- a/examples/core_nodep_static/src/CMakeLists.txt +++ b/examples/core_nodep_static/src/CMakeLists.txt @@ -1,3 +1,3 @@ gz_get_libsources_and_unittests(sources gtest_sources) -ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11) +gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11) gz_build_tests(TYPE UNIT SOURCES ${gtest_sources}) diff --git a/examples/core_static_child/src/CMakeLists.txt b/examples/core_static_child/src/CMakeLists.txt index dd8bcdf4..66b64fa8 100644 --- a/examples/core_static_child/src/CMakeLists.txt +++ b/examples/core_static_child/src/CMakeLists.txt @@ -1,5 +1,5 @@ gz_get_libsources_and_unittests(sources gtest_sources) -ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11) +gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11) target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} PUBLIC ignition-core_no_deps_static::ignition-core_no_deps_static) diff --git a/examples/no_ignition_prefix/src/CMakeLists.txt b/examples/no_ignition_prefix/src/CMakeLists.txt index 6724df79..2469d5fb 100644 --- a/examples/no_ignition_prefix/src/CMakeLists.txt +++ b/examples/no_ignition_prefix/src/CMakeLists.txt @@ -1,3 +1,3 @@ gz_get_libsources_and_unittests(sources gtest_sources) -ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11) +gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11) gz_build_tests(TYPE UNIT SOURCES ${gtest_sources}) diff --git a/examples/prerelease/src/CMakeLists.txt b/examples/prerelease/src/CMakeLists.txt index 0e040889..abbf74b3 100644 --- a/examples/prerelease/src/CMakeLists.txt +++ b/examples/prerelease/src/CMakeLists.txt @@ -1,3 +1,3 @@ -ign_create_core_library(INTERFACE) +gz_create_core_library(INTERFACE) diff --git a/examples/use_component_depsA/src/CMakeLists.txt b/examples/use_component_depsA/src/CMakeLists.txt index f27b9277..a474aa52 100644 --- a/examples/use_component_depsA/src/CMakeLists.txt +++ b/examples/use_component_depsA/src/CMakeLists.txt @@ -1,5 +1,5 @@ gz_get_libsources_and_unittests(sources gtest_sources) -ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11) +gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11) target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} PUBLIC ignition-component_deps::ignition-component_deps-child) diff --git a/examples/use_component_depsB/src/CMakeLists.txt b/examples/use_component_depsB/src/CMakeLists.txt index f27b9277..a474aa52 100644 --- a/examples/use_component_depsB/src/CMakeLists.txt +++ b/examples/use_component_depsB/src/CMakeLists.txt @@ -1,5 +1,5 @@ gz_get_libsources_and_unittests(sources gtest_sources) -ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11) +gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11) target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} PUBLIC ignition-component_deps::ignition-component_deps-child) diff --git a/examples/use_component_depsC/src/CMakeLists.txt b/examples/use_component_depsC/src/CMakeLists.txt index f27b9277..a474aa52 100644 --- a/examples/use_component_depsC/src/CMakeLists.txt +++ b/examples/use_component_depsC/src/CMakeLists.txt @@ -1,5 +1,5 @@ gz_get_libsources_and_unittests(sources gtest_sources) -ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11) +gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11) target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} PUBLIC ignition-component_deps::ignition-component_deps-child)