-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Use GNUInstallDirs for mapping installation directories #1221
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
But this breaks the export test - https://github.com/libevent/libevent/runs/4050571079?check_suite_focus=true
Can you please take a look?
385e2f0
to
ea73125
Compare
The test failures were coming from the tests not being able to find I removed the surrounding code which deletes the file and then regenerates it for the test cases. The tests were able to pass locally. |
@@ -1546,18 +1546,9 @@ set(EVENT_INSTALL_CMAKE_DIR | |||
|
|||
export(PACKAGE libevent) | |||
|
|||
function(gen_package_config forinstall) | |||
if(${forinstall}) | |||
set(CONFIG_FOR_INSTALL_TREE 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, CONFIG_FOR_INSTALL_TREE
can be removed from cmake/LibeventConfig.cmake.in
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why not. It's being installed to ${CMAKE_BINARY_DIR}
, similar to the other .cmake
files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if we will remove CONFIG_FOR_INSTALL_TREE
code, then LIBEVENT_INCLUDE_DIRS
will be incorrect.
libevent/cmake/LibeventConfig.cmake.in
Lines 113 to 147 in 89505f8
if(CONFIG_FOR_INSTALL_TREE) | |
## Config for install tree ---------------------------------------- | |
# Find includes | |
unset(_event_h CACHE) | |
find_path(_event_h | |
NAMES event2/event.h | |
PATHS "${_INSTALL_PREFIX}/include" | |
NO_DEFAULT_PATH) | |
if(_event_h) | |
set(LIBEVENT_INCLUDE_DIRS "${_event_h}") | |
message_if_needed(STATUS "Found libevent include directory: ${_event_h}") | |
else() | |
message_if_needed(WARNING "Your libevent library does not contain header files!") | |
endif() | |
# Find libraries | |
macro(find_event_lib _comp) | |
unset(_event_lib CACHE) | |
find_library(_event_lib | |
NAMES "event_${_comp}" | |
PATHS "${_INSTALL_PREFIX}/lib" | |
NO_DEFAULT_PATH) | |
if(_event_lib) | |
list(APPEND LIBEVENT_LIBRARIES "libevent::${_comp}") | |
set_case_insensitive_found(${_comp}) | |
message_if_needed(STATUS "Found libevent component: ${_event_lib}") | |
else() | |
no_component_msg(${_comp}) | |
endif() | |
endmacro() | |
foreach(comp ${_EVENT_COMPONENTS}) | |
find_event_lib(${comp}) | |
endforeach() | |
else() |
P.S. Sorry for the delay.
What is the status on this PR? It would be nice to add this to the next release of libevent. I don't mind trying to take over the PR. |
I think you can continue it. You can base you patches on top of this to preserve author, as long as you not completely change the patch. Thanks! |
sorry, I keep dropping things due to how many balls I'm trying to juggle. If you would like to take over, please do so! I'll be happy to review :) |
@tristan957 are you going to finish this? |
I have it on my list, but if someone else gets to it before I do even better. |
- Don't destroy cmake file between test case invocations
3bdb5e8
to
fce6e20
Compare
This is still a problem - #1221 (comment) Though by some reason our test for export does not shows the problem. |
Merged in #1397 |
Was iterating on this package for Nixpkgs, and found it difficult to consume the
.cmake
configurations asget_filename_component(_INSTALL_PREFIX "${LIBEVENT_CMAKE_DIR}/../../.." ABSOLUTE)
was not always true.This should be a no-op for most libevent package maintainers.