We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
CMake generate step should not fail.
CMake fails with the following error message.
CMake Error at CMakeLists.txt (target_link_libraries): Error evaluating generator expression: $<TARGET_PROPERTY:fastrtps,TYPE> Target "fastrtps" not found. CMake Error at CMakeLists.txt (target_link_libraries): Error evaluating generator expression: $<TARGET_PROPERTY:fastcdr,TYPE> Target "fastcdr" not found.
subdirectory/CMakeLists.txt:
subdirectory/CMakeLists.txt
find_package(fastcdr REQUIRED) find_package(fastrtps REQUIRED) add_library(my_lib STATIC "source.cpp") target_link_libraries(my_lib PUBLIC fastcdr fastrtps)
CMakeLists.txt:
CMakeLists.txt
add_subdirectory(subdirectory) add_executable(my_exe "main.cpp") target_link_libraries(my_exe my_lib)
The issue is resolved if the following lines are added to CMakeLists.txt.
find_package(fastcdr QUIET) find_package(fastrtps QUIET)
2.14.2
Windows 10 Visual Studio 2019
Default configuration, UDPv4 & SHM
The problem is most likely caused by the following line at src/cpp/CMakeLists.txt files.
src/cpp/CMakeLists.txt
target_compile_definitions(${PROJECT_NAME} PRIVATE ${PROJECT_NAME_UPPER}_SOURCE INTERFACE $<$<BOOL:${WIN32}>:${PROJECT_NAME_UPPER}_NO_LIB> PUBLIC $<$<STREQUAL:$<TARGET_PROPERTY:${PROJECT_NAME},TYPE>,SHARED_LIBRARY>:${PROJECT_NAME_UPPER}_DYN_LINK> )
The generated line in fastcdr-static-targets.cmake is as follows.
fastcdr-static-targets.cmake
set_target_properties(fastcdr PROPERTIES INTERFACE_COMPILE_DEFINITIONS "\$<\$<BOOL:1>FASTCDR_NO_LIB>;\$<\$<STREQUAL:\$<TARGET_PROPERTY:fastcdr,TYPE>,SHARED_LIBRARY>:FASTCDR_DYN_LINK>" INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" )
Consequently, the problem described in CMake: set_target_properties fails with target defined by generator expression occurs.
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is there an already existing issue for this?
Expected behavior
CMake generate step should not fail.
Current behavior
CMake fails with the following error message.
Steps to reproduce
subdirectory/CMakeLists.txt
:CMakeLists.txt
:The issue is resolved if the following lines are added to
CMakeLists.txt
.Fast DDS version/commit
2.14.2
Platform/Architecture
Windows 10 Visual Studio 2019
Transport layer
Default configuration, UDPv4 & SHM
Additional context
The problem is most likely caused by the following line at
src/cpp/CMakeLists.txt
files.The generated line in
fastcdr-static-targets.cmake
is as follows.Consequently, the problem described in CMake: set_target_properties fails with target defined by generator expression occurs.
XML configuration file
No response
Relevant log output
No response
Network traffic capture
No response
The text was updated successfully, but these errors were encountered: