update make purge list and fix checking for styles and installed package files in cmake

This commit is contained in:
Axel Kohlmeyer
2018-06-22 07:57:03 -04:00
parent f0a2c57401
commit 04d040b863
2 changed files with 25 additions and 4 deletions

View File

@ -25,15 +25,28 @@ endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
file(GLOB SRC_FILES ${LAMMPS_SOURCE_DIR}/*.cpp)
list(SORT SRC_FILES)
# check for files installed by make-based buildsystem
# check for files auto-generated by make-based buildsystem
# this is fast, so check for it all the time
message(STATUS "Running check for auto-generated files from make-based build system")
file(GLOB SRC_AUTOGEN_FILES ${LAMMPS_SOURCE_DIR}/style_*.h)
list(APPEND SRC_AUTOGEN_FILES ${LAMMPS_SOURCE_DIR}/lmpinstalledpkgs.h)
foreach(_SRC ${SRC_AUTOGEN_FILES})
get_filename_component(FILENAME "${_SRC}" NAME)
if(EXISTS ${LAMMPS_SOURCE_DIR}/${FILENAME})
message(FATAL_ERROR "\nFound file(s) generated by the make-based build system.\nPlease run 'make -C ${LAMMPS_SOURCE_DIR} purge'")
endif()
endforeach()
# check for files installed by make-based buildsystem
# only run this time consuming check if there are new files
if(NOT SRC_FILES STREQUAL SRC_FILES_CACHED)
file(GLOB SRC_PKG_FILES ${LAMMPS_SOURCE_DIR}/*/*.cpp)
message(STATUS "Running check for installed package (this might take a while)")
foreach(_SRC SRC_PKG_FILES)
message(STATUS "Running check for packages installed with 'make yes-<package>' (this may take a while)")
foreach(_SRC ${SRC_PKG_FILES})
get_filename_component(FILENAME "${_SRC}" NAME)
if(EXISTS ${LAMMPS_SOURCE_DIR}/${FILENAME})
message(FATAL_ERROR "Found packages installed by the make-based buildsystem, please run 'make -C ${LAMMPS_SOURCE_DIR} no-all purge'")
message(FATAL_ERROR "\nFound package(s) installed by the make-based build system\nPlease run 'make -C ${LAMMPS_SOURCE_DIR} no-all purge'")
endif()
endforeach()
set(SRC_FILES_CACHED "${SRC_FILES}" CACHE INTERNAL "List of file in LAMMPS_SOURCE_DIR" FORCE)

View File

@ -1,6 +1,7 @@
# auto-generated style files
style_angle.h
style_atom.h
style_body.h
style_bond.h
style_command.h
style_compute.h
@ -12,10 +13,17 @@ style_integrate.h
style_kspace.h
style_minimize.h
style_pair.h
style_reader.h
style_region.h
style_neigh_bin.h
style_neigh_pair.h
style_neigh_stencil.h
style_nbin.h
style_npair.h
style_nstencil.h
style_ntopo.h
# other auto-generated files
lmpinstalledpkgs.h
# deleted on 4 April 2018
pair_kim_version.h
# deleted on 15 December 2017