Skip to content
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

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

[WIP] Some modernization and this should fix #68, #29 #89

wants to merge 20 commits into from

Conversation

flagarde
Copy link
Contributor

@flagarde flagarde commented Jul 17, 2020

CMakeLists.txt Outdated Show resolved Hide resolved
@flagarde
Copy link
Contributor Author

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)
Copy link
Contributor

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.

Copy link
Contributor Author

@flagarde flagarde Jul 22, 2020

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 )
Copy link
Contributor

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

Copy link
Contributor Author

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")
Copy link
Contributor

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.

Copy link
Contributor Author

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" )
Copy link
Contributor

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 .

Copy link
Contributor Author

@flagarde flagarde Jul 22, 2020

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" )
Copy link
Contributor

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" )
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor Author

@flagarde flagarde Jul 22, 2020

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

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}" )
Copy link
Contributor

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)
Copy link
Contributor

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);
Copy link
Contributor

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

@rete
Copy link
Contributor

rete commented Jul 22, 2020

@flagarde Also TravisCI is failing. Please have a look

@rete rete changed the title Some modernization and this should fix #68, #29 [WIP] Some modernization and this should fix #68, #29 Jul 22, 2020
@rete
Copy link
Contributor

rete commented Jul 22, 2020

Please give a bit detailed explanation about you changes with different bullet points.
LCIO is core package. Keeping track of changes at this level is crucial

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.

FindROOT.cmake should be removed
3 participants