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

include could not find requested file: tl-expected-targets.cmake #115

Open
Petross404 opened this issue Aug 21, 2022 · 0 comments
Open

include could not find requested file: tl-expected-targets.cmake #115

Petross404 opened this issue Aug 21, 2022 · 0 comments

Comments

@Petross404
Copy link

Hi,

I am using FetchContent to use expected as an external dependency like this:

include(FetchContent)

FetchContent_Declare(tl-expected
                    GIT_REPOSITORY https://github.com/TartanLlama/expected.git
)

FetchContent_GetProperties(tl-expected)
if(NOT "${tl-expected_POPULATED}")
	FetchContent_Populate(tl-expected)
	add_subdirectory(${tl-expected_SOURCE_DIR} ${tl-expected_BINARY_DIR})
endif()

set(tl-expected_DIR "${CMAKE_BINARY_DIR}/_deps/tl-expected-build/")

find_package(tl-expected CONFIG REQUIRED)

But when configuring I get this error:

/mnt/Volume_3/Gentoo/projects/Cplus/SymbolFinder/build> make -j8
CMake Error at build/_deps/tl-expected-build/tl-expected-config.cmake:27 (include):
  include could not find requested file:

    /mnt/Volume_3/Gentoo/projects/Cplus/SymbolFinder/build/_deps/tl-expected-build/tl-expected-targets.cmake
Call Stack (most recent call first):
  cmake/Modules/Tl-expected.cmake:16 (find_package)
  CMakeLists.txt:31 (handle_tl_expected)

The problematic cmake file is this:

####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
####### Any changes to this file will be overwritten by the next CMake run ####
####### The input file was tl-expected-config.cmake.in                            ########

get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)

macro(set_and_check _var _file)
  set(${_var} "${_file}")
  if(NOT EXISTS "${_file}")
    message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
  endif()
endmacro()

macro(check_required_components _NAME)
  foreach(comp ${${_NAME}_FIND_COMPONENTS})
    if(NOT ${_NAME}_${comp}_FOUND)
      if(${_NAME}_FIND_REQUIRED_${comp})
        set(${_NAME}_FOUND FALSE)
      endif()
    endif()
  endforeach()
endmacro()

####################################################################################

include("${CMAKE_CURRENT_LIST_DIR}/tl-expected-targets.cmake") #<- This isn't found.

When I try to grep in the "${CMAKE_BINARY_DIR}", I can't find any relevant file. Where can I search for this file?

Thank you for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant