2007-01-07 17:19:45 +00:00
|
|
|
################################################################
|
|
|
|
# Name: CMakeLists.txt
|
|
|
|
# Purpose: Input file for CMake for the Scyther tool
|
|
|
|
# Author: Cas Cremers
|
|
|
|
################################################################
|
|
|
|
|
|
|
|
# Scyther project
|
|
|
|
project (Scyther)
|
|
|
|
# I need 2.4 for flex/etc although it does not run yet
|
2007-01-08 11:20:19 +00:00
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
|
2007-01-07 17:19:45 +00:00
|
|
|
|
|
|
|
# List all the source files
|
|
|
|
set (Scyther_sources
|
|
|
|
arachne.c binding.c claim.c color.c compiler.c cost.c
|
|
|
|
debug.c depend.c dotout.c error.c heuristic.c hidelevel.c
|
|
|
|
intruderknowledge.c knowledge.c label.c list.c main.c mgu.c
|
|
|
|
prune_bounds.c prune_theorems.c role.c
|
|
|
|
specialterm.c states.c switches.c symbol.c system.c tac.c
|
|
|
|
termlist.c termmap.c term.c timer.c type.c warshall.c xmlout.c
|
|
|
|
parser.c scanner.c
|
|
|
|
)
|
|
|
|
|
|
|
|
# If we are in a debug mode we want to be strict
|
|
|
|
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -DDEBUG")
|
|
|
|
|
|
|
|
# Determine version number
|
|
|
|
include (SVNVersion.cmake)
|
|
|
|
|
|
|
|
# Make scanner and parser
|
|
|
|
include (ScannerParser.cmake)
|
|
|
|
|
2007-01-08 07:21:29 +00:00
|
|
|
# By default, we build what we get
|
2007-01-08 07:38:17 +00:00
|
|
|
if (NOT TARGETOS)
|
|
|
|
if (WIN32)
|
|
|
|
set (TARGETOS "WIN32")
|
|
|
|
else (WIN32)
|
|
|
|
if (APPLE)
|
|
|
|
set (TARGETOS "APPLE")
|
|
|
|
else (APPLE)
|
|
|
|
if (UNIX)
|
|
|
|
set (TARGETOS "UNIX")
|
|
|
|
endif (UNIX)
|
|
|
|
endif (APPLE)
|
|
|
|
endif (WIN32)
|
|
|
|
endif (NOT TARGETOS)
|
2007-01-08 11:20:19 +00:00
|
|
|
message (STATUS "Target OS: ${TARGETOS}")
|
2007-01-08 07:21:29 +00:00
|
|
|
|
2007-01-08 07:38:17 +00:00
|
|
|
# Determine name and target from type
|
2007-01-08 11:20:19 +00:00
|
|
|
if ("${TARGETOS}" STREQUAL "UNIX")
|
2007-01-08 07:38:17 +00:00
|
|
|
# Should for now only be done on the unix platform
|
2007-01-08 11:20:19 +00:00
|
|
|
message (STATUS "sjonge met [${TARGETOS}]")
|
2007-01-08 07:38:17 +00:00
|
|
|
if (UNIX)
|
|
|
|
message (STATUS "Building Linux version")
|
|
|
|
set (scythername "scyther-linux")
|
|
|
|
add_executable (${scythername} ${Scyther_sources})
|
|
|
|
endif (UNIX)
|
2007-01-08 11:20:19 +00:00
|
|
|
endif ("${TARGETOS}" STREQUAL "UNIX")
|
2007-01-08 07:38:17 +00:00
|
|
|
|
2007-01-08 11:20:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
if ("${TARGETOS}" STREQUAL "APPLE")
|
2007-01-08 07:38:17 +00:00
|
|
|
if (APPLE)
|
|
|
|
# Should for now only be done on the apple platform
|
|
|
|
message (STATUS "Building Apple version")
|
|
|
|
set (scythername "scyther-mac")
|
|
|
|
add_executable (${scythername} ${Scyther_sources})
|
2007-01-08 11:20:19 +00:00
|
|
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fnested-functions")
|
2007-01-08 07:38:17 +00:00
|
|
|
endif (APPLE)
|
2007-01-08 11:20:19 +00:00
|
|
|
endif ("${TARGETOS}" STREQUAL "APPLE")
|
2007-01-08 07:38:17 +00:00
|
|
|
|
2007-01-08 11:20:19 +00:00
|
|
|
if ("${TARGETOS}" STREQUAL "WIN32")
|
|
|
|
message (STATUS "Building W32 version")
|
2007-01-08 07:38:17 +00:00
|
|
|
# This should work on win32 platform, but also when the compiler
|
|
|
|
# is available anyway under linux
|
|
|
|
set (CMAKE_C_COMPILER "i586-mingw32msvc-gcc")
|
|
|
|
set (CMAKE_CXX_COMPILER "i586-mingw32msvc-g++")
|
|
|
|
set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS) # to get rid of -rdynamic
|
|
|
|
set (scythername "scyther-w32.exe")
|
|
|
|
add_executable (${scythername} ${Scyther_sources})
|
2007-01-08 11:20:19 +00:00
|
|
|
endif ("${TARGETOS}" STREQUAL "WIN32")
|
2007-01-08 07:21:29 +00:00
|
|
|
|
2007-01-07 17:19:45 +00:00
|
|
|
# Make the Scyther linux binary
|
2007-01-08 07:38:17 +00:00
|
|
|
if (NOT scythername)
|
2007-01-08 07:21:29 +00:00
|
|
|
message (FATAL_ERROR "Cannot determine target platform [${TARGETOS}]")
|
2007-01-08 07:38:17 +00:00
|
|
|
endif (NOT scythername)
|
2007-01-08 07:21:29 +00:00
|
|
|
|
|
|
|
|
2007-01-07 17:19:45 +00:00
|
|
|
|