mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 04:22:34 +00:00
de5d4715c2
CMake 2.4, since the distros don't seem to consider 2.6 stable yet. As a bonus, GTK+ is no longer a required dependency; now it's optional. - Made dehsupp ignore CR characters, so it doesn't spew warnings on Linux. SVN r1092 (trunk)
24 lines
1 KiB
CMake
24 lines
1 KiB
CMake
cmake_minimum_required( VERSION 2.4 )
|
|
include( CheckFunctionExists )
|
|
|
|
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG" )
|
|
|
|
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/parse.h ${CMAKE_CURRENT_BINARY_DIR}/parse.c
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/parse.y ${CMAKE_CURRENT_BINARY_DIR}
|
|
COMMAND ${CMAKE_BINARY_DIR}/tools/lemon/lemon parse.y
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
DEPENDS lemon parse.y )
|
|
|
|
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/scanner.c
|
|
COMMAND ${CMAKE_BINARY_DIR}/tools/re2c/re2c -s -o ${CMAKE_CURRENT_BINARY_DIR}/scanner.c ${CMAKE_CURRENT_SOURCE_DIR}/scanner.re
|
|
DEPENDS re2c scanner.re )
|
|
|
|
include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} )
|
|
|
|
CHECK_FUNCTION_EXISTS( stricmp STRICMP_EXISTS )
|
|
if( NOT STRICMP_EXISTS )
|
|
add_definitions( -Dstricmp=strcasecmp )
|
|
endif( NOT STRICMP_EXISTS )
|
|
|
|
add_executable( dehsupp dehsupp.c parse.c scanner.c )
|
|
add_dependencies( dehsupp ${CMAKE_CURRENT_BINARY_DIR}/parse.c ${CMAKE_CURRENT_BINARY_DIR}/scanner.c )
|