Skip to content

Commit 9e51e79

Browse files
committed
Fix IDICMAKE_PLATFORM_CONFIG being propagated to subprojects
1 parent 31470ad commit 9e51e79

5 files changed

Lines changed: 8 additions & 7 deletions

File tree

.github/workflows/cpp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
mkdir -p build
3030
cd build
3131
cmake --version
32-
cmake .. $CMAKE_ARGS -DIDICMAKE_PLATFORM_CONFIG="../platform-config.${{ matrix.type }}.cmake"
32+
cmake .. $CMAKE_ARGS -DTEMPLATE_PROJECT_PLATFORM_CONFIG="../platform-config.${{ matrix.type }}.cmake"
3333
- name: Build
3434
shell: bash
3535
run: |

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ build-linux:
2222
script:
2323
- cmake --version && $CC --version && $CXX --version
2424
- mkdir -p build && cd build
25-
- cmake .. $CMAKE_ARGS -DIDICMAKE_PLATFORM_CONFIG=../platform-config.$TYPE.cmake
25+
- cmake .. $CMAKE_ARGS -DTEMPLATE_PROJECT_PLATFORM_CONFIG=../platform-config.$TYPE.cmake
2626
- cmake --build . -j 8
2727
- ctest -C Debug --output-junit ctest.xml
2828
interruptible: true

JenkinsfileTemplate

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pipeline {
1616
steps {
1717
dir('build') {
1818
deleteDir()
19-
bat 'cmake .. -DDO_TEMPLATE_COMPONENT_TEST=1'
19+
bat 'cmake .. -DTEMPLATE_PROJECT_DO_TEMPLATE_COMPONENT_TEST=1'
2020
bat 'cmake --build .'
2121
bat 'ctest -C Debug'
2222
junit 'reports/**_report*.xml'
@@ -27,7 +27,7 @@ pipeline {
2727
steps {
2828
dir('build') {
2929
deleteDir()
30-
bat 'cmake .. -DIDICMAKE_PLATFORM_CONFIG=../platform_config.static.cmake'
30+
bat 'cmake .. -DTEMPLATE_PROJECT_PLATFORM_CONFIG=../platform-config.static.cmake'
3131
bat 'cmake --build .'
3232
bat 'ctest -C Debug'
3333
junit 'reports/**_report*.xml'
@@ -38,7 +38,7 @@ pipeline {
3838
steps {
3939
dir('build') {
4040
deleteDir()
41-
bat 'cmake .. -DIDICMAKE_PLATFORM_CONFIG=../platform_config.shared.cmake'
41+
bat 'cmake .. -DTEMPLATE_PROJECT_PLATFORM_CONFIG=../platform-config.shared.cmake'
4242
bat 'cmake --build .'
4343
bat 'ctest -C Debug'
4444
junit 'reports/**_report*.xml'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ $ cmake --build . # or generated build system command (make, Visual Studio etc
3131

3232
_Use with `cmake .. -D<argument>=<value>`._
3333

34-
- `IDICMAKE_PLATFORM_CONFIG` (default: `platform_config.cmake`) - Platform configuration file.
34+
- `<PROJECT_NAME>_PLATFORM_CONFIG` (default: `platform_config.cmake`) - Platform configuration file.
3535
- `IDICMAKE_BUILD_DEMOS` (default: `0`) - Build demo applications if applicable.
3636
- `IDICMAKE_BUILD_TESTS` (default: `1`) - Build unit tests. _(long)_
3737
- `DO_TEMPLATE_COMPONENT_TEST` (default: `0`) - Generate unit test template component and build unit tests for template.

cmake/idi/functions/framework/idi_load_platform_config.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ macro(idi_load_platform_config)
1111
idi_cmake_hook_abs(${CMAKE_CURRENT_LIST_DIR}/platform-local-options.cmake)
1212
idi_cmake_hook_abs(${CMAKE_CURRENT_LIST_DIR}/cmake-hooks/pre-configure.cmake)
1313

14-
set(IDICMAKE_PLATFORM_CONFIG "${CMAKE_CURRENT_LIST_DIR}/platform-config.cmake" CACHE FILEPATH "Platform config definitions file")
14+
set("${IDICMAKE_PREFIX}_PLATFORM_CONFIG" "${CMAKE_CURRENT_LIST_DIR}/platform-config.cmake" CACHE FILEPATH "Platform config definitions file")
15+
set(IDICMAKE_PLATFORM_CONFIG "${${IDICMAKE_PREFIX}_PLATFORM_CONFIG}")
1516
include("${IDICMAKE_PLATFORM_CONFIG}")
1617

1718
idi_cmake_hook_abs(${CMAKE_CURRENT_LIST_DIR}/cmake-hooks/post-platform-config.cmake)

0 commit comments

Comments
 (0)