<div dir="ltr"><div>Hi,</div><div><br></div>I have a SuperBuild where I am adding dependencies using ExternalProject_Add. I am also using the same mechanism to add my projects (which are subprojects).<div><br></div><div>The dependencies are being cloned into a directory in the root of the project called "Dep" and installed in the "Install" directory, also in root.</div><div><br><div>All the dependencies have their own CMakeLists.txt and when installed, generate their respective xxxConfig.cmake and xxxTargets.cmake (among a few other files generated by CMake). </div><div><br></div><div>I am using:</div><div><br></div><div>find_package(dep_name HINTS "path_to_install_folder")</div><div><br></div><div>and my assumption/hope was that find_package will find the autogenerated files and since the dependencies are built and installed through CMake, the include and library directories and the library names will be picked up automatically.</div><div><br></div><div>Now find_package 'is' able to find the dependencies i.e. if I am trying to find SDL2, it is able to do so and SDL2_FOUND is set. However, nothing else is picked up by find_package, including the include directories, library directories nor the name of the library (e.g. in SDL's case, it is called libSDL2.so).</div><div><br></div><div>I am also not sure which variables are set by find_package. For example, if the SDL2 library is found by find_package, what do I pass to target_include_directories and target_link_libraries? My first thought was to use "message(STATUS variable_set_by_find_package)" but I don't know what the variables are called.</div><div><div><br></div></div></div><div>Here's the project folder structure in case it helps visualize everything:</div><div><br></div><div>- CMakeLists.txt (root level, superbuild that adds all deps and subprojs)</div><div>- Dep/ (folder where dependencies are cloned)</div><div>- Install/ (folder where dependencies are installed)</div><div>-- SubProject1/CMakeLists.txt (subproject1 dependent on above deps)</div><div>-- SubProject2/CMakeLists.txt (subproject2 dependent on above deps)</div><div><br></div><div>Here's the auto-generated files by one of the dependencies, SDL2 (all dependencies generate similar files which are put in one of the nested directores inside the root "Install" directory):</div><div><br></div><div>- SDL2Config.cmake</div><div>- SDL2ConfigVersion.cmake</div><div>- SDL2Targets.cmake</div><div>- SDL2Targets-noconfig.cmake</div><div><br></div><div>Hopefully I have explained the issue properly.</div><div><br></div><div>Thanks,</div><div>Saad</div></div>