Skip to content

Commit 5f614e5

Browse files
update most package versions (#190)
* update most package versions extent build_all.py to inject cmake modules and use Ninja generator * fix build problems while build on debian use SYSTEM include paths (for clang++) we should not use local installed header! * fix banchmark example finalize cmake project code injection as an option * fix build problems on travis CI gtest needs c++17 * Update examples/build_all.py Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com> * reindent py script requested by review indent with only 2 spaces again * changes according the review the gtest build error seems to be a make -j cpucount problem * revert filter too Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
1 parent 1f5cb90 commit 5f614e5

File tree

19 files changed

+63
-57
lines changed

19 files changed

+63
-57
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
build/
12
/build*
23
/.vscode
3-
*.DS_Store
4+
*.DS_Store

examples/asio-standalone/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ find_package(Threads REQUIRED)
1010

1111
CPMAddPackage(
1212
NAME asio
13-
VERSION 1.16.1
13+
VERSION 1.18.1
1414
GITHUB_REPOSITORY chriskohlhoff/asio
15-
GIT_TAG asio-1-16-1 # asio uses non-standard version tag, we must specify GIT_TAG
15+
GIT_TAG asio-1-18-1 # asio uses non-standard version tag, we must specify GIT_TAG
1616
)
1717

1818
# ASIO doesn't use CMake, we have to configure it manually. Extra notes for using on Windows:
@@ -24,7 +24,7 @@ CPMAddPackage(
2424
if(asio_ADDED)
2525
add_library(asio INTERFACE)
2626

27-
target_include_directories(asio INTERFACE ${asio_SOURCE_DIR}/asio/include)
27+
target_include_directories(asio SYSTEM INTERFACE ${asio_SOURCE_DIR}/asio/include)
2828

2929
target_compile_definitions(asio INTERFACE ASIO_STANDALONE ASIO_NO_DEPRECATED)
3030

@@ -65,3 +65,4 @@ endif()
6565

6666
add_executable(CPMExampleASIOStandalone main.cpp)
6767
target_link_libraries(CPMExampleASIOStandalone asio)
68+
target_compile_features(CPMExampleASIOStandalone PRIVATE cxx_std_11)

examples/benchmark/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ CPMAddPackage(
1515
CPMAddPackage(
1616
NAME benchmark
1717
GITHUB_REPOSITORY google/benchmark
18-
VERSION 1.5.0
18+
VERSION 1.5.2
1919
OPTIONS "BENCHMARK_ENABLE_TESTING Off"
2020
)
2121

2222
if(benchmark_ADDED)
23-
# patch google benchmark target
24-
set_target_properties(benchmark PROPERTIES CXX_STANDARD 17)
23+
# Don't use C++14 because it doesn't work in some configurations.
24+
set_target_properties(benchmark PROPERTIES CXX_STANDARD 11)
2525
endif()
2626

2727
# ---- Executable ----
2828

2929
add_executable(CPMExampleBenchmark "main.cpp")
30-
set_target_properties(CPMExampleBenchmark PROPERTIES CXX_STANDARD 17)
3130
target_link_libraries(CPMExampleBenchmark fibonacci benchmark)
31+
target_compile_features(CPMExampleBenchmark PRIVATE cxx_std_17)

examples/boost/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ project(CPMExampleBoost)
55
# ---- Create binary ----
66

77
add_executable(CPMExampleBoost main.cpp)
8-
set_target_properties(CPMExampleBoost PROPERTIES CXX_STANDARD 17)
8+
target_compile_features(CPMExampleBoost PRIVATE cxx_std_17)
99

1010
# ---- Dependencies ----
1111

@@ -18,4 +18,6 @@ CPMFindPackage(
1818
FIND_PACKAGE_ARGUMENTS "COMPONENTS system"
1919
)
2020

21-
target_link_libraries(CPMExampleBoost PRIVATE Boost::system pthread)
21+
find_package(Threads REQUIRED)
22+
23+
target_link_libraries(CPMExampleBoost PRIVATE Boost::system Threads::Threads)

examples/build_all.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/python3
22

3+
import os
4+
35
from pathlib import Path
46
from subprocess import PIPE, run
57

@@ -9,21 +11,23 @@
911

1012
assert(len(examples) > 0)
1113

14+
1215
def runCommand(command):
1316
print('- %s' % command)
1417
result = run(command, stdout=PIPE, stderr=PIPE, universal_newlines=True, shell=True)
1518
if result.returncode != 0:
16-
print("error while running '%s':\n" % command, ' ' + str(result.stderr).replace('\n','\n '))
19+
print("error while running '%s':\n" % command, ' ' + str(result.stderr).replace('\n', '\n '))
1720
exit(result.returncode)
1821
return result.stdout
1922

23+
2024
print('')
2125
for example in examples:
2226
print("running example %s" % example.name)
2327
print("================" + ('=' * len(example.name)))
2428
project = Path(".") / 'build' / example.name
2529
configure = runCommand('cmake -H%s -B%s' % (example, project))
2630
print(' ' + '\n '.join([line for line in configure.split('\n') if 'CPM:' in line]))
27-
build = runCommand('cmake --build %s -j4' % (project))
31+
build = runCommand('cmake --build %s -- -j%i' % (project, os.cpu_count() / 2))
2832
print(' ' + '\n '.join([line for line in build.split('\n') if 'Built target' in line]))
2933
print('')

examples/catch2/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ CPMAddPackage(
1515
CPMAddPackage(
1616
NAME Catch2
1717
GITHUB_REPOSITORY catchorg/Catch2
18-
VERSION 2.5.0
18+
VERSION 2.13.4
1919
)
2020

2121
# ---- Create binary ----
2222

2323
add_executable(CPMExampleCatch2 main.cpp)
2424
target_link_libraries(CPMExampleCatch2 fibonacci Catch2)
25-
set_target_properties(CPMExampleCatch2 PROPERTIES CXX_STANDARD 17)
25+
target_compile_features(CPMExampleCatch2 PRIVATE cxx_std_17)
2626

2727
# ---- Enable testing ----
2828

examples/cereal/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ include(../../cmake/CPM.cmake)
88

99
CPMAddPackage(
1010
NAME cereal
11-
VERSION 1.2.2
11+
VERSION 1.3.0
1212
GITHUB_REPOSITORY USCiLab/cereal
1313
OPTIONS "SKIP_PORTABILITY_TEST ON" "JUST_INSTALL_CEREAL ON"
1414
)
@@ -17,4 +17,4 @@ CPMAddPackage(
1717

1818
add_executable(CPMExampleCereal main.cpp)
1919
target_link_libraries(CPMExampleCereal cereal)
20-
set_target_properties(CPMExampleCereal PROPERTIES CXX_STANDARD 17)
20+
target_compile_features(CPMExampleCereal PRIVATE cxx_std_17)

examples/cxxopts/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ CPMAddPackage(
1717

1818
add_executable(CPMExampleCXXOpts main.cpp)
1919
target_link_libraries(CPMExampleCXXOpts cxxopts)
20-
set_target_properties(CPMExampleCXXOpts PROPERTIES CXX_STANDARD 17)
20+
target_compile_features(CPMExampleCXXOpts PRIVATE cxx_std_17)

examples/doctest/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ CPMAddPackage(
1515
CPMAddPackage(
1616
NAME doctest
1717
GITHUB_REPOSITORY onqtam/doctest
18-
GIT_TAG 2.3.2
18+
GIT_TAG 2.4.5
1919
)
2020

2121
# ---- Create binary ----
2222

2323
add_executable(CPMExampleDoctest main.cpp)
2424
target_link_libraries(CPMExampleDoctest fibonacci doctest)
25-
set_target_properties(CPMExampleDoctest PROPERTIES CXX_STANDARD 17)
25+
target_compile_features(CPMExampleDoctest PRIVATE cxx_std_17)
2626

2727
# ---- Enable testing ----
2828

examples/entt/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ CPMAddPackage(
1616

1717
if(EnTT_ADDED)
1818
add_library(EnTT INTERFACE)
19-
target_include_directories(EnTT INTERFACE ${EnTT_SOURCE_DIR}/src)
19+
target_include_directories(EnTT SYSTEM INTERFACE ${EnTT_SOURCE_DIR}/src)
2020
endif()
2121

2222
# ---- Executable ----
2323

24-
add_executable(CPMEnTTExample "main.cpp")
25-
set_target_properties(CPMEnTTExample PROPERTIES CXX_STANDARD 17)
24+
add_executable(CPMEnTTExample main.cpp)
25+
target_compile_features(CPMEnTTExample PRIVATE cxx_std_17)
2626
target_link_libraries(CPMEnTTExample EnTT)

0 commit comments

Comments
 (0)