source: git/kernel/CMakeLists.txt @ 528f5b7

spielwiese
Last change on this file since 528f5b7 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: 4.9 KB
Line 
1# -*- mode: cmake; -*-
2#
3#
4
5configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mod2.h.cmake.in
6  ${CMAKE_CURRENT_BINARY_DIR}/mod2.h)
7
8include_directories(${CMAKE_CURRENT_BINARY_DIR})
9include_directories(${CMAKE_CURRENT_SOURCE_DIR})
10include_directories(${CMAKE_BINARY_DIR})
11include_directories(${CMAKE_SOURCE_DIR})
12include_directories(${CMAKE_SOURCE_DIR}/factory)
13include_directories(${CMAKE_SOURCE_DIR}/ntl/include)
14
15include(VersionMacros)
16include(KernelMacros)
17create_version(KVERSION)
18
19set(ADD_DEFS "NOSTREAMIO;${_OSDEF};HAVE_CONFIG_H;SINGULAR")
20mk_prcopy(PRCOPY ${CMAKE_CURRENT_SOURCE_DIR}/prCopy.pl)
21
22# C++ sources which are used if part of the kernel are dynamically linked
23#if(${DL_KERNEL})
24set(proc_dyn_srcs p_Procs_Generate.cc p_Procs_Impl.h mod2.h)
25add_executable(p_Procs_Dynamic ${proc_dyn_srcs})
26set_target_properties(p_Procs_Dynamic PROPERTIES
27  COMPILE_DEFINITIONS "p_Procs_Dynamic")
28mk_procs(DL_KERNEL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/p_Procs_Dynamic "Dynamic")
29#else(${DL_KERNEL})
30#  set(DL_KERNEL_SRCS "")
31#endif(${DL_KERNEL})
32
33# C++ sources which are used for dynamic libraries if part of the kernel is
34# dynamically linked
35set(proc_lib_srcs ${DL_KERNEL_SRCS} p_Procs_Generate.cc)
36add_executable(p_Procs_Lib ${proc_lib_srcs})
37set_target_properties(p_Procs_Dynamic PROPERTIES
38  COMPILE_DEFINITIONS "p_Procs_Lib")
39mk_procs(DL_LIB_SRCS ${CMAKE_CURRENT_BINARY_DIR}/p_Procs_Lib "Lib")
40
41# C++ sources which are used if no parts of the kernel are dynamically linked
42set(proc_static_srcs p_Procs_Generate.cc p_Procs_Impl.h mod2.h)
43add_executable(p_Procs_Static ${proc_static_srcs})
44set_target_properties(p_Procs_Static PROPERTIES
45  COMPILE_DEFINITIONS "p_Procs_Static")
46mk_procs(STATIC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/p_Procs_Static "Static")
47
48#
49set(kernel_dl_srcs     ${DL_LIB_SRCS} p_Procs_Dynamic.cc)
50set(dl_lib_srcs        ${DL_LIB_SRCS} p_Procs_Lib.cc)
51set(kernel_static_srcs ${STATIC_SRCS} p_Procs_Static.cc)
52
53#
54#
55#
56# normal C++ source files
57set(kernel_srcs
58  ${PRCOPY}
59  clapconv.cc
60  clapsing.cc
61    febase.cc feread.cc feResource.cc
62    ffields.cc hdegree.cc hilb.cc hutil.cc
63    sca.cc gring.cc gr_kstd2.cc summator.cc ncSAMult.cc ncSACache.cc ncSAFormula.cc
64    ideals.cc intvec.cc int64vec.cc
65    khstd.cc kstdfac.cc
66    kstd1.cc kstd2.cc kutil.cc
67    longalg.cc longrat.cc longrat0.cc
68    maps.cc matpol.cc misc.cc gnumpfl.cc gnumpc.cc
69    rmodulo2m.cc rmodulon.cc rintegers.cc
70    modulop.cc mpr_complex.cc sparsmat.cc fast_maps.cc
71    fglmzero.cc fglmvec.cc fglmgauss.cc fglmhom.cc fglmcomb.cc
72    numbers.cc polys.cc p_polys.cc polys0.cc polys1.cc polys-impl.cc
73    ring.cc shortfl.cc kspoly.cc
74    syz.cc syz0.cc syz1.cc syz2.cc syz3.cc
75    timer.cc weight.cc
76    GMPrat.cc multicnt.cc npolygon.cc semic.cc spectrum.cc splist.cc
77    mod_raw.cc walkProc.cc walkMain.cc walkSupport.cc
78    eigenval.cc units.cc kbuckets.cc sbuckets.cc
79    mpr_inout.cc mpr_base.cc mpr_numeric.cc
80    prCopy.cc p_Mult_q.cc
81    pDebug.cc pInline2.cc pInline1.cc pInline0.cc
82    pShallowCopyDelete.cc fast_mult.cc digitech.cc
83    tgb.cc tgbgauss.cc ringgb.cc f5data.cc f5lists.cc f5gb.cc
84    f5c.cc F5cLists.cc ratgring.cc shiftgb.cc gfan.cc linearAlgebra.cc
85    ${KVERSION}
86    weight0.c fegetopt.c fereadl.c dError.c mmstd.c
87)
88
89
90set(kernel_hdrs hutil.h stairc.h ideals.h
91        longalg.h structs.h intvec.h int64vec.h longrat.h
92        numbers.h stype.h clapconv.h maps.h
93        clapsing.h matpol.h polys.h p_polys.h syz.h
94        ring.h timer.h dError.h fast_maps.h
95        febase.h shortfl.h mpr_complex.h mpr_global.h
96        summator.h ncSAMult.h ncSACache.h sca.h gring.h ncSAFormula.h
97        walkProc.h walkMain.h walkSupport.h
98        ffields.h khstd.h sparsmat.h gnumpfl.h gnumpc.h
99        fglm.h kstd1.h
100        rmodulo2m.h rmodulon.h rintegers.h modulop.h sing_dbm.h weight.h
101        fglmgauss.h fglmvec.h
102        kstdfac.h kmatrix.h
103        kutil.h
104        dbm_sl.h polys-impl.h
105        GMPrat.h multicnt.h npolygon.h semic.h spectrum.h splist.h multicnt.h
106        eigenval.h units.h mod_raw.h kbuckets.h sbuckets.h
107        mpr_global.h mpr_inout.h mpr_base.h mpr_numeric.h
108        fegetopt.h distrib.h
109        ratgring.h shiftgb.h prCopy.h prCopyMacros.h
110        p_MemAdd.h p_MemCopy.h p_MemCmp.h p_Numbers.h
111        pInline2.h pInline1.h pInline0.h mmalloc.h
112        omSingularConfig.h pShallowCopyDelete.h
113        p_Procs_Dynamic.h p_Procs_Impl.h p_Procs_Set.h
114        p_Procs.h p_Procs_Static.h p_Mult_q.h gfan.h
115        )
116
117# define the libraries to be created
118add_library(kernel STATIC ${kernel_static_srcs} ${kernel_srcs})
119set_target_properties(kernel PROPERTIES COMPILE_DEFINITIONS "${ADD_DEFS}")
120
121if(${DL_KERNEL})
122  add_library(kernel_so SHARED ${kernel_dl_srcs} ${kernel_cxx_srcs} ${kernel_c_srcs})
123  set_target_properties(kernel_so PROPERTIES COMPILE_DEFINITIONS "${ADD_DEFS}")
124endif(${DL_KERNEL})
125
126add_library(kernel_mmalloc STATIC mmalloc.cc)
127set_target_properties(kernel_mmalloc PROPERTIES COMPILE_DEFINITIONS "${ADD_DEFS} ${CMAKE_CXX_FLAGS_DEBUG}")
128
129add_library(sg-fegetopt fegetopt.c)
Note: See TracBrowser for help on using the repository browser.