Skip to content

Commit 9d0b1e8

Browse files
committed
Merge branch 'release/v2.8.3'
2 parents f52e911 + aea8ab3 commit 9d0b1e8

File tree

24 files changed

+120
-129
lines changed

24 files changed

+120
-129
lines changed

CMakeLists.txt

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Top level makefile for Celero
33
#
4-
# Copyright 2015, 2016, 2017, 2018, 2019 John Farrier
4+
# Copyright 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 John Farrier
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@ macro(CeleroSetDefaultCompilerOptions)
2727
set_target_properties(${PROJECT_NAME} PROPERTIES
2828
POSITION_INDEPENDENT_CODE "${CELERO_COMPILE_PIC}"
2929
)
30-
if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
30+
if(MSVC)
3131
target_compile_options(${PROJECT_NAME} PRIVATE /D_VARIADIC_MAX=10 )
3232
target_compile_options(${PROJECT_NAME} PRIVATE /D_CRT_SECURE_NO_WARNINGS)
3333
target_compile_options(${PROJECT_NAME} PRIVATE /wd4251)
@@ -51,10 +51,10 @@ macro(CeleroSetDefaultCompilerOptions)
5151
target_compile_options(${PROJECT_NAME} PRIVATE /WX)
5252
endif()
5353

54-
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
54+
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
5555
target_compile_options(${PROJECT_NAME} PRIVATE -Wall)
5656

57-
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
57+
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
5858
if(${CMAKE_SYSTEM_NAME} STREQUAL Windows)
5959
target_compile_options(${PROJECT_NAME} PRIVATE -Xclang)
6060
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-c++98-compat)
@@ -70,7 +70,7 @@ macro(CeleroSetDefaultCompilerOptions)
7070
endif()
7171
endif()
7272

73-
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL AppleClang)
73+
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
7474
target_compile_options(${PROJECT_NAME} PRIVATE -Wall)
7575

7676
if(CELERO_TREAT_WARNINGS_AS_ERRORS)
@@ -80,11 +80,14 @@ macro(CeleroSetDefaultCompilerOptions)
8080
endmacro()
8181

8282
# Project Name
83-
PROJECT(CeleroProject)
83+
PROJECT(celero)
8484

8585
include(CheckFunctionExists)
8686
include(CheckCXXSourceCompiles)
8787
include(CheckIncludeFile)
88+
include(CMakePackageConfigHelpers)
89+
include(GNUInstallDirs)
90+
include(CMakeFindDependencyMacro)
8891

8992
#
9093
# User Options
@@ -103,6 +106,10 @@ else()
103106
SET(CELERO_USER_DEFINED_SHARED_OR_STATIC "STATIC")
104107
endif()
105108

109+
if(CELERO_ENABLE_TESTS)
110+
find_dependency(GTest REQUIRED)
111+
endif()
112+
106113
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
107114

108115
#
@@ -122,8 +129,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
122129
# ---------------------------------------------------------------------------
123130
# ---------------------------------------------------------------------------
124131

125-
set(PROJECT_NAME celero)
126-
127132
if(CELERO_COMPILE_DYNAMIC_LIBRARIES)
128133
add_definitions(-DCELERO_EXPORTS)
129134
else()
@@ -203,30 +208,39 @@ target_link_libraries(${PROJECT_NAME} ${SYSLIBS})
203208

204209
target_include_directories(${PROJECT_NAME} PUBLIC
205210
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
206-
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>
211+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}>
207212
)
208213

209214
# ---------------------------------------------------------------------------
210215
# Install and exports
211216
# ---------------------------------------------------------------------------
212217

