Commits

Shlomi Fish committed d81ac51

More idiot-proof CMake stuff.

See:

https://github.com/kripken/emscripten/issues/766#issuecomment-11664435

Thanks to kripken.

  • Participants
  • Parent commits 5592a56

Comments (0)

Files changed (2)

File fc-solve/source/CMakeLists.txt

 
 SET (DBM_FCC_COMMON app_str.c card.c meta_alloc.c state.c)
 
-SET (DEBONDT_DELTA_STATES )
-IF (FCS_ENABLE_DBM_SOLVER)
+MACRO (MY_FIND_GMP reason_why my_option)
     FIND_LIBRARY(LIBGMP_LIB gmp)
 
     IF (NOT LIBGMP_LIB)
         MESSAGE (FATAL_ERROR
-"You must install libgmp ( http://gmplib.org/ ) and its development package to build the DBM solver.
-If you're not interested in building it, run cmake with the -DFCS_ENABLE_DBM_SOLVER= flag."
+"You must install libgmp ( http://gmplib.org/ ) and its development package ${reason_why}.
+If you're not interested in building it, run cmake with the -D${my_option}= flag."
         )
     ENDIF (NOT LIBGMP_LIB)
+ENDMACRO (MY_FIND_GMP reason_why my_option)
+
+SET (DEBONDT_DELTA_STATES )
+IF (FCS_ENABLE_DBM_SOLVER)
 
+    MY_FIND_GMP ("to build the DBM solver." "FCS_ENABLE_DBM_SOLVER")
     ADD_DEFINITIONS("-DFCS_DEBONDT_DELTA_STATES=1")
     SET (DEBONDT_DELTA_STATES 1)
 

File fc-solve/source/t/CMakeLists.txt

 IF (FCS_WITH_TEST_SUITE)
 
     FIND_LIBRARY(LIBTAP_LIB tap)
-    FIND_LIBRARY(LIBGMP_LIB gmp)
+    IF (NOT LIBTAP_LIB)
+        MESSAGE (FATAL_ERROR
+"You must install libtap ( http://www.shlomifish.org/open-source/projects/libtap/ ) and its development package or headers to run the test suite.
+If you're not interested in building it, run cmake with the -DFCS_WITH_TEST_SUITE= flag."
+    )
+    ENDIF (NOT LIBTAP_LIB)
+    MY_FIND_GMP ("to run the test suite." "FCS_WITH_TEST_SUITE")
 
     INCLUDE_DIRECTORIES (BEFORE "${CMAKE_BINARY_DIR}")