]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: add a safeguard for accidential /source source directory
authorMatthias Maier <tamiko@43-1.org>
Sun, 3 Jun 2018 20:32:46 +0000 (15:32 -0500)
committerMatthias Maier <tamiko@43-1.org>
Tue, 5 Jun 2018 02:15:16 +0000 (21:15 -0500)
This happens remarkably often. Let's improve the error message:
```
  Wrong source directory specified.

  You pointed cmake to the subdirectory "source" instead of the base
  directory.  Make sure that the path in the cmake invocation does not end in
  source.  If you have created a "build" subdirectory, the cmake invocation
  should simply be of the form:

    $ cmake  [...options...]  /..

  (path not ending in ".../source")
```

source/CMakeLists.txt

index 2704d12c773e15cb552f55a19fb78f5f277eca7c..9c429dd88f9c71b9308dde7dda256d5dd2ef40f5 100644 (file)
 
 MESSAGE(STATUS "Setting up library")
 
+#
+# This happens surprisingly often:
+#
+IF("${DEAL_II_PACKAGE_NAME}" STREQUAL  "")
+  MESSAGE(FATAL_ERROR
+    "\nWrong source directory specified.\n"
+    "You pointed cmake to the subdirectory \"source\" instead of the base "
+    "directory. Make sure that the path in the cmake invocation does not "
+    "end in source. If you have created a \"build\" subdirectory, the "
+    "cmake invocation should simply be of the form:\n"
+    "  $ cmake  [...options...]  /..\n"
+    "(path not ending in \".../source\")"
+    )
+ENDIF()
+
 #
 # Compile the deal.II library
 #

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.