Skip to content

Dphan/update to cpp17 #157

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

Closed
Closed
Show file tree
Hide file tree
Changes from all 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: 3 additions & 0 deletions .github/workflows/ci_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ jobs:
run: pip install -r .github/workflows/conan-requirements.txt
- name: Create default profile
run: conan profile detect
- name: make sure the conan profile uses cpp17 on Windows
if: ${{ matrix.config.os == 'windows-latest'}}
run: sed -i 's/compiler.cppstd=14/compiler.cppstd=17/' ~/.conan2/profiles/default
- run: cmake --version
- name: Run conan build Linux/macOS
if: ${{ matrix.config.os != 'windows-latest'}}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# C++ 14 Blueprint
# C++ 17 Blueprint

A pure C++ 14 blueprint with [CMake](https://cmake.org/) build system support.
A pure C++ 17 blueprint with [CMake](https://cmake.org/) build system support.
[Poco](https://pocoproject.org/) is used for network connections (feature: apigear).
The generated code can be enhanced with support for the [Conan](https://conan.io/) package manager.

Expand Down
3 changes: 3 additions & 0 deletions docs/docs/features/conan.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import helloWorldModuleComponent from '!!raw-loader!./data/helloworld.module.yam

With this feature you we generate a conan support for your project. It helps with packaging and to managing dependencies for different platforms, OSs, compilers, architecture, cross-builds. Read more about conan and its all benefits [here](https://conan.io/).

::tip::
Make sure your conan profile has all the required settings set to desired values e.g. the cpp standard set to 17.
:::

### File overview for module

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/features/data/example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(OLinkClientSimuExample)
# append local binary directory for conan packages to be found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set (SOURCES
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/features/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Follow the documentation for the [code generation](/docs/guide/intro) in general
Or try first the [quick start guide](../quickstart/index.md) which shows how to prepare api and generate code out of it.

:::tip
For questions regarding the template please go to our [discussions page](https://github.com/orgs/apigear-io/discussions). For feature requests or bug reports please use our [issue tracker](https://github.com/apigear-io/template-cpp14/issues).
For questions regarding the template please go to our [discussions page](https://github.com/orgs/apigear-io/discussions). For feature requests or bug reports please use our [issue tracker](https://github.com/apigear-io/template-cpp17/issues).
:::

### Example API
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
sidebar_position: 1
---

# Template C++ 14
# Template C++ 17

This is the documentation for the _cpp14_ template for the [ApiGear](/docs/guide/intro) code generator.
This is the documentation for the _cpp17_ template for the [ApiGear](/docs/guide/intro) code generator.

It is split in several parts:

- [Quick-Start](quickstart/index.md?current-template=template-cpp14) is the easiest way to get started
- [Quick-Start](quickstart/index.md?current-template=template-cpp17) is the easiest way to get started
- [Features](features/features.md) explains the available code generator features and their usage and purpose.
4 changes: 2 additions & 2 deletions docs/docs/quickstart/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import QuickStartCommon from "@site/docs/_quickstart_common.md"

The Quick-Start guide explains how in a few steps you get from an API definition to a functional c++ example.

Steps one and two are universal for other technologies. In the step two you will choose a concrete _cpp14_ template.
Steps one and two are universal for other technologies. In the step two you will choose a concrete _cpp17_ template.
For more general information about first steps with ApiGear [First Steps](/docs/guide/intro)

The quick start enables only basic features: the [api](features/api.md) generation and simple [stub](features/stubs.md) implementation.
Expand Down Expand Up @@ -102,7 +102,7 @@ project(MyExample)
# append local binary directory for conan packages to be found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_executable(MyExample main.cpp)
Expand Down
2 changes: 1 addition & 1 deletion goldenmaster/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.24)
project(test)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# on Windows it is helpful to have all binary files next to each other
Expand Down
6 changes: 3 additions & 3 deletions goldenmaster/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# C++ 14 Blueprint
# C++ 17 Blueprint

A pure C++ 14 blueprint with [CMake](https://cmake.org/) build system support. [Poco](https://pocoproject.org/) is used for network connections. The generated code can be enhanced with support for the [Conan](https://conan.io/) package manager.
A pure C++ 17 blueprint with [CMake](https://cmake.org/) build system support. [Poco](https://pocoproject.org/) is used for network connections. The generated code can be enhanced with support for the [Conan](https://conan.io/) package manager.

## Features
The following list presents a set of features which can be individually enabled in the solution file for code generation.
Expand Down Expand Up @@ -124,7 +124,7 @@ If you do not want or can not use conan, the poco libraries must installed separ
```
$ sudo apt install gcc-10 g++-10 git cmake libpoco-dev
```
2. Set gcc-10 with C++14 support as default compiler
2. Set gcc-10 with C++17 support as default compiler

```
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10 --slave /usr/bin/g++ g++ /usr/bin/g++-10
Expand Down
4 changes: 2 additions & 2 deletions goldenmaster/apigear/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.24)
project(apigear)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

set(apigear_COMPONENTS "")
Expand Down
2 changes: 1 addition & 1 deletion goldenmaster/apigear/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def build_requirements(self):
self.test_requires("trompeloeil/46")

def validate(self):
check_min_cppstd(self, "14")
check_min_cppstd(self, "17")

def layout(self):
cmake_layout(self)
Expand Down
4 changes: 2 additions & 2 deletions goldenmaster/apigear/olink/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.24)
project(poco-olink)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

Expand Down
2 changes: 1 addition & 1 deletion goldenmaster/apigear/olink/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.24)
project(test_poco_olink)

set(SPDLOG_DEBUG_ON true)
Expand Down
4 changes: 2 additions & 2 deletions goldenmaster/apigear/utilities/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.24)
project(utilities)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

Expand Down
2 changes: 1 addition & 1 deletion goldenmaster/apigear/utilities/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.24)
project(test_apigear_utilities)

set(SPDLOG_DEBUG_ON true)
Expand Down
4 changes: 2 additions & 2 deletions goldenmaster/examples/app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.24)
project(App)

# append local binary directory for conan packages to be found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set (SOURCES
Expand Down
4 changes: 2 additions & 2 deletions goldenmaster/examples/appthreadsafe/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.24)
project(AppThreadSafe)

# append local binary directory for conan packages to be found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set (SOURCES
Expand Down
4 changes: 2 additions & 2 deletions goldenmaster/examples/mqttclient/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.24)
project(MQTTClient)

# append local binary directory for conan packages to be found
set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR} ${CMAKE_MODULE_PATH})

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set (SOURCES
Expand Down
4 changes: 2 additions & 2 deletions goldenmaster/examples/mqttserver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.24)
project(MQTTServer)

# append local binary directory for conan packages to be found
set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR} ${CMAKE_MODULE_PATH})

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set (SOURCES
Expand Down
4 changes: 2 additions & 2 deletions goldenmaster/examples/olinkclient/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.24)
project(OLinkClient)

# append local binary directory for conan packages to be found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set (SOURCES
Expand Down
4 changes: 2 additions & 2 deletions goldenmaster/examples/olinkserver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.24)
project(OLinkServer)

# append local binary directory for conan packages to be found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}/cmake)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set (SOURCES
Expand Down
4 changes: 2 additions & 2 deletions goldenmaster/modules/counter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.24)
project(counter)

# needed to access CMAKE_INSTALL_LIBDIR
include(GNUInstallDirs)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_BINARY_DIR})
Expand Down
2 changes: 1 addition & 1 deletion goldenmaster/modules/counter/conan/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def build_requirements(self):
self.test_requires("catch2/2.13.7")

def validate(self):
check_min_cppstd(self, "14")
check_min_cppstd(self, "17")

def layout(self):
cmake_layout(self)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.24)
project(Testcounter)
include(CTest)
find_package(counter CONFIG REQUIRED)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# add test for counter
Expand Down
2 changes: 1 addition & 1 deletion goldenmaster/modules/counter/generated/api/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(custom_types REQUIRED COMPONENTS api)
find_package(extern_types REQUIRED COMPONENTS api)
Expand Down
2 changes: 1 addition & 1 deletion goldenmaster/modules/counter/generated/core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(nlohmann_json REQUIRED)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(apigear REQUIRED COMPONENTS poco-tracer)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(apigear REQUIRED COMPONENTS poco-olink)
Expand Down
2 changes: 1 addition & 1 deletion goldenmaster/modules/counter/implementation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(THREADS_PREFER_PTHREAD_FLAG ON)
Expand Down
4 changes: 2 additions & 2 deletions goldenmaster/modules/custom_types/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.24)
project(custom_types)

# needed to access CMAKE_INSTALL_LIBDIR
include(GNUInstallDirs)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_BINARY_DIR})
Expand Down
2 changes: 1 addition & 1 deletion goldenmaster/modules/custom_types/conan/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def build_requirements(self):
self.test_requires("catch2/2.13.7")

def validate(self):
check_min_cppstd(self, "14")
check_min_cppstd(self, "17")

def layout(self):
cmake_layout(self)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.24)
project(Testcustom_types)
include(CTest)
find_package(custom_types CONFIG REQUIRED)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# add test for custom_types
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set (SOURCES
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(nlohmann_json REQUIRED)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(apigear REQUIRED COMPONENTS poco-tracer)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(apigear REQUIRED COMPONENTS poco-olink)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(THREADS_PREFER_PTHREAD_FLAG ON)
Expand Down
4 changes: 2 additions & 2 deletions goldenmaster/modules/extern_types/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.24)
project(extern_types)

# needed to access CMAKE_INSTALL_LIBDIR
include(GNUInstallDirs)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_BINARY_DIR})
Expand Down
2 changes: 1 addition & 1 deletion goldenmaster/modules/extern_types/conan/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def build_requirements(self):
self.test_requires("catch2/2.13.7")

def validate(self):
check_min_cppstd(self, "14")
check_min_cppstd(self, "17")

def layout(self):
cmake_layout(self)
Expand Down
Loading
Loading