diff --git a/cmake/LibMultiScaleMacros.cmake b/cmake/LibMultiScaleMacros.cmake index 870f674..4d1d40e 100644 --- a/cmake/LibMultiScaleMacros.cmake +++ b/cmake/LibMultiScaleMacros.cmake @@ -1,155 +1,155 @@ #=============================================================================== # @file LibMultiScaleMacros.cmake # # @author Guillaume Anciaux <guillaume.anciaux@epfl.ch> # @author Nicolas Richart <nicolas.richart@epfl.ch> # # @date Sun Jan 06 01:16:34 2013 # # @brief General Macros for CMake build system of LM # # @section LICENSE # # Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) # Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) # # LibMultiScale is free software: you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version. # # LibMultiScale is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # # You should have received a copy of the GNU Lesser General Public License # along with LibMultiScale. If not, see <http://www.gnu.org/licenses/>. # #=============================================================================== #=============================================================================== function(compare_lists list1 list2 result) endfunction() #=============================================================================== include(CMakeDebugMessages) cmake_register_debug_message_module(ListGenerator) function(generate_list type file) string(TOUPPER ${type} _type) package_get_all_activated_packages(activated_list) foreach(_pkg ${activated_list}) _package_get_real_name(${_pkg} pkg) +# message(AAAA " , " ${_type} " , " ${_pkg} " , " ${pkg} " , " "${_type_list}") get_boost_list_from_package(${_type} ${pkg} _type_list) -# message(AAAA " " ${_type} " " ${_pkg} " " "${_type_list}") foreach(_line ${_type_list}) list(APPEND _list ${_line}) endforeach() endforeach() if(NOT "${_list}" STREQUAL "${LIBMULTISCALE_${_type}_LIST}" OR (NOT EXISTS ${file})) cmake_debug_message(ListGenerator "Generating LIBMULTISCALE_${_type}_LIST in ${file}") cmake_debug_message(ListGenerator " -- new list: ${_list}") cmake_debug_message(ListGenerator " -- old list: ${LIBMULTISCALE_${_type}_LIST}") file(WRITE "${file}" "#define LIST_${_type} \\") set(LIBMULTISCALE_${_type}_LIST ${_list} CACHE INTERNAL "") foreach(_line ${LIBMULTISCALE_${_type}_LIST}) file(APPEND "${file}" " ${_line} \\") endforeach() file(APPEND "${file}" " /* File Generated by CMake */") endif() endfunction() #=============================================================================== cmake_register_debug_message_module(HeaderListGenerator) function(generate_module_header_file module file) string(TOUPPER ${module} _module) cmake_debug_message(HeaderListGenerator "${module} - Package ${LIBMULTISCALE_PACKAGE_LIST}") package_get_all_activated_packages(activated_list) foreach(_pkg ${activated_list}) _package_get_real_name(${_pkg} pkg) cmake_debug_message(HeaderListGenerator "${module} - Package ${_pkg}") get_module_headers_from_package(${_module} ${pkg} _public_headers) foreach(_line ${_public_headers}) get_filename_component(_hdrs "${_line}" NAME) cmake_debug_message(HeaderListGenerator "${module} - ${_hdrs}") list(APPEND _list ${_hdrs}) endforeach() endforeach() if(NOT "${_list}" STREQUAL "${LIBMULTISCALE_${_module}_HDR_LIST}" OR (NOT EXISTS ${file})) # message(HeaderListGenerator "Generating LIBMULTISCALE_${_module}_HDR_LIST in ${file}") # message(HeaderListGenerator " -- new list: ${_list}") # message(HeaderListGenerator " -- old list: ${LIBMULTISCALE_${_module}_HDR_LIST}") set(LIBMULTISCALE_${_module}_HDR_LIST ${_list} CACHE INTERNAL "") get_filename_component(_file_we "${file}" NAME_WE) string(TOUPPER ${_file_we} _file_we) file(WRITE "${file}" "#ifndef __LIBMULTISCALE_${_file_we}_HH__ #define __LIBMULTISCALE_${_file_we}_HH__ /* -------------------------------------------------------------------------- */") foreach(_pkg ${activated_list}) _package_get_real_name(${_pkg} pkg) get_module_headers_from_package(${_module} ${pkg} _public_headers) if (_public_headers) file(APPEND "${file}" " /* ${_pkg} */") foreach(_line ${_public_headers}) get_filename_component(_hdrs "${_line}" NAME) file(APPEND "${file}" " #include \"${_hdrs}\"") endforeach() endif() endforeach() file(APPEND "${file}" " /* -------------------------------------------------------------------------- */ #endif // __LIBMULTISCALE_${_file_we}_HH__") endif() endfunction() #=============================================================================== function(get_module_headers_from_package module package HEADERS) string(TOUPPER ${module} _module) package_get_name(${package} _package) # message("fetch " ${_module}_HEADERS_${_package} " " ${${_module}_HEADERS_${_package}}) set(${HEADERS} ${${_module}_HEADERS_${_package}} PARENT_SCOPE) endfunction() #=============================================================================== function(set_module_headers_from_package module package) string(TOUPPER ${module} _module) package_get_name(${package} _package) # message(setting " " ${_module}_HEADERS_${_package} " to " ${ARGN}) set(${_module}_HEADERS_${_package} ${_headers} ${ARGN} CACHE INTERNAL "" FORCE) endfunction() #=============================================================================== function(declare_boost_list_from_package type package) string(TOUPPER ${type} _type) package_get_name(${package} _package) set(_list ${ARGN}) # message(setting " " ${_type}_BOOST_LIST_${_package} " to " ${_list}) set(${_type}_BOOST_LIST_${_package} ${_list} CACHE INTERNAL "" FORCE) endfunction() #=============================================================================== function(get_boost_list_from_package type package LIST) string(TOUPPER ${type} _type) package_get_name(${package} _package) # message("fetch " ${_type}_BOOST_LIST_${_package}) set(${LIST} ${${_type}_BOOST_LIST_${_package}} PARENT_SCOPE) endfunction() diff --git a/packages/boost.cmake b/packages/boost.cmake deleted file mode 100644 index 5531401..0000000 --- a/packages/boost.cmake +++ /dev/null @@ -1,29 +0,0 @@ -#=============================================================================== -# @file boost.cmake -# -# @author Nicolas Richart <nicolas.richart@epfl.ch> -# -# @date Thu Dec 20 17:16:00 2012 -# -# @brief Boost library package -# -# @section LICENSE -# -# Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) -# Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) -# -# LibMultiScale is free software: you can redistribute it and/or modify it under the -# terms of the GNU Lesser General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) any -# later version. -# -# LibMultiScale is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more -# details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with LibMultiScale. If not, see <http://www.gnu.org/licenses/>. -# -#=============================================================================== - diff --git a/packages/mandatory_packages.cmake b/packages/mandatory_packages.cmake index 60fdee7..c2c0165 100644 --- a/packages/mandatory_packages.cmake +++ b/packages/mandatory_packages.cmake @@ -1,70 +1,70 @@ #=============================================================================== # @file mandatory_packages.cmake # # @author Guillaume Anciaux <guillaume.anciaux@epfl.ch> # @author Nicolas Richart <nicolas.richart@epfl.ch> # # @date Wed Mar 06 12:17:42 2013 # # @brief All mandatory packages # # @section LICENSE # # Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) # Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) # # LibMultiScale is free software: you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version. # # LibMultiScale is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # # You should have received a copy of the GNU Lesser General Public License # along with LibMultiScale. If not, see <http://www.gnu.org/licenses/>. # #=============================================================================== package_declare(mandatory_packages NOT_OPTIONAL DESCRIPTION "meta package for mandatory external packages" - DEPENDS PythonLibs lapack mpi expat fftw gsl #boost fftw expat zlib + DEPENDS PythonLibs lapack mpi expat fftw gsl zlib #boost fftw expat zlib ) #add_external_package(MPI) # #add_external_package(Boost PREFIX Boost) #list(APPEND LIBMULTISCALE_EXTERNAL_LIB_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/src) #list(APPEND LIBMULTISCALE_BOOST_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/src/boost) # ##Not using the macro because the python module is shity #find_package(PythonLibs REQUIRED 2.7) #if(PYTHONLIBS_FOUND) # list(APPEND LIBMULTISCALE_DEFINITIONS LIBMULTISCALE_USE_PYTHON) # list(APPEND LIBMULTISCALE_EXTERNAL_LIB_INCLUDE_DIR ${PYTHON_INCLUDE_DIR}) # list(APPEND LIBMULTISCALE_EXTERNAL_LIBRARIES ${PYTHON_LIBRARIES}) # # set(LIBMULTISCALE_PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIR}) # set(LIBMULTISCALE_PYTHON_LIBRARIES ${PYTHON_LIBRARIES}) # set(LIBMULTISCALE_PYTHON ON) # # list(APPEND LIBMULTISCALE_OPTION_LIST PYTHON) #endif() # #add_external_package(FFTW) #add_external_package(GSL) #add_external_package(LAPACK) #add_external_package(EXPAT) #add_optional_external_package(QVIEW "Activate the QView monitoring feature" OFF) #if (LIBMULTISCALE_USE_QVIEW) # add_definitions(-DUSING_QVIEW) #endif(LIBMULTISCALE_USE_QVIEW) #mark_as_advanced(LIBMULTISCALE_USE_QVIEW) # #add_optional_external_package(ZLIB "Activate the ZLIB compression feature" OFF) #if (LIBMULTISCALE_USE_ZLIB) # add_definitions(-DLIBMULTISCALE_USE_ZLIB) #endif(LIBMULTISCALE_USE_ZLIB) # diff --git a/packages/timer.cmake b/packages/timer.cmake index 222b08e..ca3800b 100644 --- a/packages/timer.cmake +++ b/packages/timer.cmake @@ -1,36 +1,35 @@ #=============================================================================== # @file timer.cmake # # @author Guillaume Anciaux <guillaume.anciaux@epfl.ch> # # @date Mon Jul 28 12:20:03 2014 # # @brief Timer package # # @section LICENSE # # Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) # Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) # # LibMultiScale is free software: you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version. # # LibMultiScale is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # # You should have received a copy of the GNU Lesser General Public License # along with LibMultiScale. If not, see <http://www.gnu.org/licenses/>. # #=============================================================================== -option(LIBMULTISCALE_TIMER "Enable timing of functions" OFF) -if (LIBMULTISCALE_TIMER) - add_definitions(-DLIBMULTISCALE_TIMER) -endif(LIBMULTISCALE_TIMER) +package_declare(TIMER + DESCRIPTION "Enable timing of functions" + DEFAULT OFF + ) -mark_as_advanced(LIBMULTISCALE_TIMER) \ No newline at end of file diff --git a/packages/trace_atom.cmake b/packages/trace_atom.cmake index 4ebf8ff..607aa62 100644 --- a/packages/trace_atom.cmake +++ b/packages/trace_atom.cmake @@ -1,36 +1,44 @@ #=============================================================================== # @file trace_atom.cmake # # @author Guillaume Anciaux <guillaume.anciaux@epfl.ch> # # @date Mon Jul 28 12:20:03 2014 # # @brief Debugging tool for tracing packages # # @section LICENSE # # Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) # Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) # # LibMultiScale is free software: you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version. # # LibMultiScale is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # # You should have received a copy of the GNU Lesser General Public License # along with LibMultiScale. If not, see <http://www.gnu.org/licenses/>. # #=============================================================================== -option(LIBMULTISCALE_TRACE_ATOM "Enable system for tracing of atoms" OFF) +package_declare(TRACE_ATOM + DESCRIPTION "Enable system for tracing of atoms" + DEFAULT OFF + ADVANCED + ) -if (LIBMULTISCALE_TRACE_ATOM) + +package_get_name(LAMMPS _pkg_name) +_package_get_option_name(${_pkg_name} _option_name) + +if (${_option_name}) add_definitions(-DTRACE_ATOM) -endif(LIBMULTISCALE_TRACE_ATOM) +endif() -mark_as_advanced(LIBMULTISCALE_TRACE_ATOM) \ No newline at end of file +#mark_as_advanced(LIBMULTISCALE_TRACE_ATOM) \ No newline at end of file