CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(Miknet)

OPTION(MIK_DEBUG off)
OPTION(TESTS off)

if (MIK_DEBUG)
	ADD_DEFINITIONS(-DMIK_DEBUG=1)
	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
else()
	ADD_DEFINITIONS(-DMIK_DEBUG=0)
	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
endif()

INCLUDE_DIRECTORIES(src/include)

FILE(GLOB SRC_MIKNET src/*.c)

ADD_LIBRARY(miknet ${SRC_MIKNET})

if (TESTS)
	ADD_EXECUTABLE(servtest servtest.c)
	ADD_EXECUTABLE(clitest clitest.c)

	ADD_DEPENDENCIES(servtest miknet)
	ADD_DEPENDENCIES(clitest miknet)

	TARGET_LINK_LIBRARIES(servtest miknet)
	TARGET_LINK_LIBRARIES(clitest miknet)
endif()

INSTALL(FILES src/include/miknet/miknet.h DESTINATION include/miknet)
INSTALL(TARGETS miknet ARCHIVE DESTINATION lib)

SET(CMAKE_C_WARNINGS "-Wall")

SET(CMAKE_C_FLAGS "${CMAKE_C_WARNINGS} ${CMAKE_C_FLAGS}")

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(Miknet)

OPTION(MIK_DEBUG off)
OPTION(TESTS off)

IF(MIK_DEBUG)
	ADD_DEFINITIONS(-DMIK_DEBUG=1)
	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
ELSE()
	ADD_DEFINITIONS(-DMIK_DEBUG=0)
	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
ENDIF()

INCLUDE_DIRECTORIES(src/include)

FILE(GLOB SRC_MIKNET src/*.c)

ADD_LIBRARY(miknet ${SRC_MIKNET})

IF(TESTS)
	ADD_EXECUTABLE(servtest servtest.c)
	ADD_EXECUTABLE(clitest clitest.c)

	ADD_DEPENDENCIES(servtest miknet)
	ADD_DEPENDENCIES(clitest miknet)

	TARGET_LINK_LIBRARIES(servtest miknet)
	TARGET_LINK_LIBRARIES(clitest miknet)
ENDIF()

INSTALL(FILES src/include/miknet/miknet.h DESTINATION include/miknet)
INSTALL(TARGETS miknet ARCHIVE DESTINATION lib)

SET(CMAKE_C_WARNINGS "-Wall")

SET(CMAKE_C_FLAGS "${CMAKE_C_WARNINGS} ${CMAKE_C_FLAGS}")

Fix some formatting and capitalization.
Fix some formatting and capitalization.

There are no behavior changes; I just wanted the script to be consistent in
choice of all-caps and spaces before arguments.
