diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 4bbe2244..90abd1ac 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -18,6 +18,7 @@ set(example_directories core_child_private core_static_child comp_deps + use_config_ifp ) if (NOT CMAKE_GENERATOR MATCHES "Visual Studio") list(APPEND example_directories @@ -58,6 +59,9 @@ foreach(example ${example_directories}) set(example_tarball_name ignition-use_component_depsb-0.1.0.tar.bz2) elseif (${example} STREQUAL "use_component_depsC") set(example_tarball_name ignition-use_component_depsc-0.1.0.tar.bz2) + elseif (${example} STREQUAL "use_config_ifp") + set(example_tarball_name ignition-find_config-0.1.0.tar.bz2) + else() set(example_tarball_name) endif() diff --git a/examples/use_config_ifp/CMakeLists.txt b/examples/use_config_ifp/CMakeLists.txt new file mode 100644 index 00000000..b75f84e9 --- /dev/null +++ b/examples/use_config_ifp/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) +project(ignition-find_config VERSION 0.1.0) +find_package(ignition-cmake2 REQUIRED) +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/") +set(ignition-find_config_DIR "${CMAKE_SOURCE_DIR}/") +#ign_find_package(ignition-find_config) will search for Findignition-find_config.cmake before ignition-find_configConfig.cmake +ign_find_package(ignition-find_config) +#After CONFIG arguemnt ign_find_package will skip MODULE mode and search for ignition-find_configConfig.cmake directly +ign_find_package(ignition-find_config CONFIG) +ign_configure_project() +ign_configure_build(QUIT_IF_BUILD_ERRORS) +ign_create_packages() \ No newline at end of file diff --git a/examples/use_config_ifp/Findignition-find_config.cmake b/examples/use_config_ifp/Findignition-find_config.cmake new file mode 100644 index 00000000..039cb267 --- /dev/null +++ b/examples/use_config_ifp/Findignition-find_config.cmake @@ -0,0 +1 @@ +message(STATUS "The package was found using MODULE mode") \ No newline at end of file diff --git a/examples/use_config_ifp/README.md b/examples/use_config_ifp/README.md new file mode 100644 index 00000000..e69de29b diff --git a/examples/use_config_ifp/ignition-find_configConfig.cmake b/examples/use_config_ifp/ignition-find_configConfig.cmake new file mode 100644 index 00000000..8380e280 --- /dev/null +++ b/examples/use_config_ifp/ignition-find_configConfig.cmake @@ -0,0 +1 @@ +message(STATUS "The package was found using CONFIG mode") \ No newline at end of file diff --git a/examples/use_config_ifp/src/CMakeLists.txt b/examples/use_config_ifp/src/CMakeLists.txt new file mode 100644 index 00000000..e69de29b