2 # SuperTux - squirrel library build script
3 # Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 ## Apply patch that fixes some Coverity errors
22 ## Apply coverity patch to Squirrel?
23 SET(APPLY_COVERITY_PATCH TRUE)
24 SET(PATCH_COMMAND patch -p1 --forward -i)
25 FIND_PROGRAM(PATCH_EXECUTABLE patch)
27 IF(PATCH_EXECUTABLE AND APPLY_COVERITY_PATCH)
29 FILE(GLOB_RECURSE PATCH_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
30 ${CMAKE_CURRENT_SOURCE_DIR}/patches/*.patch
31 ${CMAKE_CURRENT_SOURCE_DIR}/patches/*.diff)
34 FOREACH(file ${PATCH_FILES})
35 MESSAGE(STATUS "Found ${file}")
36 EXECUTE_PROCESS(COMMAND ${PATCH_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}/${file})
39 ENDIF(PATCH_EXECUTABLE AND APPLY_COVERITY_PATCH)
41 ## Add include/ to include directories
43 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/)
45 ## build list of source files
47 FILE(GLOB SQUIRREL_SOURCES squirrel/*.cpp sqstdlib/*.cpp sqstdlib/*.c)
49 ## Add in squirrel debug stuff
51 OPTION(ENABLE_SQDBG "Build squirrel script interpreter with debugging options" OFF)
53 INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR}/squirrel/)
54 FILE(GLOB SQDBG_SOURCES sqdbg/*.cpp)
55 SET(SQUIRREL_SOURCES ${SQDBG_SOURCES} ${SQUIRREL_SOURCES})
58 # the squirrel sources are out of our control so don't be too pedantic about
60 SET(CMAKE_CXX_FLAGS "")
63 ## define a target for building the library
65 ADD_LIBRARY(squirrel ${SQUIRREL_SOURCES})