CMakeLists.txt

Tue, 22 Jul 2014 12:57:46 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Tue, 22 Jul 2014 12:57:46 +0300
changeset 138
a426c1039655
parent 136
1c40bb4f8221
child 139
cf11621ae422
permissions
-rw-r--r--

- even more rework

cmake_minimum_required (VERSION 2.8)

set (BOTC_HEADERS
	src/botStuff.h
	src/commands.h
	src/list.h
	src/dataBuffer.h
	src/events.h
	src/expression.h
	src/format.h
	src/lexer.h
	src/lexerScanner.h
	src/macros.h
	src/main.h
	src/parser.h
	src/property.h
	src/stringClass.h
	src/stringTable.h
	src/tokens.h
	src/types.h
)

set (BOTC_SOURCES
	src/commands.cpp
	src/dataBuffer.cpp
	src/events.cpp
	src/expression.cpp
	src/format.cpp
	src/lexer.cpp
	src/lexerScanner.cpp
	src/main.cpp
	src/parser.cpp
	src/stringClass.cpp
	src/stringTable.cpp
)

add_subdirectory (updaterevision)
add_subdirectory (namedenums)
get_target_property (UPDATEREVISION_EXE updaterevision LOCATION)
get_target_property (NAMEDENUMS_EXE namedenums LOCATION)

add_custom_target (revision_check ALL
    COMMAND ${UPDATEREVISION_EXE} ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/hginfo.h
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
    DEPENDS updaterevision)

add_custom_target (enumstrings ALL
    COMMAND ${NAMEDENUMS_EXE} ${BOTC_HEADERS}
		${CMAKE_BINARY_DIR}/enumstrings.h
		${CMAKE_BINARY_DIR}/enumstrings.cpp
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
    DEPENDS namedenums)

add_executable (botc ${BOTC_SOURCES} ${CMAKE_BINARY_DIR}/enumstrings.cpp)
add_dependencies (botc revision_check enumstrings)
include_directories (${CMAKE_BINARY_DIR})
include_directories (${CMAKE_SOURCE_DIR}/src)

if (NOT MSVC)
	set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -W -Wall -Og")

	if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug" OR "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
		set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG")
	endif()
endif()

mercurial