213-
install(TARGETS ${PROJECT_NAME}
214-
EXPORT ${PROJECT_NAME}-target
215-
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
216-
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
217-
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
218+
install(
219+
DIRECTORY include/
220+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
218221
)
219-
220-
install(DIRECTORY include DESTINATION ${CMAKE_INSTALL_PREFIX})
221-
222-
# export to be used from install location
223-
install(EXPORT ${PROJECT_NAME}-target
224-
DESTINATION ${CMAKE_INSTALL_PREFIX}/share
222+
install(
223+
TARGETS celero
224+
DESTINATION ${CMAKE_INSTALL_LIBDIR}
225+
EXPORT celero-targets
225226
)
226-
227-
# export to be used from build directory
228-
export(EXPORT ${PROJECT_NAME}-target
229-
FILE ${PROJECT_NAME}-target.cmake
227+
install(
228+
EXPORT celero-targets
229+
FILE celero-targets.cmake
230+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/celero
231+
)
232+
export(
233+
EXPORT celero-targets
234+
FILE celero-targets.cmake
235+
)
236+
configure_package_config_file(
237+
${CMAKE_CURRENT_SOURCE_DIR}/config.cmake.in
238+
${CMAKE_CURRENT_BINARY_DIR}/celero-config.cmake
239+
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/celero
240+
)
241+
install(
242+
FILES ${CMAKE_CURRENT_BINARY_DIR}/celero-config.cmake
243+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/celero
230244
)
231245

232246
if(CELERO_ENABLE_FOLDERS)

README.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### C++ Benchmarking Library
44

5-
Copyright 2017-2021 John Farrier
5+
Copyright 2017-2022 John Farrier
66

77
Apache 2.0 License
88

@@ -25,20 +25,22 @@ A Special Thanks to the following corporations for their support:
2525

2626
Celero has been successfully built on the following platforms during development. See [Travis.CI](https://travis-ci.org/DigitalInBlue/Celero) for more details.
2727

28-
- GCC v6.0.0
29-
- GCC v7.0.0
30-
- GCC v8.0.0
31-
- GCC v9.0.0
32-
- LLVM v3.9.0
33-
- LLVM v5.0.1
34-
- LLVM v7.0.0
35-
- LLVM v8.0.0
36-
- LLVM v9.0.0
37-
- Visual Studio 2019 (16.8.4)
38-
- XCode v10.1
39-
- XCode v10.3
40-
- XCode v11.0
41-
- XCode v12.0
28+
- GCC v6.0.0
29+
- GCC v7.0.0
30+
- GCC v8.0.0
31+
- GCC v9.0.0
32+
- LLVM v3.9.0
33+
- LLVM v5.0.1
34+
- LLVM v7.0.0
35+
- LLVM v8.0.0
36+
- LLVM v9.0.0
37+
- Visual Studio 2019 (16.8.4)
38+
- Visual Studio 2019 (16.11.5)
39+
- Visual Studio 2022 (17.0.5)
40+
- XCode v10.1
41+
- XCode v10.3
42+
- XCode v11.0
43+
- XCode v12.0
4244

4345
As of v2.7, Celero requres the developer to provide GoogleTest in order to build unit tests. We suggest using a package manager such as VCPKG or Conan to provide the latest version of the library.
4446

@@ -339,7 +341,7 @@ BASELINE_FIXED_F(DemoTransform, FixedTime, DemoTransformFixture, 1, 100)
339341
{ /* Nothing to do */ }
340342
```
341343

342-
It is important that if your measurements use a test fixture, that your baseline (even if fixed) should use a test fixture as well. Features such as User-Defined Measurements (UDMs) look to the baseline class to detect if other features are present. If the baseline does not use a test fixuture, Celero will not know that other classes do use a test fixture that offers a UDM.
344+
It is important that if your measurements use a test fixture, that your baseline (even if fixed) should use a test fixture as well. Features such as User-Defined Measurements (UDMs) look to the baseline class to detect if other features are present. If the baseline does not use a test fixture, Celero will not know that other classes do use a test fixture that offers a UDM.
343345

344346
### User-Defined Measurements (UDM)
345347

@@ -705,7 +707,7 @@ SortRandInts,stdSort,2048,2000,2,0,0.0135828,49,20408.2,98,104.369,282,180.859,1
705707
SortRandInts,stdSort,4096,2000,2,0,0.00636808,105.5,9478.67,211,221.056,468,392.122,19.8021,6.47829,52.0453,0.507826,1159168,1.15917e+06,1159168,0,0,-nan(ind),0,0,
706708
```
707709
708-
Note that in this data, there are `T` statistics and there are `R` stastics. `T` represents _Time_ and `R` represents _RAM_.
710+
Note that in this data, there are `T` statistics and there are `R` statistics. `T` represents _Time_ and `R` represents _RAM_.
709711
710712
The point here is not that `std::sort` is better than more elementary sorting methods, but how easily measurable results can be obtained. In making such measurements more accessible and easier to code, they can become part of the way we code just as automated testing has become.
711713

cmake/FindCelero.cmake

Lines changed: 0 additions & 52 deletions
This file was deleted.

config.cmake.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@PACKAGE_INIT@
2+
3+
include("${CMAKE_CURRENT_LIST_DIR}/celero-targets.cmake")

experiments/DemoFileWrite/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Standard Celero Experiment CMake File
33
#
4-
# Copyright 2015, 2016, 2017, 2018, 2019 John Farrier
4+
# Copyright 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 John Farrier
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -25,7 +25,6 @@ target_sources(${PROJECT_NAME} PRIVATE
2525
)
2626

2727
CeleroSetDefaultCompilerOptions()
28-
add_dependencies(${PROJECT_NAME} celero)
2928
target_link_libraries(${PROJECT_NAME} celero)
3029
include_directories(${HEADER_PATH})
3130

experiments/DemoMultithread/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Standard Celero Experiment CMake File
33
#
4-
# Copyright 2015, 2016, 2017, 2018, 2019 John Farrier
4+
# Copyright 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 John Farrier
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -41,7 +41,6 @@ SET(PROJECT_NAME CeleroDemo-Multithread)
4141
)
4242

4343
# Broiler Plate: Celero Project Dependencies
44-
add_dependencies(${PROJECT_NAME} celero)
4544
target_link_libraries(${PROJECT_NAME} celero)
4645

4746
CeleroSetDefaultCompilerOptions()

experiments/DemoSimple/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Standard Celero Experiment CMake File
33
#
4-
# Copyright 2015, 2016, 2017, 2018, 2019 John Farrier
4+
# Copyright 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 John Farrier
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -38,7 +38,6 @@ add_executable(${PROJECT_NAME}
3838
)
3939

4040
# Broiler Plate: Celero Project Dependencies
41-
add_dependencies(${PROJECT_NAME} celero)
4241
target_link_libraries(${PROJECT_NAME} celero)
4342

4443
CeleroSetDefaultCompilerOptions()

experiments/DemoSimpleJUnit/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Standard Celero Experiment CMake File
33
#
4-
# Copyright 2015, 2016, 2017, 2018, 2019 John Farrier
4+
# Copyright 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 John Farrier
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -41,7 +41,6 @@ add_executable(${PROJECT_NAME}
4141
)
4242

4343
# Broiler Plate: Celero Project Dependencies
44-
add_dependencies(${PROJECT_NAME} celero)
4544
target_link_libraries(${PROJECT_NAME} celero)
4645

4746
CeleroSetDefaultCompilerOptions()

experiments/DemoSleep/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Standard Celero Experiment CMake File
33
#
4-
# Copyright 2015, 2016, 2017, 2018, 2019 John Farrier
4+
# Copyright 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 John Farrier
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -38,7 +38,6 @@ add_executable(${PROJECT_NAME}
3838
)
3939

4040
# Broiler Plate: Celero Project Dependencies
41-
add_dependencies(${PROJECT_NAME} celero)
4241
target_link_libraries(${PROJECT_NAME} celero)
4342

4443
CeleroSetDefaultCompilerOptions()

experiments/DemoToString/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Standard Celero Experiment CMake File
33
#
4-
# Copyright 2015, 2016, 2017, 2018, 2019 John Farrier
4+
# Copyright 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 John Farrier
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -41,7 +41,6 @@ add_executable(${PROJECT_NAME}
4141
)
4242

4343
# Broiler Plate: Celero Project Dependencies
44-
add_dependencies(${PROJECT_NAME} celero)
4544
target_link_libraries(${PROJECT_NAME} celero)
4645

4746
CeleroSetDefaultCompilerOptions()

experiments/DemoTransform/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Standard Celero Experiment CMake File
33
#
4-
# Copyright 2015, 2016, 2017, 2018, 2019 John Farrier
4+
# Copyright 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 John Farrier
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -38,7 +38,6 @@ add_executable(${PROJECT_NAME}
3838
)
3939

4040
# Broiler Plate: Celero Project Dependencies
41-
add_dependencies(${PROJECT_NAME} celero)
4241
target_link_libraries(${PROJECT_NAME} celero)
4342

4443
CeleroSetDefaultCompilerOptions()

experiments/ExperimentCompressBools/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Standard Celero Experiment CMake File
33
#
4-
# Copyright 2015, 2016, 2017, 2018, 2019 John Farrier
4+
# Copyright 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 John Farrier
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -43,7 +43,6 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
4343
)
4444

4545
# Broiler Plate: Celero Project Dependencies
46-
add_dependencies(${PROJECT_NAME} celero)
4746
target_link_libraries(${PROJECT_NAME} celero)
4847

4948
CeleroSetDefaultCompilerOptions()

0 commit comments

Comments
 (0)