cmake_minimum_required(VERSION 2.6)

PROJECT(gplcver)

SET(CMAKE_C_FLAGS $ENV{CFLAGS})

SET(BIN_INSTALL_DIR bin)
SET(DATA_INSTALL_DIR share/gplcver)
SET(DOC_INSTALL_DIR doc/gplcver)
SET(MAN_INSTALL_DIR man/man1)

LINK_LIBRARIES(m)
LINK_LIBRARIES(dl)
INCLUDE_DIRECTORIES(pli_incs)

SET(gplcver_sources src/cver.c src/dig_main.c src/v_acc.c src/v_cnv.c src/v_dbg.c src/v_dbg2.c src/v_del.c src/v_ex.c src/v_ex2.c src/v_ex3.c src/v_ex4.c src/v_fx.c src/v_fx2.c src/v_fx3.c src/v_ms.c src/v_prp.c src/v_prp2.c src/v_sdf.c src/v_sim.c src/v_src.c src/v_src2.c src/v_src3.c src/v_tf.c src/v_trch.c src/v_vpi.c src/v_vpi2.c src/v_vpi3.c src/veriuser.c src/vpiuser.c)

ADD_EXECUTABLE(cver ${gplcver_sources})

INSTALL(FILES "COPYING" "INSTALL" "LICENSE" "OUR_PHILOSOPHY" "Changelog" "NEW.CVER.2001.RELEASE.NOTES" "README" DESTINATION ${DOC_INSTALL_DIR})
INSTALL(FILES "doc/cver-extensions.txt" "doc/cver.FAQ" "doc/cver.faq.htm" "doc/cver.hlp" "doc/dbg.hlp" "doc/systasks.pdf" "doc/systasks.ps" DESTINATION ${DOC_INSTALL_DIR})
INSTALL(DIRECTORY "tests_and_examples/" DESTINATION ${DOC_INSTALL_DIR}/tests_and_examples)
INSTALL(FILES "doc/systasks.1" DESTINATION ${MAN_INSTALL_DIR})
INSTALL(TARGETS cver DESTINATION ${BIN_INSTALL_DIR})

ADD_SUBDIRECTORY(vcddiff.dir)
