forked from lijiext/lammps
Merge branch 'cmake' of github.com:junghans/lammps into cmake
This commit is contained in:
commit
c7e218f310
|
@ -5,6 +5,7 @@ set(SOVERSION 0)
|
|||
set(LAMMPS_SOURCE_DIR ${CMAKE_SOURCE_DIR}/../src)
|
||||
set(LAMMPS_LIB_SOURCE_DIR ${CMAKE_SOURCE_DIR}/../lib)
|
||||
|
||||
# Cmake modules/macros are in a subdirectory to keep this file cleaner
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/Modules)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_C_FLAGS)
|
||||
|
@ -39,7 +40,7 @@ find_package(UnixCommands)
|
|||
|
||||
option(CMAKE_VERBOSE_MAKEFILE "Verbose makefile" OFF)
|
||||
|
||||
set(PACKAGES ASPHERE REAX)
|
||||
set(PACKAGES ASPHERE KSPACE REAX)
|
||||
foreach(PKG ${PACKAGES})
|
||||
option(ENABLE_${PKG} "Build ${PKG} Package" OFF)
|
||||
endforeach()
|
||||
|
@ -49,6 +50,15 @@ foreach(PKG ${ACCEL_PACKAGES})
|
|||
option(ENABLE_${PKG} "Build ${PKG} Package" OFF)
|
||||
endforeach()
|
||||
|
||||
if(ENABLE_KSPACE)
|
||||
find_package(FFTW3)
|
||||
if(FFTW3_FOUND)
|
||||
add_definitions(-DFFT_FFTW3)
|
||||
include_directories(${FFTW3_INCLUDE_DIRS})
|
||||
list(APPEND LAMMPS_LINK_LIBS ${FFTW3_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(JPEG)
|
||||
if(JPEG_FOUND)
|
||||
add_definitions(-DLAMMPS_JPEG)
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
# - Find fftw3
|
||||
# Find the native FFTW3 headers and libraries.
|
||||
#
|
||||
# FFTW3_INCLUDE_DIRS - where to find fftw3.h, etc.
|
||||
# FFTW3_LIBRARIES - List of libraries when using fftw3.
|
||||
# FFTW3_FOUND - True if fftw3 found.
|
||||
#
|
||||
|
||||
find_package(PkgConfig)
|
||||
|
||||
pkg_check_modules(PC_FFTW3 fftw3)
|
||||
find_path(FFTW3_INCLUDE_DIR fftw3.h HINTS ${PC_FFTW3_INCLUDE_DIRS})
|
||||
|
||||
find_library(FFTW3_LIBRARY NAMES fftw3 HINTS ${PC_FFTW3_LIBRARY_DIRS})
|
||||
|
||||
set(FFTW3_LIBRARIES ${FFTW3_LIBRARY})
|
||||
set(FFTW3_INCLUDE_DIRS ${FFTW3_INCLUDE_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set FFTW3_FOUND to TRUE
|
||||
# if all listed variables are TRUE
|
||||
|
||||
find_package_handle_standard_args(FFTW3 DEFAULT_MSG FFTW3_LIBRARY FFTW3_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(FFTW3_INCLUDE_DIR FFTW3_LIBRARY )
|
Loading…
Reference in New Issue