set(LIBRT_SOURCES
    attributes.c
    bezier_2d_isect.c
    binunif/binunif.c
    binunif/db5_bin.c
    bomb.c
    bool.c
    bundle.c
    cmd.c
    comb/comb.c
    comb/comb_mirror.c
    comb/db_comb.c
    constraint.c
    cut.c
    db5_alloc.c
    db5_io.c
    db5_scan.c
    db5_types.c
    db_alloc.c
    db_anim.c
    db_flags.c
    db_inmem.c
    db_io.c
    db_lookup.c
    db_match.c
    db_open.c
    db_path.c
    db_scan.c
    db_tree.c
    db_walk.c
    dir.c
    dspline.c
    fortray.c
    globals.c
    htbl.c
    many.c
    mater.c
    memalloc.c
    mkbundle.c
    opennurbs_ext.cpp
    oslo_calc.c
    oslo_map.c
    pr.c
    prep.c
    primitives/arb8/arb8.c
    primitives/arb8/arb8_brep.cpp
    primitives/arb8/arb8_mirror.c
    primitives/arbn/arbn.c
    primitives/arbn/arbn_brep.cpp
    primitives/arbn/arbn_mirror.c
    primitives/ars/ars.c
    primitives/ars/ars_mirror.c
    primitives/bot/bot.c
    primitives/bot/bot_brep.cpp
    primitives/bot/bot_mirror.c
    primitives/brep/brep.cpp
    primitives/brep/brep_debug.cpp
    primitives/bspline/bspline.cpp
    primitives/bspline/bspline_mirror.c
    primitives/bspline/nurb_basis.c
    primitives/bspline/nurb_bezier.c
    primitives/bspline/nurb_bound.c
    primitives/bspline/nurb_brep.cpp
    primitives/bspline/nurb_c2.c
    primitives/bspline/nurb_copy.c
    primitives/bspline/nurb_diff.c
    primitives/bspline/nurb_eval.c
    primitives/bspline/nurb_flat.c
    primitives/bspline/nurb_interp.c
    primitives/bspline/nurb_knot.c
    primitives/bspline/nurb_norm.c
    primitives/bspline/nurb_plot.c
    primitives/bspline/nurb_poly.c
    primitives/bspline/nurb_ray.c
    primitives/bspline/nurb_refine.c
    primitives/bspline/nurb_reverse.c
    primitives/bspline/nurb_solve.c
    primitives/bspline/nurb_split.c
    primitives/bspline/nurb_tess.c
    primitives/bspline/nurb_trim.c
    primitives/bspline/nurb_trim_util.c
    primitives/bspline/nurb_util.c
    primitives/bspline/nurb_xsplit.c
    primitives/cline/cline.c
    primitives/dsp/dsp.c
    primitives/dsp/dsp_brep.cpp
    primitives/dsp/dsp_mirror.c
    primitives/ebm/ebm.c
    primitives/ebm/ebm_brep.cpp
    primitives/ebm/ebm_mirror.c
    primitives/ehy/ehy.c
    primitives/ehy/ehy_brep.cpp
    primitives/ell/ell.c
    primitives/ell/ell_brep.cpp
    primitives/ell/ell_mirror.c
    primitives/epa/epa.c
    primitives/epa/epa_brep.cpp
    primitives/epa/epa_mirror.c
    primitives/eto/eto.c
    primitives/eto/eto_brep.cpp
    primitives/eto/eto_mirror.c
    primitives/extrude/extrude.c
    primitives/extrude/extrude_brep.cpp
    primitives/generic.c
    primitives/grip/grip.c
    primitives/grip/grip_mirror.c
    primitives/half/half.c
    primitives/half/half_mirror.c
    primitives/hf/hf.c
    primitives/hyp/hyp.c
    primitives/hyp/hyp_brep.cpp
    primitives/hyp/hyp_mirror.c
    primitives/metaball/metaball.c
    primitives/metaball/metaball_tri.c
    primitives/mirror.c
    primitives/nmg/nmg.c
    primitives/nmg/nmg_bool.c
    primitives/nmg/nmg_brep.cpp
    primitives/nmg/nmg_ck.c
    primitives/nmg/nmg_class.c
    primitives/nmg/nmg_eval.c
    primitives/nmg/nmg_extrude.c
    primitives/nmg/nmg_fcut.c
    primitives/nmg/nmg_fuse.c
    primitives/nmg/nmg_index.c
    primitives/nmg/nmg_info.c
    primitives/nmg/nmg_inter.c
    primitives/nmg/nmg_junk.c
    primitives/nmg/nmg_manif.c
    primitives/nmg/nmg_mesh.c
    primitives/nmg/nmg_mirror.c
    primitives/nmg/nmg_misc.c
    primitives/nmg/nmg_mk.c
    primitives/nmg/nmg_mod.c
    primitives/nmg/nmg_plot.c
    primitives/nmg/nmg_pr.c
    primitives/nmg/nmg_pt_fu.c
    primitives/nmg/nmg_rt_isect.c
    primitives/nmg/nmg_rt_segs.c
    primitives/nmg/nmg_tri.c
    primitives/nmg/nmg_tri_mc.c
    primitives/nmg/nmg_visit.c
    primitives/obj_adjust.c
    primitives/obj_curve.c
    primitives/obj_describe.c
    primitives/obj_export.c
    primitives/obj_free.c
    primitives/obj_get.c
    primitives/obj_ifree.c
    primitives/obj_import.c
    primitives/obj_make.c
    primitives/obj_mirror.c
    primitives/obj_norm.c
    primitives/obj_params.c
    primitives/obj_plot.c
    primitives/obj_prep.c
    primitives/obj_print.c
    primitives/obj_shot.c
    primitives/obj_tess.c
    primitives/obj_tnurb.c
    primitives/obj_uv.c
    primitives/obj_vshot.c
    primitives/obj_xform.c
    primitives/part/part.c
    primitives/part/part_mirror.c
    primitives/pipe/pipe.c
    primitives/pipe/pipe_brep.cpp
    primitives/pipe/pipe_mirror.c
    primitives/pnts/pnts.c
    primitives/poly/poly.c
    primitives/poly/poly_brep.cpp
    primitives/poly/poly_mirror.c
    primitives/rec/rec.c
    primitives/revolve/revolve.c
    primitives/revolve/revolve_brep.cpp
    primitives/rhc/rhc.c
    primitives/rhc/rhc_brep.cpp
    primitives/rhc/rhc_mirror.c
    primitives/rpc/rpc.c
    primitives/rpc/rpc_brep.cpp
    primitives/rpc/rpc_mirror.c
    primitives/sketch/sketch.c
    primitives/sketch/sketch_brep.cpp
    primitives/sph/sph.c
    primitives/sph/sph_brep.cpp
    primitives/submodel/submodel.c
    primitives/superell/superell.c
    primitives/superell/superell_mirror.c
    primitives/table.c
    primitives/tgc/tgc.c
    primitives/tgc/tgc_brep.cpp
    primitives/tgc/tgc_mirror.c
    primitives/tor/tor.c
    primitives/tor/tor_brep.cpp
    primitives/tor/tor_mirror.c
    primitives/vol/vol.c
    primitives/vol/vol_brep.cpp
    primitives/vol/vol_mirror.c
    regionfix.c
    roots.c
    shoot.c
    spectrum.c
    storage.c
    tcl.c
    transform.c
    tree.c
    vers.c
    vlist.c
    vshoot.c
    wdb.c
)

set(IGNORED_SOURCES
    brep_test.cpp
    columnparse.c
    namegen.c
    nurb_example.c
    prcomb.c
    primitives/xxx/xxx.c
)

if(MSVC)
    set(LIBRT_SOURCES
        ${LIBRT_SOURCES}
        timer-nt.c
    )
else(MSVC)
    set(LIBRT_SOURCES
        ${LIBRT_SOURCES}
        timer42.c
    )
endif(MSVC)

include_directories(
    ../../include
    ../other/libz
    ../other/openNURBS
    ../other/libregex
    ../other/tcl/generic
    ../other/tnt
)

add_definitions(
    -DHAVE_CONFIG_H
    -DBRLCADBUILD
    -DON_DLL_IMPORTS
)

add_library(librt ${LIBRT_SOURCES})
