CMakeLists.txt 4.91 KB
#=============================================================================
# CMakeLists.txt - Rules for coolbot-c compiler.
#
# The CoolBOT Project (<http://www.coolbotproject.org>)
# Copyright (C) 2003,2007,2009,2010
# Universidad de Las Palmas de Gran Canaria (ULPGC) (<http://www.ulpgc.es>)
#
# This software is a collective project which has been designed, developed and
# written, and is maintained by members, students and collaborators of the División
# de Inteligencia Artificial y Sistemas (DIAS) at the Instituto Universitario de
# Sistemas Inteligentes y Aplicaciones Numéricas en Ingeniería (SIANI)
# (<http://www.siani.es/>), and also of the Departamento de Informática y Sistemas
# (DIS) (<http://www.dis.ulpgc.es>) both at ULPGC. The AUTHOR file lists all
# developers and contributors.The particular authors of each file are explicitly
# specified on each one of them.
#
# This file is part of the CoolBOT Project.
# The CoolBOT Project is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or any
# later version.
#
# The CoolBOT Project 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 General Public License for more details.
#
# You should have received a copy (COPYING file) of the GNU General Public License
# along with the CoolBOT Project . If not, see <http://www.gnu.org/licenses/>.
#=============================================================================
MESSAGE(STATUS "Generating coolbot-c target")

SET(C_MAJOR    1)
SET(C_MINOR    9)
SET(C_REVISION 0)
SET(COOLBOT_C_VERSION "${C_MAJOR}.${C_MINOR}.${C_REVISION}"
                      CACHE STRING "coolbot-c version")

MESSAGE(STATUS "  * Version: ${COOLBOT_C_VERSION}")

SET(COOLBOT_C_PATH ${PROJECT_SOURCE_DIR}/coolbot-c)

INCLUDE_DIRECTORIES(${COOLBOT_C_PATH}/src
                    ${PROJECT_SOURCE_DIR}/coolbot-toolkit)

FLEX_TARGET(scanner
            ${COOLBOT_C_PATH}/src/ctcScanner.ll
            ${COOLBOT_C_PATH}/src/lex.ctcParser.cpp)
            #COMPILE_FLAGS "-olex.yy.cpp")

FLEX_TARGET(skeletonscanner
            ${COOLBOT_C_PATH}/src/ctcGenerator.ll
            ${COOLBOT_C_PATH}/src/lex.ctcGenerator.cpp)
            #COMPILE_FLAGS "-olex.yy.cpp")

SET(Bison_options "-dv")
IF(SHOW_DEBUG_INFO)
  SET(Bison_options "-t ${Bison_options}")
ENDIF(SHOW_DEBUG_INFO)

BISON_TARGET_option_extraopts(${Bison_options})

BISON_TARGET(parser
            ${COOLBOT_C_PATH}/src/ctcParser.yy
            ${COOLBOT_C_PATH}/src/ctcParser.tab.cc)

SET(COOLBOT_C_HDRS
    #common
    src/ctcMessages.h
    src/ctcIdentifier.h
    src/ctcStack.h
    src/ctcExcluidItem.h
    src/ctcIncludes.h
    #front-end
    src/ctcParser.tab.hh
    #back-end
    src/ctcCode.h
    src/ctcTag.h
    src/ctcGenerator.h
    src/ctcThread.h
    src/ctcState.h
    src/ctcException.h
    src/ctcVariable.h
    src/ctcPort.h
    src/ctcPacket.h
    src/ctcConstant.h
    src/ctcHeader.h
    src/ctcIntegration.h
    src/ctcView.h
    src/ctcNewPacket.h
    src/ctcComponent.h
    src/ctcSemantic.h
    #compiler
    src/ctcCompiler.h
    #main
    src/ctcCoolbot.h
  )

SET(COOLBOT_C_SRCS
    #common
    src/ctcIdentifier.cpp
    src/ctcStack.cpp
    src/ctcExcluidItem.cpp
    #front-end
    src/lex.ctcParser.cpp
    src/ctcParser.tab.cc
    #back-end
    src/ctcCode.cpp
    src/lex.ctcGenerator.cpp
    src/ctcTag.cpp
    src/ctcGenerator.cpp
    src/ctcThread.cpp
    src/ctcState.cpp
    src/ctcException.cpp
    src/ctcVariable.cpp
    src/ctcPort.cpp
    src/ctcPacket.cpp
    src/ctcConstant.cpp
    src/ctcHeader.cpp
    src/ctcIntegration.cpp
    src/ctcView.cpp
    src/ctcNewPacket.cpp
    src/ctcComponent.cpp
    src/ctcSemantic.cpp
    #compiler
    src/ctcCompiler.cpp
    #main
    src/ctcCoolbot.cpp
    src/ctcMain.cpp
  )

SET(COOLBOT_C_SRCS
    ${COOLBOT_C_SRCS}
    ${COOLBOT_C_HDRS}
  )

IF(SHOW_DEBUG_INFO)
  MESSAGE(STATUS "  * Source code:")
  MESSAGE("${COOLBOT_C_SRCS}")
ENDIF(SHOW_DEBUG_INFO)

ADD_EXECUTABLE( coolbot-c ${COOLBOT_C_SRCS} )
TARGET_LINK_LIBRARIES(coolbot-c coolbot-toolkit)

REGISTER_NEW_TARGET("coolbot-c")
MESSAGE(STATUS "  * Created coolbot-c target")

IF(NOT DEBUG_MODE)
  #
  # Install settings
  #
  # Installation on UNIX environment:
  #
  # Binaries -> ${COOLBOT_BINARIES_INSTALL_PATH} (/usr/local/bin)
  #
  # Installation on MS-WINDOWS environment:
  #
  # Binaries -> ${COOLBOT_BINARIES_INSTALL_PATH} (C:\Archivos de programa\coolbot-project\bin\)
  #
  INSTALL( TARGETS coolbot-c
           DESTINATION ${COOLBOT_BINARIES_INSTALL_PATH}
           PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
                       GROUP_READ             GROUP_EXECUTE
                       WORLD_READ             WORLD_EXECUTE
  )
  MESSAGE(STATUS "  * Generated install commands for coolbot-c tool")
ENDIF(NOT DEBUG_MODE)