-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test to ensure builddirs from package_info is respected
- Loading branch information
Showing
4 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
tests/resources/cmake_module_path/library_with_cmake_module_dir/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
cmake_minimum_required(VERSION 3.24) | ||
project(MyApp CXX) | ||
|
||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") | ||
|
||
# Search only for "Andromeda", which has a requirement on "Orion" | ||
# And both are "MODULE" only - this forces a recursive call to `find_package` via the dependency provider | ||
find_package(Andromeda REQUIRED) | ||
|
||
# Ensure that CMake module path is a list with two values: | ||
# - the `orion-module-subfolder` is first, and the one set above (cmake-source-dir/cmake) is second | ||
list(LENGTH CMAKE_MODULE_PATH _cmake_module_path_length) | ||
if(NOT _cmake_module_path_length EQUAL 2) | ||
message(STATUS "CMAKE_MODULE_PATH DOES NOT have expected value: ${CMAKE_MODULE_PATH}") | ||
endif() | ||
|
||
list(GET CMAKE_MODULE_PATH 0 _cmake_module_path_first_element) | ||
if(NOT _cmake_module_path_first_element MATCHES "^.*orion-module-subfolder$") | ||
message(STATUS "CMAKE_MODULE_PATH DOES NOT have expected value: ${CMAKE_MODULE_PATH}") | ||
endif() | ||
|
||
if(CMAKE_MODULE_PATH STREQUAL "${_cmake_module_path_first_element};${CMAKE_SOURCE_DIR}/cmake") | ||
message(STATUS "CMAKE_MODULE_PATH has expected value: ${CMAKE_MODULE_PATH}") | ||
else() | ||
message(STATUS "CMAKE_MODULE_PATH DOES NOT have expected value: ${CMAKE_MODULE_PATH}") | ||
endif() | ||
|
8 changes: 8 additions & 0 deletions
8
tests/resources/cmake_module_path/library_with_cmake_module_dir/conanfile.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[requires] | ||
cmake-module-with-dependency/0.1 | ||
|
||
[options] | ||
cmake-module-only/*:with_builddir=True | ||
|
||
[generators] | ||
CMakeDeps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters