CMakeLists.txt

Sat, 09 Jan 2016 02:20:28 +0200

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Sat, 09 Jan 2016 02:20:28 +0200
branch
protocol5
changeset 103
b78c0ca832a9
parent 83
08bfc3d9d2ae
child 87
53c2aecb9704
permissions
-rw-r--r--

CVar watching stuff works now, fixed compilation

cmake_minimum_required (VERSION 2.4)
cmake_policy (SET CMP0003 NEW)
project (zfc9000)

add_library (huffman STATIC
	huffman/bitreader.cpp
	huffman/bitwriter.cpp
	huffman/huffcodec.cpp
	huffman/huffman.cpp
)

set (SOURCE_FILES
	sources/coloredline.cpp
	sources/interface.cpp
	sources/main.cpp
	sources/md5.cpp
	sources/mystring.cpp
	sources/version.cpp
	sources/network/bytestream.cpp
	sources/network/ipaddress.cpp
	sources/network/rconsession.cpp
	sources/network/udpsocket.cpp
)

set (CURSES_NEED_NCURSES, True)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -W -Wall")

if (NOT WIN32)
	find_package (Curses)
endif()

if (MINGW)
	set (CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
endif()

include_directories (${CURSES_INCUDE_DIRS})
include_directories (${CMAKE_CURRENT_BINARY_DIR})
include_directories (huffman)
add_executable (${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries (${PROJECT_NAME} huffman)

if (NOT WIN32)
	target_link_libraries (${PROJECT_NAME} ${CURSES_LIBRARIES})
else()
	target_link_libraries (${PROJECT_NAME} ${CMAKE_CURRENT_BINARY_DIR}/pdcurses.a wsock32 ws2_32)
endif()

add_custom_target (make_hginfo_h
	COMMAND python
		"${CMAKE_SOURCE_DIR}/updaterevision/updaterevision.py"
		"${CMAKE_CURRENT_BINARY_DIR}/hginfo.h")
add_dependencies (${PROJECT_NAME} make_hginfo_h)

mercurial