[c++] CMake improvements#28
Merged
carltimmer merged 9 commits intoJeffersonLab:evio-6.0from Mar 20, 2025
Merged
Conversation
Collaborator
|
Thanks! I tested it both ways, building Disruptor-CPP externally and with the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Various fixes and improvements to CMakeList.txt
find_package(evio)in their CMake setups-DDISRUPTOR_CPP_DIRor to be compatible with environement variable name-DDISRUPTOR_CPP_HOMEcmake flags.DISRUPTOR_ALLOW_FETCHcmake optionComments:
I was using latest ubuntu image and the code didn't compiled because of #ifdef __cpp_lib_filesystem. The
#ifdef __cpp_lib_filesystemuse were mixed with#ifdef USE_FILESYSTEMLIBdefinition use across files. I changed everything to#ifdef USE_FILESYSTEMLIB, the rationale is that it allows more control over compilation and testing. One can turn it on or off and see the outcome, while __cpp_lib_filesystem work automatically and can produce unwanted untested artifacts like on my setup.Added both DISRUPTOR_CPP_HOME and DISRUPTOR_CPP_DIR variables that can be set with -D flag. The rationale: DISRUPTOR_CPP_HOME corresponds to possible environment variable DISRUPTOR_CPP_HOME which I guess is commonly used in coda setup. DISRUPTOR_CPP_DIR is used as in modern CMake
<PACKAGE-NAME>_DIRflags are anticipated for setting package directoriesThe handling logic for Disruptor-cpp became more complex and occupied a significant portion of the main CMake file. To improve maintainability, I moved it to a dedicated FindDisruptor.cmake script, as is commonly done in such cases.
New cmake options and flags:
USE_FILESYSTEMLIB- default OFF. When ON - use C++17 instead of BoostDISRUPTOR_ALLOW_FETCH- default ON. When ON - if disruptor-cpp is not found by EVN or flags, cmake fetches itDISRUPTOR_CPP_DIRandDISRUPTOR_CPP_HOME- possible flags where to look installed disruptor-cpp filesfixes CMake looks for Disruptor.h in the wrong directories #27
P.S. I carefully tried to keep full backward compatibility. With all changes to cmake file make sure, that with all that changes it behaves as before on systems that uses cmake / environment variables as before. But I don't have coda or whatever setup and can't test changes in production like environments.