More hacking to get the template to detect and build
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 2 Sep 2014 15:40:56 +0000 (17:40 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 3 Sep 2014 20:41:35 +0000 (22:41 +0200)
Change-Id: Ifa945dedfcd70a571171fb156d5eaad37e1d761c

share/template/cmake/FindGROMACS.cmakein

index 53fec7136143b54288fa73d3d2cd57cdeef55972..f50d356a35c6c8155e89e4b97125828c630ddf7b 100644 (file)
@@ -155,8 +155,14 @@ endif(PC_GROMACS_INCLUDE_DIRS)
 
 if(NOT ${GROMACS_MAJOR_VERSION} LESS 5)
     include(CheckIncludeFile)
-    # Let find_package find the subset of Boost installed with GROMACS
-    set(BOOST_INCLUDEDIR ${GROMACS_INCLUDE_DIRS}/gromacs/external/boost)
+    # Let find_package find the subset of Boost installed with
+    # GROMACS, by appending the relevant subdirectory, unless
+    # pkg-config already took care of it.
+    if(PC_GROMACS_INCLUDE_DIRS)
+      set(BOOST_INCLUDEDIR ${GROMACS_INCLUDE_DIRS})
+    else()
+      set(BOOST_INCLUDEDIR ${GROMACS_INCLUDE_DIRS}/gromacs/external/boost)
+    endif()
     find_package(Boost 1.44.0 REQUIRED)
     if(Boost_FOUND)
         list(APPEND GROMACS_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})