diff --git a/CMakeLists.txt b/CMakeLists.txt index 24d9b711..7e76b3e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1112,7 +1112,7 @@ set(EVENT__INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include") set(LIBEVENT_INCLUDE_DIRS ${EVENT__INCLUDE_DIRS} CACHE PATH "Libevent include directories") -configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfig.cmake.in +configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfigBuildTree.cmake.in ${PROJECT_BINARY_DIR}/LibeventConfig.cmake @ONLY) diff --git a/cmake/LibeventConfigBuildTree.cmake.in b/cmake/LibeventConfigBuildTree.cmake.in new file mode 100644 index 00000000..02edef32 --- /dev/null +++ b/cmake/LibeventConfigBuildTree.cmake.in @@ -0,0 +1,17 @@ +# - Config file for the Libevent package +# It defines the following variables +# LIBEVENT_INCLUDE_DIRS - include directories for FooBar +# LIBEVENT_LIBRARIES - libraries to link against + +# Get the path of the current file. +get_filename_component(LIBEVENT_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + +# Set the include directories. +set(LIBEVENT_INCLUDE_DIRS "@EVENT__INCLUDE_DIRS@") + +# Include the project Targets file, this contains definitions for IMPORTED targets. +include(${LIBEVENT_CMAKE_DIR}/LibeventTargets.cmake) + +# IMPORTED targets from LibeventTargets.cmake +set(LIBEVENT_LIBRARIES event event_core event_extra) +