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

Adding tests for CONFIG argument #230

Merged
merged 5 commits into from
Apr 12, 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
4 changes: 4 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
12 changes: 12 additions & 0 deletions examples/use_config_ifp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
1 change: 1 addition & 0 deletions examples/use_config_ifp/Findignition-find_config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
message(STATUS "The package was found using MODULE mode")
Empty file.
1 change: 1 addition & 0 deletions examples/use_config_ifp/ignition-find_configConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
message(STATUS "The package was found using CONFIG mode")
Empty file.