summaryrefslogtreecommitdiffstats
path: root/kalzium/ConfigureChecks.cmake
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2025-09-21 15:59:29 +0200
committerSlávek Banko <slavek.banko@axis.cz>2025-09-21 16:14:20 +0200
commit10fc13c59f08038dac00d3123e7337f588722306 (patch)
treee32d12915bd4794dbf91e232d9e10a57984195c1 /kalzium/ConfigureChecks.cmake
parentebb819721384c9ae7712404d115d0df19b919902 (diff)
downloadtdeedu-r14.1.x.tar.gz
tdeedu-r14.1.x.zip
Kalzim: Add CMake detection and link for nums and zarith libraries.r14.1.x
This resolves issue #63. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 3fabe9c2eea5b6bb4f61b8cbae39ff24fb41314c)
Diffstat (limited to 'kalzium/ConfigureChecks.cmake')
-rw-r--r--kalzium/ConfigureChecks.cmake66
1 files changed, 66 insertions, 0 deletions
diff --git a/kalzium/ConfigureChecks.cmake b/kalzium/ConfigureChecks.cmake
index bb1da003..88ba0ed6 100644
--- a/kalzium/ConfigureChecks.cmake
+++ b/kalzium/ConfigureChecks.cmake
@@ -72,4 +72,70 @@ if( WITH_OCAML_SOLVER )
message( STATUS "Search for facile - found" )
endif( )
+
+ if( NOT DEFINED HAVE_NUMS )
+ message( STATUS "Search for nums" )
+
+ if( NOT DEFINED NUMS_LIBRARIES )
+ find_library( NUMS_LIBRARY
+ NAMES nums.a
+ HINTS ${OCAML_BASEDIR}
+ PATH_SUFFIXES num ocaml/num
+ )
+ if( NUMS_LIBRARY )
+ set( NUMS_LIBRARIES ${NUMS_LIBRARY} )
+ endif()
+ endif( )
+
+ if( NOT DEFINED NUMS_INCLUDE_DIR )
+ find_path( NUMS_INCLUDE_DIR
+ NAMES num.cmi
+ HINTS ${OCAML_BASEDIR}
+ PATH_SUFFIXES nums lib/ocaml/nums
+ )
+ endif( )
+
+ if( NUMS_LIBRARIES AND NUMS_INCLUDE_DIR )
+ set( HAVE_NUMS 1 CACHE INTERNAL "Enable build with ocaml/nums" )
+ message( STATUS "Search for nums - found" )
+ else()
+ message( STATUS "Search for nums - not found" )
+ endif()
+ endif( )
+
+
+ if( NOT DEFINED HAVE_ZARITH )
+ message( STATUS "Search for zarith" )
+
+ if( NOT DEFINED ZARITH_LIBRARIES )
+ find_library( ZARITH_LIBRARY
+ NAMES zarith.a
+ HINTS ${OCAML_BASEDIR}
+ PATH_SUFFIXES zarith ocaml/zarith
+ )
+ if( ZARITH_LIBRARY )
+ set( ZARITH_LIBRARIES ${ZARITH_LIBRARY} )
+ endif()
+ endif( )
+
+ if( NOT DEFINED ZARITH_INCLUDE_DIR )
+ find_path( ZARITH_INCLUDE_DIR
+ NAMES z.cmi
+ HINTS ${OCAML_BASEDIR}
+ PATH_SUFFIXES zarith lib/ocaml/zarith
+ )
+ endif( )
+
+ if( ZARITH_LIBRARIES AND ZARITH_INCLUDE_DIR )
+ set( HAVE_ZARITH 1 CACHE INTERNAL "Enable build with ocaml/zarith" )
+ message( STATUS "Search for zarith - found" )
+ else()
+ message( STATUS "Search for zarith - not found" )
+ endif()
+ endif( )
+
+ if( (NOT HAVE_NUMS) AND (NOT HAVE_ZARITH) )
+ tde_message_fatal( "Facile requires nums or zarith, but neither is found on your system" )
+ endif()
+
endif( WITH_OCAML_SOLVER )