-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
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
[WIP] Some modernization and this should fix #68, #29 #89
base: master
Are you sure you want to change the base?
Conversation
flagarde
commented
Jul 17, 2020
•
edited
Loading
edited
- Some modernization and this should fix FindROOT.cmake should be removed #68, LCIO project should not have a top-level bin directory in its source tree #29
Done |
if( BUILD_ROOTDICT ) | ||
find_package( ROOT 6.04 REQUIRED ) | ||
##Need to check if ROOT has been compiled with other CXX_STANDARD | ||
get_property(ROOT_CXX_STANDARD TARGET ROOT::Core PROPERTY INTERFACE_COMPILE_FEATURES) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a good idea to overwrite the CXX standard here depending on ROOT. This should be up to the user to make sure things are compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't do this it cannot compile.. other option is to just compile thé Root code with such property. Like this the project Can still be cpp11 but the root code that must follow root properties can be built
IF( NOT SH ) | ||
MESSAGE( FATAL_ERROR "unix shell not found" ) | ||
ENDIF() | ||
#FIND_PROGRAM( SH sh ${CYGWIN_INSTALL_PATH}/bin /bin /usr/bin /usr/local/bin /sbin ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove this? It is required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't find anywhere where you use the sh program
|
||
|
||
# generate and install following configuration files | ||
GENERATE_PACKAGE_CONFIGURATION_FILES( LCIOConfig.cmake LCIOConfigVersion.cmake ) | ||
|
||
INSTALL( FILES cmake/MacroCheckPackageLibs.cmake cmake/MacroCheckPackageVersion.cmake DESTINATION lib/cmake) | ||
INSTALL( FILES cmake/MacroCheckPackageLibs.cmake cmake/MacroCheckPackageVersion.cmake DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CMake documentation says:
DESTINATION
Specify the directory on disk to which a file will be installed.
If a full path (with a leading slash or drive letter) is given it is
used directly. If a relative path is given it is interpreted relative
to the value of the CMAKE_INSTALL_PREFIX variable. The
prefix can be relocated at install time using the DESTDIR
mechanism explained in the CMAKE_INSTALL_PREFIX variable
documentation.
The variable CMAKE_INSTALL_PREFIX is not useful here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes i had a doubt
#IF( EXISTS "${_current_dir}/MacroExportPackageDeps.cmake" ) | ||
# INSTALL( FILES "${_current_dir}/MacroExportPackageDeps.cmake" DESTINATION cmake ) | ||
#ENDIF() | ||
INSTALL( FILES "${PROJECT_BINARY_DIR}/${arg}" DESTINATION "lib/cmake" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CMake config files should be installed in the top level directory. I know that it might not be the best practice or the recommended location but other packages still rely on that at the time being. Please switch it back to .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, would you agree to put it by default in the top level but add and option to allow the user to change the location ? Or populate in the top directory and in thé standard /lib/cmake/LCIO one? Doing so I think cmake will be able to find LCIO is the user decide to install the project in the default paths given by cmake
#IF( EXISTS "${_current_dir}/MacroCheckPackageVersion.cmake" ) | ||
# INSTALL( FILES "${_current_dir}/MacroCheckPackageVersion.cmake" DESTINATION cmake ) | ||
#ENDIF() | ||
INSTALL( FILES "${PROJECT_BINARY_DIR}/${arg}" DESTINATION "lib/cmake" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@@ -37,6 +33,6 @@ INSTALL_SHARED_LIBRARY( sio DESTINATION lib ) | |||
|
|||
# mimic the SIOConfig.cmake variables for the LCIO project | |||
SET( SIO_VERSION "${SIO_VERSION}" CACHE STRING "The SIO version" ) | |||
SET( SIO_LIBRARIES "$<TARGET_FILE:sio>" CACHE STRING "The SIO library" ) | |||
SET( SIO_LIBRARIES "sio" CACHE STRING "The SIO library" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. This is processed by the CMake generator and forms a variable which is interpreted later ON. Please changed it back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, using the generator expression causes the problem solved in #91 . As far as we understand, because otherwise no dependency is formed beween the lcio target and the sio target. Though I am not sure about the use of quotes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it comes from the SIO package where it was needed, but maybe not here indeed. I'll have to look in the SIO package. The CMakeLists.txt is a bit different
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you still want to have a sio folder on this package ? As it's now standalone it could be download by cmake using externalproject for example ... but it will allow to fix this kind of problems and avoid to change codes in two project... by the way what is thé cmake version you want to use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- About using SIO through a directory / external_project:
This has been discussed internally and we believe it was currently the best solution. The use of external_project make the thing a bit complicated to handle because of CMake variables that are imported from SIOConfig.cmake. - About the CMake version:
The minimum required here must refer to the minimum we need to make these scripts working, not the one we want to use. By the way, we currently use CMake 3.14 I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it's more complicated I agree
I mean what is the version you want to put in cmake_minimum_required
./src/CPPFORT/lcwrt.cc | ||
) | ||
if( BUILD_FORTRAN ) | ||
set( LCIO_CPPFORT_SRCS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMake commands in upper case please. Look also in other places
@@ -347,7 +351,7 @@ IF( BUILD_ROOTDICT ) | |||
LIST( REMOVE_ITEM UTIL_CXX_HEADERS_LIST ${exclude_headers} ) | |||
|
|||
|
|||
MESSAGE( STATUS "********************* UTIL_CXX_HEADERS_LIST: ${UTIL_CXX_HEADERS_LIST}" ) | |||
#MESSAGE( STATUS "********************* UTIL_CXX_HEADERS_LIST: ${UTIL_CXX_HEADERS_LIST}" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! An old forgotten one! ;-)
ADD_LCIO_EXAMPLE( lcio_parallel_processing ) | ||
endif() | ||
|
||
IF( BUILD_ROOTDICT AND BUILD_LCIO_EXAMPLES) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change
IF( BUILD_ROOTDICT AND BUILD_LCIO_EXAMPLES)
to
IF( BUILD_ROOTDICT AND INSTALL_APPS)
strncpy(_fileName, filename, n); | ||
_fileName[n] = '\0'; | ||
_fileName = new char [n+1]; | ||
strcpy(_fileName, filename); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strcpy stops if it finds a null character during the copy, which is not what we want. Please change it back
@flagarde Also TravisCI is failing. Please have a look |
Please give a bit detailed explanation about you changes with different bullet points. |