source: git/modules/NTLMacros.cmake @ fec53d

fieker-DuValspielwiese
Last change on this file since fec53d was 8cc501, checked in by Kai Krüger <krueger@…>, 14 years ago
Added files to compile with cmake. Still experimental. Might not work git-svn-id: file:///usr/local/Singular/svn/trunk@13240 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.3 KB
Line 
1# -*- mode: cmake; -*-
2#
3#
4#
5#    CFLAGS='-O2 -fomit-frame-pointer'
6#    CXXFLAGS='-O2 -fomit-frame-pointer -fno-rtti'
7
8function(add_ntl GEN_TARGET GEN_LIB DIR) 
9  message(STATUS "add_ntl")
10  set(_GEN_LIB "${DIR}/src/ntl.a")
11  set(_GEN_TARGET "generate_ntl")
12  #    LIBDIR= INCLUDEDIR= PREFIX=
13  set(_cxx_flags "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
14  set(_cc_flags "${CMAKE_CC_FLAGS} ${CMAKE_CC_FLAGS_RELEASE}")
15
16  message(STATUS "NTL: Flags and options used to compile ntl")
17  message(STATUS "CC=${CMAKE_CC_COMPILER}")
18  message(STATUS "CXX=${CMAKE_CXX_COMPILER}")
19  message(STATUS "CFLAGS=${_cc_flags}")
20  message(STATUS "CXXFLAGS=${_cxx_flags}")
21  message(STATUS "NTL_GMP_LIP=on NTL_STD_CXX=on")
22  #    CXXFLAGS=\" -O2 -fomit-frame-pointer -fno-rtti\"
23  #utility_source(NTL bin path_to_source)
24  add_custom_command(
25    OUTPUT ${DIR}/src/makefile ${DIR}/include/NTL/config.h ${DIR}/setup4
26    COMMAND ./configure CC="gcc" CXX="g++" LDFLAGS="" GMP_PREFIX=/ NTL_GMP_LIP=on  NTL_STD_CXX=on CFLAGS=${_cc_flags} CXXFLAGS=${_cxx_flags}
27
28    COMMAND make
29
30    WORKING_DIRECTORY ${DIR}/src
31    DEPENDS ${DIR}/src/makefile
32    COMMENT "Compiling 'ntl' number theory library..."
33    )
34
35  add_custom_target(generate_ntl DEPENDS 
36    ${DIR}/setup4)
37
38  set(${GEN_TARGET} ${_GEN_TARGET} PARENT_SCOPE)
39  set(${GEN_LIB}    ${_GEN_LIB} PARENT_SCOPE)
40
41endfunction()
Note: See TracBrowser for help on using the repository browser.