#
# Build PxTask common
#

SET(PXTASK_HEADERS
	${PROJECT_SOURCE_DIR}/../../../../include/task/PxCpuDispatcher.h
	${PROJECT_SOURCE_DIR}/../../../../include/task/PxGpuDispatcher.h
	${PROJECT_SOURCE_DIR}/../../../../include/task/PxGpuTask.h
	${PROJECT_SOURCE_DIR}/../../../../include/task/PxTask.h
	${PROJECT_SOURCE_DIR}/../../../../include/task/PxTaskDefine.h
	${PROJECT_SOURCE_DIR}/../../../../include/task/PxTaskManager.h
)
SOURCE_GROUP(include FILES ${PXTASK_HEADERS})

SET(PXTASK_SOURCE
	${PXSHARED_SOURCE_DIR}/task/src/TaskManager.cpp
)
SOURCE_GROUP(src FILES ${PXTASK_SOURCE})

ADD_LIBRARY(PxTask ${PXTASK_LIBTYPE}	
	${PXTASK_HEADERS}
	${PXTASK_SOURCE}
)

TARGET_INCLUDE_DIRECTORIES(PxTask 
	PRIVATE ${PXSHARED_SOURCE_DIR}/../include
	PRIVATE ${PXSHARED_SOURCE_DIR}/cudamanager/include
	PRIVATE ${PXSHARED_SOURCE_DIR}/foundation/include
	
	PRIVATE ${PXTASK_PLATFORM_INCLUDES}
)

TARGET_COMPILE_DEFINITIONS(PxTask 
	PRIVATE ${PXTASK_COMPILE_DEFS}
)

IF(NOT ${PXTASK_LIBTYPE} STREQUAL "OBJECT")
	SET_TARGET_PROPERTIES(PxTask PROPERTIES 
		COMPILE_PDB_NAME_DEBUG "PxTask${CMAKE_DEBUG_POSTFIX}"
		COMPILE_PDB_NAME_CHECKED "PxTask${CMAKE_CHECKED_POSTFIX}"
		COMPILE_PDB_NAME_PROFILE "PxTask${CMAKE_PROFILE_POSTFIX}"
		COMPILE_PDB_NAME_RELEASE "PxTask${CMAKE_RELEASE_POSTFIX}"
	)
ENDIF()