You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -78,6 +82,8 @@ This file is situated in the root directory of qpc. It performs a pre-initializa
78
82
*`QPC-CFG-GUI` - BOOL: set this boolean variable to ON/TRUE, if GUI support (win32) shall be compiled in. Default: OFF
79
83
*`QPC_CFG_UNIT_TEST` - BOOL: set this to ON/TRUE to support qutest, if build configuration `Spy` is active. Default: OFF
80
84
*`QPC_CFG_VERBOSE` - BOOL: set this to enable more verbosity in message output. Default: OFF
85
+
*`QPC_CFG_QPCONFIG_H_INCLUDE_PATH`: - STRING (PATH): (`QP/C 8.0.0`) set this to have the build of QP/C use your project specific `qp_config.h`.
86
+
Default: `${QPC_SDK_PATH}/ports/config`
81
87
82
88
### General usage hints
83
89
1. Set `QPC_SDK_PATH` or `QPC_FETCH_FROM_GIT` either in your `CMakeLists.txt` file or as an environment variable.
@@ -111,43 +117,13 @@ Many `qpc` examples provide 3 build configurations:
111
117
These configurations are also supported by qpc with cmake. Different possibilities exist to activate those.
112
118
113
119
### `qp_config.h` support
114
-
Some build configurations require the inclusion of `qp_config.h`. To achieve this, the QPC macro `QP_CONFIG` should be set, when compiling the
115
-
`qpc` source files. The include search paths also needs to be set accordingly in order for the preprocessor to be able to find the correct include
116
-
file.
120
+
With the release of QP/C V8.0.0 the inclusion of `qp_config.h` is mandatory.
121
+
The `cmake` build system of qpc addresses this by providing the configuration variable `QPC_CFG_QPCONFIG_H_INCLUDE_PATH`. Set this to the path of your local project's `qp_config.h` and this will automatically be found by the build system. Do this in your main `CMakeLists.txt` file __before__ calling `qpc_sdk_init()`.
117
122
118
-
As `qp_config.h` is a project related file, which - in most cases - resides outside the `qpc` source code tree, the decision is to handle the
119
-
above mentioned topic within the root project's `CMakeLists.txt` file instead of integrating this topic into a rather complicated configuration
120
-
of `qpc` itself.
123
+
You do not need to set this variable, should the qpc default settings be sufficient for your project. In this case the build system uses the `qp_config.h` file, as it can be found in the directory `${QPC_SDK_PATH}/src/ports/config`.
121
124
122
-
An example can be found in the [cmake dpp example](https://github.com/QuantumLeaps/qpc-examples/tree/main/posix-win32-cmake/dpp). Have a look into
123
-
the example's [CMakeLists.txt](https://github.com/QuantumLeaps/qpc-examples/blob/main/posix-win32-cmake/dpp/CMakeLists.txt).
124
-
125
-
You will find the reference to the `qpc` library, followed by the project's specific setup for `qp_config.h` like this:
126
-
```
127
-
# set up qpc library
128
-
target_link_libraries(dpp
129
-
PRIVATE
130
-
qpc
131
-
)
132
-
# should a 'qp_config.h' configuration file be used and is it available
133
-
# edit the HINTS in the 'find_file()' call according to your project settings
134
-
if(USE_QP_CONFIG)
135
-
find_file(QP_CONFIG qp_config.h HINTS ${CMAKE_CURRENT_SOURCE_DIR}) # try to identify 'qp_config.h'
136
-
if(QP_CONFIG) # found 'qp_config.h'
137
-
cmake_path(GET QP_CONFIG PARENT_PATH QP_CONFIG_DIR) # extract the path from the FQFN
138
-
target_compile_definitions(qpc # add -DQP_CONFIG to the qpc build
139
-
PUBLIC
140
-
QP_CONFIG
141
-
)
142
-
target_include_directories(qpc # add the path to 'qp_config.h' to the list of include paths for qpc
143
-
PUBLIC
144
-
${QP_CONFIG_DIR}
145
-
)
146
-
else() # 'qp_config.h' requested but not find - try to configure and build anyways
147
-
message(WARNING "File 'qp_config.h' not found!")
148
-
endif()
149
-
endif()
150
-
```
125
+
An example can be found in the [cmake dpp example](https://github.com/QuantumLeaps/qpcpp-examples/tree/main/posix-win32-cmake/dpp). Have a look into
126
+
the example's [CMakeLists.txt](https://github.com/QuantumLeaps/qpcpp-examples/blob/main/posix-win32-cmake/dpp/CMakeLists.txt).
151
127
152
128
### Multi configuration generators
153
129
The most easy way to make use of the different configurations is to use a multi config generator like `Ninja Multi-Config` or `MS Visual Studio`.
0 commit comments