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
cmake_minimum_required(VERSION 3.16)
project(helloword_pub LANGUAGES C)
add_executable(HelloworldPublisher publisher.c)
target_link_libraries(HelloworldPublisher HelloWorldData_lib CycloneDDS::ddsc)
The above is the cmake for a slightly modified HelloWorld example program (from cyclonedds/examples/helloworld). Using Cmake 3.16.3 this project will not configure properly:
This happens because prior to cmake 3.20 the GENERATED property is not propagated to subdirectories CMP0118 and so the second executable is not able to regenerate the .c & .h files that it depends on. This can be resolved with a bunch of manual work like adding the following to the CMakeLists.txt of any non-root user of the generated file(s).
Most people are going to look to the example programs as a starting point but as soon as any level of complexity is introduced into their project they could encounter this issue. I'd suggest increasing the minimum required CMake version on all examples to 3.20
Or if a cmake guru knows how to make the target re-apply the properties each time it's used (something to add to the generate cmakes?), that would be even better.
The text was updated successfully, but these errors were encountered:
./CMakeLists.txt
./pub/CMakeLists.txt
The above is the cmake for a slightly modified HelloWorld example program (from cyclonedds/examples/helloworld). Using Cmake 3.16.3 this project will not configure properly:
This happens because prior to cmake 3.20 the GENERATED property is not propagated to subdirectories CMP0118 and so the second executable is not able to regenerate the .c & .h files that it depends on. This can be resolved with a bunch of manual work like adding the following to the CMakeLists.txt of any non-root user of the generated file(s).
Most people are going to look to the example programs as a starting point but as soon as any level of complexity is introduced into their project they could encounter this issue. I'd suggest increasing the minimum required CMake version on all examples to 3.20
Or if a cmake guru knows how to make the target re-apply the properties each time it's used (something to add to the generate cmakes?), that would be even better.
The text was updated successfully, but these errors were encountered: