Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update most package versions #190

Merged
merged 8 commits into from
Feb 7, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build/
/build*
/.vscode
*.DS_Store
*.DS_Store
7 changes: 4 additions & 3 deletions examples/asio-standalone/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ find_package(Threads REQUIRED)

CPMAddPackage(
NAME asio
VERSION 1.16.1
VERSION 1.18.1
GITHUB_REPOSITORY chriskohlhoff/asio
GIT_TAG asio-1-16-1 # asio uses non-standard version tag, we must specify GIT_TAG
GIT_TAG asio-1-18-1 # asio uses non-standard version tag, we must specify GIT_TAG
)

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

target_include_directories(asio INTERFACE ${asio_SOURCE_DIR}/asio/include)
target_include_directories(asio SYSTEM INTERFACE ${asio_SOURCE_DIR}/asio/include)

target_compile_definitions(asio INTERFACE ASIO_STANDALONE ASIO_NO_DEPRECATED)

Expand Down Expand Up @@ -65,3 +65,4 @@ endif()

add_executable(CPMExampleASIOStandalone main.cpp)
target_link_libraries(CPMExampleASIOStandalone asio)
target_compile_features(CPMExampleASIOStandalone PRIVATE cxx_std_17)
ClausKlein marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 4 additions & 4 deletions examples/benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ CPMAddPackage(
CPMAddPackage(
NAME benchmark
GITHUB_REPOSITORY google/benchmark
VERSION 1.5.0
VERSION 1.5.2
OPTIONS "BENCHMARK_ENABLE_TESTING Off"
)

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

# ---- Executable ----

add_executable(CPMExampleBenchmark "main.cpp")
set_target_properties(CPMExampleBenchmark PROPERTIES CXX_STANDARD 17)
target_link_libraries(CPMExampleBenchmark fibonacci benchmark)
target_compile_features(CPMExampleBenchmark PRIVATE cxx_std_17)
6 changes: 4 additions & 2 deletions examples/boost/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project(CPMExampleBoost)
# ---- Create binary ----

add_executable(CPMExampleBoost main.cpp)
set_target_properties(CPMExampleBoost PROPERTIES CXX_STANDARD 17)
target_compile_features(CPMExampleBoost PRIVATE cxx_std_17)

# ---- Dependencies ----

Expand All @@ -18,4 +18,6 @@ CPMFindPackage(
FIND_PACKAGE_ARGUMENTS "COMPONENTS system"
)

target_link_libraries(CPMExampleBoost PRIVATE Boost::system pthread)
find_package(Threads REQUIRED)

target_link_libraries(CPMExampleBoost PRIVATE Boost::system Threads::Threads)
47 changes: 32 additions & 15 deletions examples/build_all.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,46 @@
#!/usr/bin/python3

import os

from pathlib import Path
from subprocess import PIPE, run

# NOTE: boost V1.67 is to old! CK
examples = [
x for x in Path(__file__).parent.iterdir() if x.is_dir() and (x / 'CMakeLists.txt').exists()
x for x in Path(__file__).parent.iterdir() if x.is_dir() and (x / 'CMakeLists.txt').exists() and (not x.name in ['boost', 'old-gtest'])
ClausKlein marked this conversation as resolved.
Show resolved Hide resolved
]

assert(len(examples) > 0)


def runCommand(command):
print('- %s' % command)
result = run(command, stdout=PIPE, stderr=PIPE, universal_newlines=True, shell=True)
if result.returncode != 0:
print("error while running '%s':\n" % command, ' ' + str(result.stderr).replace('\n','\n '))
exit(result.returncode)
return result.stdout
print('- %s' % command)
result = run(command, stdout=PIPE, stderr=PIPE, universal_newlines=True, shell=True)
if result.returncode != 0:
print("error while running '%s':\n" %
command, ' ' + str(result.stderr).replace('\n', '\n '))
exit(result.returncode)
return result.stdout
ClausKlein marked this conversation as resolved.
Show resolved Hide resolved


print('')
for example in examples:
print("running example %s" % example.name)
print("================" + ('=' * len(example.name)))
project = Path(".") / 'build' / example.name
configure = runCommand('cmake -H%s -B%s' % (example, project))
print(' ' + '\n '.join([line for line in configure.split('\n') if 'CPM:' in line]))
build = runCommand('cmake --build %s -j4' % (project))
print(' ' + '\n '.join([line for line in build.split('\n') if 'Built target' in line]))
print('')
print("running example %s" % example.name)
print("================" + ('=' * len(example.name)))
project = Path(".") / 'build' / example.name
#
# Note: needs at least cmake V3.15! CK
# https://cmake.org/cmake/help/latest/command/project.html#code-injection
#
cmakeModulesPath = os.environ['HOME'] + '/Workspace/cmake'
if Path(cmakeModulesPath).is_dir():
before = "-DCMAKE_PROJECT_INCLUDE_BEFORE=%s/before_project_setup.cmake" % (
cmakeModulesPath)
after = "-DCMAKE_PROJECT_INCLUDE=%s/build_options.cmake" % (cmakeModulesPath)
configure = runCommand('cmake -H%s -B%s -G Ninja %s %s' % (example, project, before, after))
else:
configure = runCommand('cmake -H%s -B%s' % (example, project))
ClausKlein marked this conversation as resolved.
Show resolved Hide resolved
print(' ' + '\n '.join([line for line in configure.split('\n') if 'CPM:' in line]))
build = runCommand('cmake --build %s -j8' % (project))
ClausKlein marked this conversation as resolved.
Show resolved Hide resolved
print(' ' + '\n '.join([line for line in build.split('\n') if 'Built target' in line]))
print('')
2 changes: 1 addition & 1 deletion examples/catch2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ CPMAddPackage(

add_executable(CPMExampleCatch2 main.cpp)
target_link_libraries(CPMExampleCatch2 fibonacci Catch2)
set_target_properties(CPMExampleCatch2 PROPERTIES CXX_STANDARD 17)
target_compile_features(CPMExampleCatch2 PRIVATE cxx_std_17)

# ---- Enable testing ----

Expand Down
4 changes: 2 additions & 2 deletions examples/cereal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include(../../cmake/CPM.cmake)

CPMAddPackage(
NAME cereal
VERSION 1.2.2
VERSION 1.3.0
GITHUB_REPOSITORY USCiLab/cereal
OPTIONS "SKIP_PORTABILITY_TEST ON" "JUST_INSTALL_CEREAL ON"
)
Expand All @@ -17,4 +17,4 @@ CPMAddPackage(

add_executable(CPMExampleCereal main.cpp)
target_link_libraries(CPMExampleCereal cereal)
set_target_properties(CPMExampleCereal PROPERTIES CXX_STANDARD 17)
target_compile_features(CPMExampleCereal PRIVATE cxx_std_17)
2 changes: 1 addition & 1 deletion examples/cxxopts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ CPMAddPackage(

add_executable(CPMExampleCXXOpts main.cpp)
target_link_libraries(CPMExampleCXXOpts cxxopts)
set_target_properties(CPMExampleCXXOpts PROPERTIES CXX_STANDARD 17)
target_compile_features(CPMExampleCXXOpts PRIVATE cxx_std_17)
4 changes: 2 additions & 2 deletions examples/doctest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ CPMAddPackage(
CPMAddPackage(
NAME doctest
GITHUB_REPOSITORY onqtam/doctest
GIT_TAG 2.3.2
GIT_TAG 2.4.5
)

# ---- Create binary ----

add_executable(CPMExampleDoctest main.cpp)
target_link_libraries(CPMExampleDoctest fibonacci doctest)
set_target_properties(CPMExampleDoctest PROPERTIES CXX_STANDARD 17)
target_compile_features(CPMExampleDoctest PRIVATE cxx_std_17)

# ---- Enable testing ----

Expand Down
6 changes: 3 additions & 3 deletions examples/entt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ CPMAddPackage(

if(EnTT_ADDED)
add_library(EnTT INTERFACE)
target_include_directories(EnTT INTERFACE ${EnTT_SOURCE_DIR}/src)
target_include_directories(EnTT SYSTEM INTERFACE ${EnTT_SOURCE_DIR}/src)
endif()

# ---- Executable ----

add_executable(CPMEnTTExample "main.cpp")
set_target_properties(CPMEnTTExample PROPERTIES CXX_STANDARD 17)
add_executable(CPMEnTTExample main.cpp)
target_compile_features(CPMEnTTExample PRIVATE cxx_std_17)
target_link_libraries(CPMEnTTExample EnTT)
6 changes: 3 additions & 3 deletions examples/fmt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ include(../../cmake/CPM.cmake)

CPMAddPackage(
NAME fmt
GIT_TAG 6.1.2
GIT_TAG 7.1.3
GITHUB_REPOSITORY fmtlib/fmt
)

# ---- Executable ----

add_executable(CPMFmtExample "main.cpp")
set_target_properties(CPMFmtExample PROPERTIES CXX_STANDARD 17)
add_executable(CPMFmtExample main.cpp)
target_compile_features(CPMFmtExample PRIVATE cxx_std_17)
target_link_libraries(CPMFmtExample fmt)
10 changes: 7 additions & 3 deletions examples/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.14 FATAL_ERROR)

project(CPMExampleGtest)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS NO)
ClausKlein marked this conversation as resolved.
Show resolved Hide resolved

# ---- Dependencies ----

include(../../cmake/CPM.cmake)
Expand All @@ -15,16 +19,16 @@ CPMAddPackage(
CPMAddPackage(
NAME googletest
GITHUB_REPOSITORY google/googletest
GIT_TAG release-1.8.1
VERSION 1.8.1
GIT_TAG release-1.10.0
VERSION 1.10.0
OPTIONS "INSTALL_GTEST OFF" "gtest_force_shared_crt"
)

# ---- Create binary ----

add_executable(CPMExampleGtest main.cpp)
target_link_libraries(CPMExampleGtest fibonacci gtest gtest_main gmock)
set_target_properties(CPMExampleGtest PROPERTIES CXX_STANDARD 17)
target_compile_features(CPMExampleGtest PRIVATE cxx_std_17)

# ---- Enable testing ----

Expand Down
12 changes: 6 additions & 6 deletions examples/json/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ include(../../cmake/CPM.cmake)

CPMAddPackage(
NAME nlohmann_json
VERSION 3.6.1
VERSION 3.9.1
# not using the repo as it takes forever to clone
URL https://github.com/nlohmann/json/releases/download/v3.6.1/include.zip
URL_HASH SHA256=69cc88207ce91347ea530b227ff0776db82dcb8de6704e1a3d74f4841bc651cf
URL https://github.com/nlohmann/json/releases/download/v3.9.1/include.zip
URL_HASH SHA256=6bea5877b1541d353bd77bdfbdb2696333ae5ed8f9e8cc22df657192218cad91
)

if(nlohmann_json_ADDED)
add_library(nlohmann_json INTERFACE)
target_include_directories(nlohmann_json INTERFACE ${nlohmann_json_SOURCE_DIR})
target_include_directories(nlohmann_json SYSTEM INTERFACE ${nlohmann_json_SOURCE_DIR}/include)
endif()

# ---- Executable ----

add_executable(CPMJSONExample "main.cpp")
set_target_properties(CPMJSONExample PROPERTIES CXX_STANDARD 17)
add_executable(CPMJSONExample main.cpp)
target_compile_features(CPMJSONExample PRIVATE cxx_std_17)
target_link_libraries(CPMJSONExample nlohmann_json)
6 changes: 3 additions & 3 deletions examples/linenoise/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ CPMAddPackage(

if(linenoise_ADDED)
add_library(linenoise ${linenoise_SOURCE_DIR}/linenoise.c)
target_include_directories(linenoise PUBLIC ${linenoise_SOURCE_DIR})
target_include_directories(linenoise SYSTEM PUBLIC ${linenoise_SOURCE_DIR})
endif()

# ---- Executable ----

add_executable(CPMlinenoiseExample "main.cpp")
set_target_properties(CPMlinenoiseExample PROPERTIES CXX_STANDARD 17)
add_executable(CPMlinenoiseExample main.cpp)
target_compile_features(CPMlinenoiseExample PRIVATE cxx_std_17)
target_link_libraries(CPMlinenoiseExample linenoise)
10 changes: 5 additions & 5 deletions examples/range-v3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ include(../../cmake/CPM.cmake)

CPMAddPackage(
NAME range-v3
URL https://github.com/ericniebler/range-v3/archive/0.5.0.zip
VERSION 0.5.0
URL https://github.com/ericniebler/range-v3/archive/0.11.0.zip
VERSION 0.11.0
# the range-v3 CMakeLists screws with configuration options
DOWNLOAD_ONLY True
)

if(range-v3_ADDED)
add_library(range-v3 INTERFACE IMPORTED)
target_include_directories(range-v3 INTERFACE "${range-v3_SOURCE_DIR}/include")
target_include_directories(range-v3 SYSTEM INTERFACE "${range-v3_SOURCE_DIR}/include")
endif()

# ---- Executable ----

add_executable(CPMRangev3Example "main.cpp")
set_target_properties(CPMRangev3Example PROPERTIES CXX_STANDARD 17)
add_executable(CPMRangev3Example main.cpp)
target_compile_features(CPMRangev3Example PRIVATE cxx_std_17)
target_link_libraries(CPMRangev3Example range-v3)
6 changes: 3 additions & 3 deletions examples/simple_match/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ CPMAddPackage(

if(simple_match_ADDED)
add_library(simple_match INTERFACE IMPORTED)
target_include_directories(simple_match INTERFACE "${simple_match_SOURCE_DIR}/include")
target_include_directories(simple_match SYSTEM INTERFACE "${simple_match_SOURCE_DIR}/include")
endif()

# ---- Executable ----

add_executable(CPMSimpleMatchExample "main.cpp")
set_target_properties(CPMSimpleMatchExample PROPERTIES CXX_STANDARD 17)
add_executable(CPMSimpleMatchExample main.cpp)
target_compile_features(CPMSimpleMatchExample PRIVATE cxx_std_17)
target_link_libraries(CPMSimpleMatchExample simple_match)
8 changes: 4 additions & 4 deletions examples/sol2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if(lua_ADDED)
list(REMOVE_ITEM lua_sources "${lua_SOURCE_DIR}/lua.c" "${lua_SOURCE_DIR}/luac.c")
add_library(lua STATIC ${lua_sources})

target_include_directories(lua PUBLIC $<BUILD_INTERFACE:${lua_SOURCE_DIR}>)
target_include_directories(lua SYSTEM PUBLIC $<BUILD_INTERFACE:${lua_SOURCE_DIR}>)
endif()

CPMAddPackage(
Expand All @@ -32,12 +32,12 @@ CPMAddPackage(

if(sol2_ADDED)
add_library(sol2 INTERFACE IMPORTED)
target_include_directories(sol2 INTERFACE ${sol2_SOURCE_DIR}/include)
target_include_directories(sol2 SYSTEM INTERFACE ${sol2_SOURCE_DIR}/include)
target_link_libraries(sol2 INTERFACE lua)
endif()

# ---- Executable ----

add_executable(CPMSol2Example "main.cpp")
set_target_properties(CPMSol2Example PROPERTIES CXX_STANDARD 17)
add_executable(CPMSol2Example main.cpp)
target_compile_features(CPMSol2Example PRIVATE cxx_std_17)
target_link_libraries(CPMSol2Example sol2)
6 changes: 3 additions & 3 deletions examples/spdlog/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ include(../../cmake/CPM.cmake)
CPMAddPackage(
NAME spdlog
GITHUB_REPOSITORY gabime/spdlog
VERSION 1.7.0
VERSION 1.8.2
)

# ---- Executable ----

add_executable(CPMSpdlogExample "main.cpp")
set_target_properties(CPMSpdlogExample PROPERTIES CXX_STANDARD 17)
add_executable(CPMSpdlogExample main.cpp)
target_compile_features(CPMSpdlogExample PRIVATE cxx_std_17)
target_link_libraries(CPMSpdlogExample spdlog)
8 changes: 3 additions & 5 deletions examples/yaml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ include(../../cmake/CPM.cmake)
CPMAddPackage(
NAME yaml-cpp
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
# 0.6.2 uses deprecated CMake syntax
VERSION 0.6.3
# 0.6.3 is not released yet, so use the most recent commit
GIT_TAG 012269756149ae99745b6dafefd415843d7420bb
GIT_TAG yaml-cpp-0.6.3
OPTIONS "YAML_CPP_BUILD_TESTS Off" "YAML_CPP_BUILD_CONTRIB Off" "YAML_CPP_BUILD_TOOLS Off"
)

# ---- Executable ----

add_executable(CPMYamlExample "main.cpp")
set_target_properties(CPMYamlExample PROPERTIES CXX_STANDARD 17)
add_executable(CPMYamlExample main.cpp)
target_compile_features(CPMYamlExample PRIVATE cxx_std_17)
target_link_libraries(CPMYamlExample yaml-cpp)