Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving CONFIG test #235

Merged
merged 2 commits into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions examples/use_config_ifp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion examples/use_config_ifp/Findignition-find_config.cmake
Original file line number Diff line number Diff line change
@@ -1 +1 @@
message(STATUS "The package was found using MODULE mode")
set(CONFIG_TEST "The package was found using MODULE mode")
2 changes: 1 addition & 1 deletion examples/use_config_ifp/ignition-find_configConfig.cmake
Original file line number Diff line number Diff line change
@@ -1 +1 @@
message(STATUS "The package was found using CONFIG mode")
set(CONFIG_TEST "The package was found using CONFIG mode")