if(GMX_EXTERNAL_BOOST)
include_directories(${Boost_INCLUDE_DIRS})
+ set(PKG_CFLAGS "${PKG_CFLAGS} -I${Boost_INCLUDE_DIRS}")
else()
include_directories(${CMAKE_SOURCE_DIR}/src/external/boost)
# typeid not supported for minimal internal version
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8)
project(template)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif(NOT CMAKE_BUILD_TYPE)
-enable_language(C)
-
option(GMX_DOUBLE "Use double precision" OFF)
########################################################################
STRING(REPLACE /MD /MT CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
SET(CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} CACHE STRING "" FORCE)
STRING(REPLACE /MD /MT CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
- SET(CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG} CACHE STRING "" FORCE)
+ SET(CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG} CACHE STRING "" FORCE)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio")
########################################################################
FIND_PACKAGE(GROMACS COMPONENTS ${LIBGROMACS} REQUIRED)
message("GROMACS version ${GROMACS_VERSION_STRING} found")
-if ("${GROMACS_VERSION_STRING}" VERSION_LESS "4.6" OR "${GROMACS_VERSION_STRING}" VERSION_GREATER "4.99")
- message(FATAL_ERROR "This template works only with GROMACS 4.6")
-endif ("${GROMACS_VERSION_STRING}" VERSION_LESS "4.6" OR "${GROMACS_VERSION_STRING}" VERSION_GREATER "4.99")
+if ("${GROMACS_VERSION_STRING}" VERSION_LESS "5.0")
+ message(FATAL_ERROR "This template works with GROMACS 5.0 (and possibly later versions)")
+endif()
add_definitions( ${GROMACS_DEFINITIONS} )
include_directories( ${GROMACS_INCLUDE_DIRS} )
-########################################################################
-# Specify install locations and which subdirectories to process #
-########################################################################
-set(BIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin)
-
-add_executable(template template.c)
+add_executable(template template.cpp)
target_link_libraries(template ${GROMACS_LIBRARIES})
-# This is a Gromacs 4.5 template makefile for your own utility programs using pkg-config.
+# This is a Gromacs template makefile for your own utility programs using pkg-config.
#
# Copy this file to whatever directory you are using for your own software
#
#change the name of the program here
NAME=template
-#add extra c file to compile here
+#add extra c++ file(s) to compile here
EXTRA_SRC=
###############################################################3
endif
#get CPPFLAGS and LDFLAGS from pkg-config
-CPPFLAGS=`pkg-config --cflags libgmx`
-LDFLAGS=`pkg-config --libs libgmx`
+CPPFLAGS=`pkg-config --cflags libgromacs`
+LDFLAGS=`pkg-config --libs libgromacs`
#generate a list of object (.o) files
-OBJS=$(patsubst %.c,%.o,$(NAME).c $(EXTRA_SRC))
+OBJS=$(patsubst %.cpp,%.o,$(NAME).cpp $(EXTRA_SRC))
#main program depend on all objects, rest is done by implicit rules
$(NAME): $(OBJS)
+ $(CXX) $(LDFLAGS) -o $@ $^
#clean up rule
clean:
+++ /dev/null
-# Generated automatically from Makefile.in by configure.
-#
-# This is a Gromacs 4.5 template makefile for your own utility programs.
-#
-# Copy this file to whatever directory you are using for your own
-# software and add more targets like the template one below.
-#
-# If you are using gmake it is relatively straightforward to add
-# an include based on environment variables (like previous Gromacs versions)
-# to select compiler flags and stuff automatically, but below it is static:
-#
-
-# Variables set by the configuration script:
-LIBS = @LIBS@
-LDFLAGS = @LDFLAGS@
-CFLAGS = @CFLAGS@
-CC = @CC@
-LD = $(CC)
-
-# The real make targets - note that most make programs support
-# the shortcut $^ instead of listing all object files a second
-# time, but we cannot count on it...
-
-template: template.o
- $(LD) $(LDFLAGS) -o $@ template.o $(LIBS)
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2009-2011, by the VOTCA Development Team (http://www.votca.org)
-# Copyright (c) 2012,2013, by the GROMACS development team, led by
+# Copyright (c) 2009-2011, by the VOTCA Development Team (http://www.votca.org).
+# Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
# the research papers on the package. Check out http://www.gromacs.org.
# - Finds parts of GROMACS
-# Find the native GROMACS compents headers and libraries.
+# Find the native GROMACS components headers and libraries.
#
# GROMACS_INCLUDE_DIRS - where to find GROMACS headers.
# GROMACS_LIBRARIES - List of libraries when used by GROMACS.
find_path(GROMACS_INCLUDE_DIR gromacs/tpxio.h HINTS ${PC_GROMACS_INCLUDE_DIRS})
endif(${GROMACS_VERSION} EQUAL 40000)
elseif("${GROMACS_PKG}" MATCHES "libgromacs")
- find_path(GROMACS_INCLUDE_DIR gromacs/legacyheaders/tpxio.h HINTS ${PC_GROMACS_INCLUDE_DIRS})
+ find_path(GROMACS_INCLUDE_DIR gromacs/version.h HINTS ${PC_GROMACS_INCLUDE_DIRS})
endif("${GROMACS_PKG}" MATCHES "libgmx")
set(GROMACS_LIBRARIES "${GROMACS_LIBRARY};${GROMACS_DEP_LIBRARIES}" )
set(GROMACS_INCLUDE_DIRS ${GROMACS_INCLUDE_DIR} )
+if (PC_GROMACS_INCLUDE_DIRS)
+ list(APPEND GROMACS_INCLUDE_DIRS ${PC_GROMACS_INCLUDE_DIRS})
+endif(PC_GROMACS_INCLUDE_DIRS)
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set GROMACS_FOUND to TRUE