##############################################################################
#
#  $Id$
#
#  Copyright 2012 Andreas Stewering
#
#  This file is part of the canrestbus library.
#
#  The canrestbus library is free software: you can redistribute it and/or modify
#  it under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation, either version 3 of the License, or (at your
#  option) any later version.
#
#  The canrestbus library is distributed in the hope that it will be useful, but
#  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
#  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
#  License for more details.
#
#  You should have received a copy of the GNU Lesser General Public License
#  along with the canrestbus library. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -g")

INCLUDE_DIRECTORIES(
    ${PROJECT_BINARY_DIR}
    ${PROJECT_SOURCE_DIR}
    ${PROJECT_SOURCE_DIR}/src
    ${PROJECT_INCLUDE_DIR}
    )

LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/src)

ADD_EXECUTABLE(xcpsim 
  XCPsim.c XCPsim.h
  ecu.c ecu.h
  can.c
  tcp.c
  XcpBasic.c XcpBasic.h
  xcp_cfg.h
  xcp_def.h 
  xcp_par.h
  ${PROJECT_SOURCE_DIR}/src/cs_socketcan.c
  )
TARGET_LINK_LIBRARIES(xcpsim ${PROJECT_NAME} rt m pthread)
ADD_TEST(xcpsim xcpsim)

