Comments (7)
There is not. The code would be something like:
set(CELERO_DIRECTORY ${celeroDirectoryDefault} CACHE PATH "")
set(CELERO_INCLUDE_DIR ${CELERO_DIRECTORY}/include CACHE PATH "Celero's include directory.")
set(CELERO_LIBRARY celero CACHE STRING "")
#If celero is "out of tree", we have to add the subdirectory differently.
add_subdirectory(${CELERO_DIRECTORY} ${CMAKE_CURRENT_BINARY_DIR}/celero)
from celero.
Alternatively, use ExternalProject_Add
. Here is how I managed to do it in order to automate clone-build-link workflow for my benchmark https://github.com/mloskot/string_benchmark/
It works locally as well as in CI builds.
from celero.
Celero is also included in vcpkg. Using its toolchain file it is found automatically. Still, a FindCelero.cmake should be built.
from celero.
FYI, Celero 2.4 is also available from Conan packages
conan remote add ppodsiadly https://api.bintray.com/conan/ppodsiadly/conan
conan install celero/2.4.0@ppodsiadly/stable
from celero.
See celero\cmake\FindCelero.cmake
from celero.
Here are my thoughts about installation.
CMake documentation
It is said that "Packages provide dependency information to CMake based buildsystems". In turn "CMake provides direct support for two forms of packages, Config-file Packages and Find-module Packages". Also "Indirect support for pkg-config
packages is also provided via the FindPkgConfig module".
Solutions
This gives 4 possible solution for upstreams:
- documentation
- pkg-config
- FindModule
- config-file
Choice
- Documenting the exact place where targets are put is not CMake way. And not a good way in any way. In worse case downstreams have to read code where it is done.
- CMake can interoparate with pkg-config in both directions, though it's a little bit clunky. In presence of better options this one is not considered.
- CMake states about the third one that "Typically, a find module is needed when the upstream is not built with CMake, or is not CMake-aware enough to otherwise provide a package configuration file".
- So ideally we are left with the forth.
Config-file way
This solution won't require FindModule file at all as all necessary information will be generated by CMake on installation. This will change the directory where celero-target.cmake
is stored and add celero-config.cmake
.
I can pull-request this variant with or without the minimum information about CMake config-file concept so you can make a code review.
from celero.
@weirdo-neutrino - I agree the CMake configuration here is long in the tooth. I am happy to accept a pull request to modernize it! I simply haven't had time to do it. Thank you for your time and effort!
from celero.
Related Issues (20)
- Multiple warnings during compilation via Microsoft Visual Studio HOT 1
- Compiler errors with aggressive warnings enabled
- error: loop variable 'udm' of type 'const std::__1::shared_ptr<celero::UserDefinedMeasurement>' creates a copy from type 'const std::__1::shared_ptr<celero::UserDefinedMeasurement>' HOT 1
- Documentation link not present in README HOT 1
- Samples and iterations are only computed for first size of problem space (division by zero)
- UDM Fields are not printed properly
- Add User Defined Measurements to output files HOT 1
- Test executable fails: No Baseline case defined for "". Exiting.*** Error code 1 HOT 1
- ARCHIVE_OUTPUT_NAME always has ".dll" even for static builds
- Support vcpkg --triplet x64-windows-static-md
- celero 2.8.0 OSX test build failure HOT 3
- Tests terminate with Signal 11 HOT 4
- Truncation of group and experiment names in standard output HOT 1
- Problems with building / packaging celero HOT 5
- Passing invalid group name in the command line segfaults HOT 1
- [2.8.4 regression] c++: error: no such file or directory: '/wd4251' HOT 1
- Memory Measurement on macOS HOT 3
- Add User-Defined String field to Result Table CSV HOT 3
- Celero/experiments/ExperimentCompressBools has a bad cast HOT 2
- CMAKE_<BUILD_TYPE>_POSTFIX spills into consuming project HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from celero.