Skip to content

Commit

Permalink
Update project version to 1.5 (#15)
Browse files Browse the repository at this point in the history
* update project version to 1.5

* bump other dependencies

* rerun code formatters

* add .cmake-format
  • Loading branch information
TheLartians authored Oct 14, 2024
1 parent ae5bb8b commit 3825bbe
Show file tree
Hide file tree
Showing 12 changed files with 116 additions and 386 deletions.
57 changes: 57 additions & 0 deletions .cmake-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
format:
tab_size: 2
line_width: 100
dangle_parens: true

parse:
additional_commands:
cpmaddpackage:
pargs:
nargs: '*'
flags: []
spelling: CPMAddPackage
kwargs: &cpmaddpackagekwargs
NAME: 1
FORCE: 1
VERSION: 1
GIT_TAG: 1
DOWNLOAD_ONLY: 1
GITHUB_REPOSITORY: 1
GITLAB_REPOSITORY: 1
GIT_REPOSITORY: 1
SVN_REPOSITORY: 1
SVN_REVISION: 1
SOURCE_DIR: 1
DOWNLOAD_COMMAND: 1
FIND_PACKAGE_ARGUMENTS: 1
NO_CACHE: 1
GIT_SHALLOW: 1
URL: 1
URL_HASH: 1
URL_MD5: 1
DOWNLOAD_NAME: 1
DOWNLOAD_NO_EXTRACT: 1
HTTP_USERNAME: 1
HTTP_PASSWORD: 1
OPTIONS: +
cpmfindpackage:
pargs:
nargs: '*'
flags: []
spelling: CPMFindPackage
kwargs: *cpmaddpackagekwargs
packageproject:
pargs:
nargs: '*'
flags: []
spelling: packageProject
kwargs:
NAME: 1
VERSION: 1
NAMESPACE: 1
INCLUDE_DIR: 1
INCLUDE_DESTINATION: 1
BINARY_DIR: 1
COMPATIBILITY: 1
VERSION_HEADER: 1
DEPENDENCIES: +
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

# https://stackoverflow.com/questions/39332406/install-libc-on-ubuntu
- name: install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: build and install library
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: macos-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: configure
run: cmake -Htest -Bbuild
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Install format dependencies
run: pip3 install clang-format==14.0.6
run: pip3 install clang-format==14.0.6 cmake_format==0.6.11 pyyaml

- name: configure
run: cmake -Stest -Bbuild
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: configure
run: cmake -Htest -Bbuild -DENABLE_TEST_COVERAGE=1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: configure
run: cmake -Htest -Bbuild
Expand Down
19 changes: 11 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)

# ---- Project ----

project(EasyIterator
VERSION 1.4
project(
EasyIterator
VERSION 1.5
LANGUAGES CXX
)

# ---- Include guards ----

if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there.")
message(
FATAL_ERROR
"In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there."
)
endif()

# ---- Add dependencies via CPM ----
Expand Down Expand Up @@ -38,10 +42,9 @@ add_library(EasyIterator INTERFACE)
target_compile_options(EasyIterator INTERFACE "$<$<BOOL:${MSVC}>:/permissive->")
set_target_properties(EasyIterator PROPERTIES INTERFACE_COMPILE_FEATURES cxx_std_17)

target_include_directories(EasyIterator
INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/${PROJECT_NAME}-${PROJECT_VERSION}>
target_include_directories(
EasyIterator INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/${PROJECT_NAME}-${PROJECT_VERSION}>
)

# ---- Create an installable target ----
Expand Down
21 changes: 7 additions & 14 deletions benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,25 @@
cmake_minimum_required (VERSION 3.14)
cmake_minimum_required(VERSION 3.14)

option(EASY_ITERATOR_COMPARE_WITH_ITERTOOLS "benchmark itertools" OFF)

# ---- create project ----

project(EasyIteratorBenchmark
LANGUAGES CXX
)
project(EasyIteratorBenchmark LANGUAGES CXX)

# ---- Dependencies ----

include(../cmake/CPM.cmake)

CPMAddPackage(
NAME EasyIterator
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..
)
CPMAddPackage(NAME EasyIterator SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..)

CPMAddPackage(
NAME benchmark
GITHUB_REPOSITORY google/benchmark
VERSION 1.5.0
OPTIONS
"BENCHMARK_ENABLE_TESTING Off"
"BENCHMARK_USE_LIBCXX ON"
OPTIONS "BENCHMARK_ENABLE_TESTING Off" "BENCHMARK_USE_LIBCXX ON"
)

if (benchmark_ADDED)
if(benchmark_ADDED)
# patch benchmark target
set_target_properties(benchmark PROPERTIES CXX_STANDARD 17)
endif()
Expand All @@ -38,14 +31,14 @@ CPMAddPackage(
DOWNLOAD_ONLY Yes
)

if (itertools_ADDED)
if(itertools_ADDED)
add_library(itertools INTERFACE)
target_include_directories(itertools INTERFACE ${itertools_SOURCE_DIR})
endif()

# ---- Create standalone executable ----

add_executable(EasyIteratorBenchmark "benchmark.cpp")
set_target_properties(EasyIteratorBenchmark PROPERTIES CXX_STANDARD 17)
set_target_properties(EasyIteratorBenchmark PROPERTIES CXX_STANDARD 17)
target_link_libraries(EasyIteratorBenchmark benchmark itertools EasyIterator)
target_compile_definitions(EasyIteratorBenchmark PRIVATE "COMPARE_WITH_ITERTOOLS=1")
Loading

0 comments on commit 3825bbe

Please sign in to comment.