From 8f8aee65d20f9b11ab4e7f70e9412202ae9fdfc5 Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Thu, 6 Sep 2018 14:37:08 -0600 Subject: [PATCH 1/2] cmake: fix globbing of emacs files Done by: sed -i '/GLOB/s@/\*\.@/[^.]*.@g' CMakeLists.txt --- cmake/CMakeLists.txt | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 2e238cdf2b..45e6870ce8 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -13,7 +13,7 @@ get_filename_component(LAMMPS_DOC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../doc ABSOLUT # To avoid conflicts with the conventional Makefile build system, we build everything here -file(GLOB LIB_SOURCES ${LAMMPS_SOURCE_DIR}/*.cpp) +file(GLOB LIB_SOURCES ${LAMMPS_SOURCE_DIR}/[^.]*.cpp) file(GLOB LMP_SOURCES ${LAMMPS_SOURCE_DIR}/main.cpp) list(REMOVE_ITEM LIB_SOURCES ${LMP_SOURCES}) @@ -348,7 +348,7 @@ if(PKG_MSCG OR PKG_USER-ATC OR PKG_USER-AWPMD OR PKG_USER-QUIP OR PKG_LATTE) find_package(BLAS) if(NOT LAPACK_FOUND OR NOT BLAS_FOUND) enable_language(Fortran) - file(GLOB LAPACK_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/linalg/*.[fF]) + file(GLOB LAPACK_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/linalg/[^.]*.[fF]) add_library(linalg STATIC ${LAPACK_SOURCES}) set(LAPACK_LIBRARIES linalg) else() @@ -603,7 +603,7 @@ endif() if(PKG_MESSAGE) option(MESSAGE_ZMQ "Use ZeroMQ in MESSAGE package" OFF) - file(GLOB_RECURSE cslib_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/*.F + file(GLOB_RECURSE cslib_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.F ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/*.c ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/*.cpp) if(BUILD_SHARED_LIBS) @@ -720,8 +720,8 @@ RegisterStyles(${LAMMPS_SOURCE_DIR}) foreach(PKG ${DEFAULT_PACKAGES}) set(${PKG}_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/${PKG}) - file(GLOB ${PKG}_SOURCES ${${PKG}_SOURCES_DIR}/*.cpp) - file(GLOB ${PKG}_HEADERS ${${PKG}_SOURCES_DIR}/*.h) + file(GLOB ${PKG}_SOURCES ${${PKG}_SOURCES_DIR}/[^.]*.cpp) + file(GLOB ${PKG}_HEADERS ${${PKG}_SOURCES_DIR}/[^.]*.h) # check for package files in src directory due to old make system DetectBuildSystemConflict(${LAMMPS_SOURCE_DIR} ${${PKG}_SOURCES} ${${PKG}_HEADERS}) @@ -739,8 +739,8 @@ endforeach() foreach(PKG ${ACCEL_PACKAGES}) set(${PKG}_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/${PKG}) - file(GLOB ${PKG}_SOURCES ${${PKG}_SOURCES_DIR}/*.cpp) - file(GLOB ${PKG}_HEADERS ${${PKG}_SOURCES_DIR}/*.h) + file(GLOB ${PKG}_SOURCES ${${PKG}_SOURCES_DIR}/[^.]*.cpp) + file(GLOB ${PKG}_HEADERS ${${PKG}_SOURCES_DIR}/[^.]*.h) # check for package files in src directory due to old make system DetectBuildSystemConflict(${LAMMPS_SOURCE_DIR} ${${PKG}_SOURCES} ${${PKG}_HEADERS}) @@ -754,7 +754,7 @@ foreach(SIMPLE_LIB REAX MEAM POEMS USER-ATC USER-AWPMD USER-COLVARS USER-H5MD if(PKG_${SIMPLE_LIB}) string(REGEX REPLACE "^USER-" "" PKG_LIB "${SIMPLE_LIB}") string(TOLOWER "${PKG_LIB}" PKG_LIB) - file(GLOB_RECURSE ${PKG_LIB}_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/*.F + file(GLOB_RECURSE ${PKG_LIB}_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.F ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/*.c ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/*.cpp) add_library(${PKG_LIB} STATIC ${${PKG_LIB}_SOURCES}) list(APPEND LAMMPS_LINK_LIBS ${PKG_LIB}) @@ -1039,7 +1039,7 @@ if(PKG_GPU) set(GPU_PREC_SETTING "SINGLE_SINGLE") endif() - file(GLOB GPU_LIB_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/gpu/*.cpp) + file(GLOB GPU_LIB_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cpp) file(MAKE_DIRECTORY ${LAMMPS_LIB_BINARY_DIR}/gpu) if(GPU_API STREQUAL "CUDA") @@ -1052,15 +1052,15 @@ if(PKG_GPU) set(GPU_ARCH "sm_30" CACHE STRING "LAMMPS GPU CUDA SM architecture (e.g. sm_60)") - file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/*.cu) + file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/[^.]*.cu) list(REMOVE_ITEM GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_pppm.cu) cuda_include_directories(${LAMMPS_LIB_SOURCE_DIR}/gpu ${LAMMPS_LIB_BINARY_DIR}/gpu) if(CUDPP_OPT) cuda_include_directories(${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini) - file(GLOB GPU_LIB_CUDPP_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/*.cpp) - file(GLOB GPU_LIB_CUDPP_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/*.cu) + file(GLOB GPU_LIB_CUDPP_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/[^.]*.cpp) + file(GLOB GPU_LIB_CUDPP_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/[^.]*.cu) endif() cuda_compile_cubin(GPU_GEN_OBJS ${GPU_LIB_CU} OPTIONS @@ -1109,7 +1109,7 @@ if(PKG_GPU) include(OpenCLUtils) set(OCL_COMMON_HEADERS ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_preprocessor.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_aux_fun1.h) - file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/*.cu) + file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu) list(REMOVE_ITEM GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_gayberne.cu ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_gayberne_lj.cu) foreach(GPU_KERNEL ${GPU_LIB_CU}) @@ -1236,7 +1236,7 @@ if(BUILD_DOC) set(VIRTUALENV ${PYTHON_EXECUTABLE} -m virtualenv) - file(GLOB DOC_SOURCES ${LAMMPS_DOC_DIR}/src/*.txt) + file(GLOB DOC_SOURCES ${LAMMPS_DOC_DIR}/src/[^.]*.txt) file(GLOB PDF_EXTRA_SOURCES ${LAMMPS_DOC_DIR}/src/lammps_commands*.txt ${LAMMPS_DOC_DIR}/src/lammps_support.txt ${LAMMPS_DOC_DIR}/src/lammps_tutorials.txt) list(REMOVE_ITEM DOC_SOURCES ${PDF_EXTRA_SOURCES}) From 861a7acdf0b9de61dade59ef873e1f338673a9d2 Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Fri, 7 Sep 2018 06:40:06 -0600 Subject: [PATCH 2/2] cmake: fix globbing in some more places --- cmake/CMakeLists.txt | 9 ++++++--- cmake/Modules/StyleHeaderUtils.cmake | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 45e6870ce8..21170a384d 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -604,7 +604,8 @@ endif() if(PKG_MESSAGE) option(MESSAGE_ZMQ "Use ZeroMQ in MESSAGE package" OFF) file(GLOB_RECURSE cslib_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.F - ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/*.c ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/*.cpp) + ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.c + ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.cpp) if(BUILD_SHARED_LIBS) add_library(cslib SHARED ${cslib_SOURCES}) @@ -754,8 +755,10 @@ foreach(SIMPLE_LIB REAX MEAM POEMS USER-ATC USER-AWPMD USER-COLVARS USER-H5MD if(PKG_${SIMPLE_LIB}) string(REGEX REPLACE "^USER-" "" PKG_LIB "${SIMPLE_LIB}") string(TOLOWER "${PKG_LIB}" PKG_LIB) - file(GLOB_RECURSE ${PKG_LIB}_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.F - ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/*.c ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/*.cpp) + file(GLOB_RECURSE ${PKG_LIB}_SOURCES + ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.F + ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.c + ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.cpp) add_library(${PKG_LIB} STATIC ${${PKG_LIB}_SOURCES}) list(APPEND LAMMPS_LINK_LIBS ${PKG_LIB}) if(PKG_LIB STREQUAL awpmd) diff --git a/cmake/Modules/StyleHeaderUtils.cmake b/cmake/Modules/StyleHeaderUtils.cmake index d621e4c9c0..a89d098dd0 100644 --- a/cmake/Modules/StyleHeaderUtils.cmake +++ b/cmake/Modules/StyleHeaderUtils.cmake @@ -94,14 +94,14 @@ function(RegisterStyles search_path) FindStyleHeaders(${search_path} ATOM_CLASS atom_vec_ ATOM_VEC ) # atom ) # atom atom_vec_hybrid FindStyleHeaders(${search_path} BODY_CLASS body_ BODY ) # body ) # atom_vec_body FindStyleHeaders(${search_path} BOND_CLASS bond_ BOND ) # bond ) # force - FindStyleHeaders(${search_path} COMMAND_CLASS "" COMMAND ) # command ) # input + FindStyleHeaders(${search_path} COMMAND_CLASS "[^.]" COMMAND ) # command ) # input FindStyleHeaders(${search_path} COMPUTE_CLASS compute_ COMPUTE ) # compute ) # modify FindStyleHeaders(${search_path} DIHEDRAL_CLASS dihedral_ DIHEDRAL ) # dihedral ) # force FindStyleHeaders(${search_path} DUMP_CLASS dump_ DUMP ) # dump ) # output write_dump FindStyleHeaders(${search_path} FIX_CLASS fix_ FIX ) # fix ) # modify FindStyleHeaders(${search_path} IMPROPER_CLASS improper_ IMPROPER ) # improper ) # force - FindStyleHeaders(${search_path} INTEGRATE_CLASS "" INTEGRATE ) # integrate ) # update - FindStyleHeaders(${search_path} KSPACE_CLASS "" KSPACE ) # kspace ) # force + FindStyleHeaders(${search_path} INTEGRATE_CLASS "[^.]" INTEGRATE ) # integrate ) # update + FindStyleHeaders(${search_path} KSPACE_CLASS "[^.]" KSPACE ) # kspace ) # force FindStyleHeaders(${search_path} MINIMIZE_CLASS min_ MINIMIZE ) # minimize ) # update FindStyleHeaders(${search_path} NBIN_CLASS nbin_ NBIN ) # nbin ) # neighbor FindStyleHeaders(${search_path} NPAIR_CLASS npair_ NPAIR ) # npair ) # neighbor