Move src/api cmake logic into src/api cmake file
authorejjordan <ejjordan@kth.se>
Fri, 11 Sep 2020 12:34:27 +0000 (14:34 +0200)
committerejjordan <ejjordan@kth.se>
Fri, 11 Sep 2020 12:34:27 +0000 (14:34 +0200)
src/CMakeLists.txt
src/api/CMakeLists.txt

index e05d603e4940c77f35b545daf24d07095d6c1817..de6dc36bf9ab8c8fc59cf517d64290655d931819 100644 (file)
@@ -127,21 +127,7 @@ endif()
 
 add_subdirectory(gromacs)
 add_subdirectory(programs)
-
-# Activate targets for new C++ API components and docs.
-if (GMXAPI)
-   if (GMX_BUILD_MDRUN_ONLY)
-       message(FATAL_ERROR "GMXAPI relies on libgromacs and is incompatible with GMX_BUILD_MDRUN_ONLY.")
-   endif()
-   if(NOT ${BUILD_SHARED_LIBS})
-       # Note: this conditional should check for the existence of a libgromacs target supporting PIC
-       # using the POSITION_INDEPENDENT_CODE property, but for now the only facility we have is the global
-       # variable, BUILD_SHARED_LIBS.
-       # TODO: gmxapi should gracefully build for dynamic linking or static linking for PIC or without.
-       message(FATAL_ERROR "GMXAPI requires position-independent code. Set -DGMXAPI=OFF or -DBUILD_SHARED_LIBS=ON.")
-   endif()
-   add_subdirectory(api)
-endif()
+add_subdirectory(api)
 
 # Configure header files with configuration-specific values. This step
 # should follow all introspection e.g. looking for headers and
index 2fa7150bf8a46c1aa6cc49124cc975ef70e1f873..0f62185f143abe8b94d62b9ffe298bf215408c49 100644 (file)
 # To help us fund GROMACS development, we humbly ask that you cite
 # the research papers on the package. Check out http://www.gromacs.org.
 
-add_subdirectory(cpp)
+# Activate targets for new C++ API components and docs.
+if (GMXAPI)
+    if (GMX_BUILD_MDRUN_ONLY)
+        message(FATAL_ERROR "GMXAPI relies on libgromacs and is incompatible with GMX_BUILD_MDRUN_ONLY.")
+    endif()
+    if(NOT ${BUILD_SHARED_LIBS})
+        # Note: this conditional should check for the existence of a libgromacs target supporting PIC
+        # using the POSITION_INDEPENDENT_CODE property, but for now the only facility we have is the global
+        # variable, BUILD_SHARED_LIBS.
+        # TODO: gmxapi should gracefully build for dynamic linking or static linking for PIC or without.
+        message(FATAL_ERROR "GMXAPI requires position-independent code. Set -DGMXAPI=OFF or -DBUILD_SHARED_LIBS=ON.")
+    endif()
+    add_subdirectory(cpp)
+endif()
+