Skip to content

Do not pass generated header to add_library#391

Merged
MatthijsBurgh merged 1 commit intoorocos:masterfrom
jacobperron:fix_cmake_warnings
Apr 2, 2022
Merged

Do not pass generated header to add_library#391
MatthijsBurgh merged 1 commit intoorocos:masterfrom
jacobperron:fix_cmake_warnings

Conversation

@jacobperron
Copy link
Copy Markdown
Contributor

Newer versions of cmake (>3.22.1) emit the following warning:

CMake Warning (dev) at src/CMakeLists.txt:69 (ADD_LIBRARY):
Policy CMP0115 is not set: Source file extensions must be explicit. Run
"cmake --help-policy CMP0115" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

I don't know exactly why passing this generated header triggers the warning,
but passing it to add_library doesn't seem necessary.

Newer versions of cmake (>3.22.1) emit the following warning:

  CMake Warning (dev) at src/CMakeLists.txt:69 (ADD_LIBRARY):
    Policy CMP0115 is not set: Source file extensions must be explicit.  Run
    "cmake --help-policy CMP0115" for policy details.  Use the cmake_policy
    command to set the policy and suppress this warning.

I don't know exactly why passing this generated header triggers the warning,
but passing it to add_library doesn't seem necessary.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@clalancette
Copy link
Copy Markdown

I don't know exactly why passing this generated header triggers the warning, but passing it to add_library doesn't seem necessary.

In my experience, that warning comes about when the referenced file doesn't exist. In this case, I think the problem is that config.h in that line actually lives at ${CMAKE_CURRENT_BINARY_DIR}/config.h. But I agree with you that it shouldn't be needed at all, so I think this patch is fine.

@MatthijsBurgh MatthijsBurgh merged commit 4fcf3ec into orocos:master Apr 2, 2022
@jacobperron jacobperron deleted the fix_cmake_warnings branch April 2, 2022 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants