PROJECT(glosm)

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

# Global options
IF(UNIX)
	SET(BUILD_TILER_DEFAULT ON)
ELSE(UNIX)
	SET(BUILD_TILER_DEFAULT OFF)
ENDIF(UNIX)

OPTION(BUILD_VIEWER "Build first-person osm viewer" ON)
OPTION(BUILD_TILER "Build tile generator" ${BUILD_TILER_DEFAULT})
OPTION(BUILD_EXAMPLES "Build examples" ON)
OPTION(BUILD_TESTS "Build tests" ON)

# Global variables (still overridable via cmake -D ..)
SET(BINDIR "bin" CACHE STRING "Install subdirectory for binaries")
SET(LIBDIR "lib" CACHE STRING "Install subdirectory for libraries")

# Global definitions
ADD_DEFINITIONS(-Wall -Wextra -DTILE_DEBUG)

# Framework subdirs
ADD_SUBDIRECTORY(libglosm-server)
ADD_SUBDIRECTORY(libglosm-client)
ADD_SUBDIRECTORY(libglosm-geomgen)

# Application subdirs
IF(BUILD_VIEWER)
	ADD_SUBDIRECTORY(viewer)
ENDIF(BUILD_VIEWER)
IF(BUILD_TILER)
	ADD_SUBDIRECTORY(tiler)
ENDIF(BUILD_TILER)
IF(BUILD_EXAMPLES)
	ADD_SUBDIRECTORY(examples)
ENDIF(BUILD_EXAMPLES)
IF(BUILD_TESTS)
	ENABLE_TESTING()
	ADD_SUBDIRECTORY(tests)
ENDIF(BUILD_TESTS)

PROJECT(glosm)

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

# Global options
IF(UNIX)
	SET(BUILD_TILER_DEFAULT ON)
ELSE(UNIX)
	SET(BUILD_TILER_DEFAULT OFF)
ENDIF(UNIX)

OPTION(BUILD_VIEWER "Build first-person osm viewer" ON)
OPTION(BUILD_TILER "Build tile generator" ${BUILD_TILER_DEFAULT})
OPTION(BUILD_EXAMPLES "Build examples" ON)
OPTION(BUILD_TESTS "Build tests" ON)

# Global variables (still overridable via cmake -D ..)
SET(BINDIR "bin" CACHE STRING "Install subdirectory for binaries")
SET(LIBDIR "lib" CACHE STRING "Install subdirectory for libraries")

# Global definitions
ADD_DEFINITIONS(-Wall -Wextra -DTILE_DEBUG)

IF(MINGW)
	SET(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} "-mwindows")
ENDIF(MINGW)

# Framework subdirs
ADD_SUBDIRECTORY(libglosm-server)
ADD_SUBDIRECTORY(libglosm-client)
ADD_SUBDIRECTORY(libglosm-geomgen)

# Application subdirs
IF(BUILD_VIEWER)
	ADD_SUBDIRECTORY(viewer)
ENDIF(BUILD_VIEWER)
IF(BUILD_TILER)
	ADD_SUBDIRECTORY(tiler)
ENDIF(BUILD_TILER)
IF(BUILD_EXAMPLES)
	ADD_SUBDIRECTORY(examples)
ENDIF(BUILD_EXAMPLES)
IF(BUILD_TESTS)
	ENABLE_TESTING()
	ADD_SUBDIRECTORY(tests)
ENDIF(BUILD_TESTS)

Build gui, not console application
Build gui, not console application
