MACRO(SETUP_LIBRARY LIB_NAME)
	IF(NOT CLASSES)
		MESSAGE("'CLASSES' should be defined, ${LIB_NAME} was not setup")
	ELSE()
		FOREACH(CLASS ${CLASSES})
			SET(SRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${CLASS}.cpp)
			SET(HEADER_FILE ${MINOTAUR_INCLUDE_DIR}/${LIB_NAME}/${CLASS}.hpp)
			IF(EXISTS ${SRC_FILE})
				SET(SRC_FILE_EXISTS TRUE)
				SET(SRC_FILES ${SRC_FILES} ${SRC_FILE})
			ENDIF()
			IF(EXISTS ${HEADER_FILE})
				SET(HEADER_FILES ${HEADER_FILES} ${HEADER_FILE})
			ENDIF()


			IF(NOT SRC_FILE_EXISTS)
				MESSAGE("No source file for ${CLASS}, using header only")
			ENDIF()	
			#IF(NOT EXISTS ${SRC_FILES} AND NOT EXISTS ${HEADER_FILE})
				#MESSAGE("Could not find class ${CLASS}")
			#ENDIF()

		ENDFOREACH()
	
		ADD_LIBRARY(${LIB_NAME} STATIC ${SRC_FILES})

		INSTALL(TARGETS ${LIB_NAME} DESTINATION lib/)
		INSTALL(FILES ${HEADER_FILES} DESTINATION include/${LIB_NAME})

	ENDIF()
ENDMACRO(SETUP_LIBRARY LIB_NAME)

