CMakeLists.txt:
cmake_minimum_required(VERSION 3.3)
project(CMakeTest)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(event-cmake REQUIRED)
file(GLOB SOURCES "*.cpp" )
add_executable(test ${SOURCES})
cmake/Findevent-cmake.cmake:
ExternalProject_Add(event-cmake
GIT_REPOSITORY https://github.com/libevent/libevent.git
UPDATE_COMMAND ""
INSTALL_COMMAND ""
)
I know that the CMakeLists here has no chance to include the resolved package, but I cannot even get CMake to download the external repo. It errors out with:
CMake Error at cmake/Findevent-cmake.cmake:3 (ExternalProject_Add):
Unknown CMake command "ExternalProject_Add".
Call Stack (most recent call first):
CMakeLists.txt:4 (find_package)
Is there a way to make it so that cmake will download the project and link to it?