diff options
author | Jonathan Ringer <jonringer117@gmail.com> | 2021-11-08 06:47:25 -0800 |
---|---|---|
committer | Azat Khuzhin <azat@libevent.org> | 2023-05-14 22:43:47 +0200 |
commit | be03bf385b0dccec189af71af71e0af0b402ebdb (patch) | |
tree | 46d442699cd133306b81668122bb10b773c14e57 /CMakeLists.txt | |
parent | 1f1593ff27bdf51c3e1c45b92cfb0ac931960298 (diff) | |
download | libevent-be03bf385b0dccec189af71af71e0af0b402ebdb.tar.gz |
Install LibeventConfig.cmake similar to other cmake files
- Don't destroy cmake file between test case invocations
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b6ad7e1..8c88ba56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1628,18 +1628,9 @@ set(EVENT_INSTALL_CMAKE_DIR export(PACKAGE libevent) -function(gen_package_config forinstall) - if(${forinstall}) - set(CONFIG_FOR_INSTALL_TREE 1) - set(dir "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}") - else() - set(CONFIG_FOR_INSTALL_TREE 0) - set(dir "${PROJECT_BINARY_DIR}") - endif() - configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfig.cmake.in - "${dir}/LibeventConfig.cmake" - @ONLY) -endfunction() +configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfig.cmake.in + "${PROJECT_BINARY_DIR}/LibeventConfig.cmake" + @ONLY) # Generate the config file for the build-tree. set(EVENT__INCLUDE_DIRS @@ -1650,11 +1641,6 @@ set(LIBEVENT_INCLUDE_DIRS ${EVENT__INCLUDE_DIRS} CACHE PATH "Libevent include directories") -gen_package_config(0) - -# Generate the config file for the installation tree. -gen_package_config(1) - # Generate version info for both build-tree and install-tree. configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfigVersion.cmake.in ${PROJECT_BINARY_DIR}/LibeventConfigVersion.cmake @@ -1672,7 +1658,7 @@ install(FILES ${HDR_PUBLIC} # Install the configs. install(FILES - ${PROJECT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/LibeventConfig.cmake + ${PROJECT_BINARY_DIR}/LibeventConfig.cmake ${PROJECT_BINARY_DIR}/LibeventConfigVersion.cmake DESTINATION "${EVENT_INSTALL_CMAKE_DIR}" COMPONENT dev) |