This repository has been archived by the owner on Oct 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
72 lines (64 loc) · 2.44 KB
/
CMakeLists.txt
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
# libgmxcpp
#
# Copyright (C) 2015 James W. Barnett <jbarnet4@tulane.edu>
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# This program 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 General Public License for more details.
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 51
# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# The full license is located in a text file titled "LICENSE" in the root
# directory of the source.
cmake_minimum_required(VERSION 2.8)
project(gmxcpp)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
# -------------------------
# Package version
# -------------------------
file ( STRINGS "${CMAKE_SOURCE_DIR}/.VERSION" VERSION )
string( REPLACE "." ";" VERSION_LIST ${VERSION} )
list(GET VERSION_LIST 0 VERSION_MAJOR)
list(GET VERSION_LIST 1 VERSION_MINOR)
list(GET VERSION_LIST 2 VERSION_PATCH)
set(PROJECT_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
message ( STATUS "CMake build configuration for ${CMAKE_PROJECT_NAME} ${PROJECT_VERSION}" )
string ( TOLOWER ${CMAKE_PROJECT_NAME} PACKAGE_NAME )
set ( PACKAGE_VERSION "${PACKAGE_NAME}-${VERSION}" )
# --------------------------
# Optional banner
# --------------------------
set(BANNER ON CACHE INTERNAL "")
if(${BANNER})
add_definitions(-DBANNER)
else()
message(STATUS "Compiling without banner.")
endif()
# ----------------------------------
# Add AVX instructions if requested
# ---------------------------------
set(AVX OFF CACHE INTERNAL "")
if(${AVX})
set(CMAKE_CXX_FLAGS "-O3 -Wall -march=native")
else()
set(CMAKE_CXX_FLAGS "-O3 -Wall")
endif()
add_subdirectory(include)
include_directories(include)
add_subdirectory(src)
add_subdirectory(docs)
# ----------------------------------
# Tests
# ---------------------------------
add_subdirectory(tests)
enable_testing()
add_test(coordinates tests/coordinates_test)
add_test(triclinicbox tests/triclinicbox_test)
add_test(Utils tests/Utils_test)
add_test(Trajectory tests/Trajectory_test)
add_test(Clusters tests/Clusters_test)
add_test(Topology tests/Topology_test)