CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(Example)

FILE(GLOB SOURCES *.cc *hh)

ADD_LIBRARY(example SHARED ${SOURCES})

INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES})

TARGET_LINK_LIBRARIES(example ${LINK_LIBRARIES})

SET_TARGET_PROPERTIES(
	example
	PROPERTIES
	PREFIX ""
	DEBUG_POSTFIX ""
	RELEASE_POSTFIX ""
)

IF(APPLE)
	SET_TARGET_PROPERTIES(example PROPERTIES SUFFIX ".so")
	IF (NOT (CMAKE_MAJOR_VERSION LESS 3))
		SET_TARGET_PROPERTIES(example PROPERTIES MACOSX_RPATH TRUE)
	ENDIF()
ENDIF()

IF(WIN32)
	SET_TARGET_PROPERTIES(example PROPERTIES SUFFIX ".pyd")
	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
ENDIF()
