File: CMakeLists.txt

package info (click to toggle)
liggghts 3.5.0%2Brepack1-10
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 28,712 kB
  • ctags: 14,082
  • sloc: cpp: 136,869; ansic: 1,446; python: 676; sh: 603; makefile: 358
file content (87 lines) | stat: -rw-r--r-- 3,005 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# ENABLE_PACKAGE: enable PACKAGE-modules (OFF by default)
# ENABLE_PACKAGEUSER: enable PACKAGEUSER-modules (OFF by default)
# SUFFIX: add sufix to binary-name (NONE by default)
# USERPATH: use RPATH for search of the shared library libliggghts, need to be switched on by packaging (ON by default)
# VERSION: version number (2.2 by default)
# LIB_SUFFIX: suffix, where libliggghts library will be installed, lib/${LIB_SUFFIX} (NONE by default)

PROJECT(LIGGGHTS C CXX)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

SET(CMAKE_VERBOSE_MAKEFILE 1)
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cMake")

SET(VERSION 3.3.1)
#=======================================

FIND_PACKAGE(Boost COMPONENTS mpi serialization REQUIRED)
INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIRS})
#=======================================

INCLUDE(GNUInstallDirs)
INCLUDE(FindPythonLibs)
FIND_PACKAGE(VTK COMPONENTS vtkChartsCore vtkViewsContext2D vtkCommonCore vtkIOImage vtkIOXML vtkRenderingOpenGL  vtkIOLegacy vtkIOParallelXML)
INCLUDE(${VTK_USE_FILE})
IF(VTK_FOUND)
  IF(${VTK_MAJOR_VERSION} EQUAL 6)
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLAMMPS_VTK6 -DLAMMPS_VTK")
    MESSAGE(STATUS "Found VTK6")
  ELSE(${VTK_MAJOR_VERSION} EQUAL 6)
    LINK_DIRECTORIES(${VTK_LIBRARY_DIRS})
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLAMMPS_VTK")
    MESSAGE(STATUS "Found VTK")
  ENDIF(${VTK_MAJOR_VERSION} EQUAL 6)
  INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS})
  
  FIND_PACKAGE(Eigen3 REQUIRED)
  INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR})
  MESSAGE(STATUS "Found Eigen3")
ELSE(VTK_FOUND)
  MESSAGE(STATUS "VTK NOT found!")
ENDIF(VTK_FOUND)

#=======================================
SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -std=c++0x")

INCLUDE(FindJPEG)
IF(JPEG_FOUND)
  INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR})
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLAMMPS_JPEG")
ELSE(JPEG_FOUND)
  MESSAGE(STATUS "JPEG NOT found!")
ENDIF(JPEG_FOUND)

#=======================================

INCLUDE(FindMPI)
IF(MPI_C_FOUND AND MPI_CXX_FOUND)
  SET(CMAKE_C_COMPILER ${MPI_C_COMPILER})
  SET(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
ELSE(MPI_C_FOUND AND MPI_CXX_FOUND)
  #Check old FindMPI version
  IF(MPI_COMPILER)
    SET(CMAKE_C_COMPILER ${MPI_COMPILER})
    SET(CMAKE_CXX_COMPILER ${MPI_COMPILER})
  ELSE(MPI_COMPILER)
    MESSAGE(FATAL_ERROR "MPI-COMPILER NOT found!")
  ENDIF(MPI_COMPILER)
ENDIF(MPI_C_FOUND AND MPI_CXX_FOUND)

#=======================================

#Disabled modules
#GPU KIM MEAM POEMS REAX SRD
IF(ENABLE_PACKAGE)
  SET(MODULES_PACKAGE ASPHERE CLASS2 COLLOID DIPOLE FLD GRANULAR KSPACE MANYBODY MC MOLECULE OPT PERI REPLICA SHOCK  XTC)
ENDIF(ENABLE_PACKAGE)
#Disabled modules
#USER-MISC
IF(ENABLE_PACKAGEUSER)
  SET(MODULES_USER USER-ATC USER-AWPMD USER-CG-CMM USER-CUDA USER-EFF USER-EWALDN USER-OMP USER-REAXC USER-SPH)
ENDIF(ENABLE_PACKAGEUSER)
#=======================================

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)

ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/src")