diff --git a/examples/use_config_ifp/CMakeLists.txt b/examples/use_config_ifp/CMakeLists.txt index b75f84e9..8e42d725 100644 --- a/examples/use_config_ifp/CMakeLists.txt +++ b/examples/use_config_ifp/CMakeLists.txt @@ -5,8 +5,18 @@ 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) +if(CONFIG_TEST MATCHES "The package was found using MODULE mode") + message(STATUS "The package was found using MODULE mode") +else() + message(SEND_ERROR "Couldn't find correct package in MODULE mode.\nign_find_package CONFIG test failed") +endif() #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) +if(CONFIG_TEST MATCHES "The package was found using CONFIG mode") + message(STATUS "The package was found using CONFIG mode") +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() \ 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 index 039cb267..caf72164 100644 --- a/examples/use_config_ifp/Findignition-find_config.cmake +++ b/examples/use_config_ifp/Findignition-find_config.cmake @@ -1 +1 @@ -message(STATUS "The package was found using MODULE mode") \ No newline at end of file +set(CONFIG_TEST "The package was found using MODULE mode") \ No newline at end of file diff --git a/examples/use_config_ifp/ignition-find_configConfig.cmake b/examples/use_config_ifp/ignition-find_configConfig.cmake index 8380e280..e9031d65 100644 --- a/examples/use_config_ifp/ignition-find_configConfig.cmake +++ b/examples/use_config_ifp/ignition-find_configConfig.cmake @@ -1 +1 @@ -message(STATUS "The package was found using CONFIG mode") \ No newline at end of file +set(CONFIG_TEST "The package was found using CONFIG mode") \ No newline at end of file