Co-authored-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.tech> Reviewed-on: https://git.avroid.tech/Conan/conan_build/pulls/15
23 lines
664 B
CMake
23 lines
664 B
CMake
cmake_minimum_required(VERSION 3.10)
|
|
project(test_package LANGUAGES C)
|
|
|
|
find_package(EXPAT REQUIRED MODULE)
|
|
|
|
add_executable(${PROJECT_NAME} ../test_package/test_package.c)
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE EXPAT::EXPAT)
|
|
|
|
# Test whether variables from https://cmake.org/cmake/help/latest/module/FindEXPAT.html
|
|
# are properly defined in conan generators
|
|
set(_custom_vars
|
|
EXPAT_INCLUDE_DIRS
|
|
EXPAT_LIBRARIES
|
|
EXPAT_FOUND
|
|
)
|
|
foreach(_custom_var ${_custom_vars})
|
|
if(DEFINED ${_custom_var})
|
|
message(STATUS "${_custom_var}: ${${_custom_var}}")
|
|
else()
|
|
message(FATAL_ERROR "${_custom_var} not defined")
|
|
endif()
|
|
endforeach()
|