Closed claudiofantacci closed 7 years ago
Project version shall be set in the project()
command as reported here.
In the CMakeLists.txt the include(RTFVersion)
should export a variable to be used in `project()', e.g.:
inlcude(RTFVersion)
project(RTF LANGUAGE CXX VERSION ${RTFVersionNumber})
...
This should be compliant with CMP0048 cc: @apaikan @traversaro @drdanz
I am quite confused. If we use the new signature of project
we break compatibility with CMake < 3.0 (not a big problem, considering https://github.com/robotology/QA/issues/173 and given that RTF
is mostly a developer tool). However I wonder why we don't get this warning in the other libraries.
For the RPATH warning, the logic to set it properly can be found in https://github.com/robotology/ycm/blob/master/modules/AddInstallRPATHSupport.cmake .
As far as VERSION issue is concerned, @apaikan is also experiencing this warning on Windows. What I would guess about it, is that with the latest version of CMake (I have 3.7.1), developers are pushing to move users toward 3.0>. I have no problem with supporting older version (say 2.8>), but we may want to consider enforcing the policies and moving toward CMake 3.0.
As far as RPATH issue is concerned, I think we can use AddInstallRPATHSupport.cmake directly copying it into the config
folder (and modifying CMakeLists accordingly). Am I right?
I think this is the problem:
project(RTF)
# ...
# include version number
include(RTFVersion)
set(RTF_VERSION_MAJOR "1")
set(RTF_VERSION_MINOR "0")
set(RTF_VERSION_PATCH "1")
set(RTF_VERSION_TWEAK "0")
# Generate RTF_VERSION
if(RTF_VERSION_TWEAK)
set(RTF_VERSION "${RTF_VERSION_MAJOR}.${RTF_VERSION_MINOR}.${RTF_VERSION_PATCH}.${RTF_VERSION_TWEAK}")
else()
set(RTF_VERSION "${RTF_VERSION_MAJOR}.${RTF_VERSION_MINOR}.${RTF_VERSION_PATCH}")
endif()
robot-testing/src/rtf/CMakeLists.txt:8
project(RTF)
The second project(RTF)
is overriding the values set by RTFVersion
. CMake checks if the variables set are empty and warns the uses. Just removing the second call (that is actually useless and confusing since it will overwrite several variables) should fix this warning.
@claudiofantacci Can you please try?
I'm on it 👍
While configuring CMake, I get the following warning:
During generation I get:
System: macOS 10.11.6 (El Capitan), CMake 3.7.0.