Skip to content
Snippets Groups Projects
Commit 635383c0 authored by Christoph Junghans's avatar Christoph Junghans
Browse files

cmake: cache check for installed packages

parent a001f2c2
No related branches found
No related tags found
No related merge requests found
...@@ -23,14 +23,21 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS) ...@@ -23,14 +23,21 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS) 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 installed by make-based buildsystem
file(GLOB SRC_STYLE_FILES ${LAMMPS_SOURCE_DIR}/*/*.cpp) # only run this time consuming check if there are new files
foreach(_SRC SRC_STYLE_FILES) if(NOT SRC_FILES STREQUAL SRC_FILES_CACHED)
get_filename_component(FILENAME "${_SRC}" NAME) file(GLOB SRC_PKG_FILES ${LAMMPS_SOURCE_DIR}/*/*.cpp)
if(EXISTS ${LAMMPS_SOURCE_DIR}/${FILENAME}) message(STATUS "Running check for installed package (this might take a while)")
message(FATAL_ERROR "Found packages installed by the make-based buildsystem, please run 'make -C ${LAMMPS_SOURCE_DIR} no-all purge'") foreach(_SRC SRC_PKG_FILES)
endif() get_filename_component(FILENAME "${_SRC}" NAME)
endforeach() 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'")
endif()
endforeach()
set(SRC_FILES_CACHED "${SRC_FILES}" CACHE INTERNAL "List of file in LAMMPS_SOURCE_DIR" FORCE)
endif()
enable_language(CXX) enable_language(CXX)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment