#
# Build PhysXVehicle common
#

SET(PHYSX_VEHICLE_HEADERS
	${PHYSX_ROOT_DIR}/Include/vehicle/PxVehicleComponents.h
	${PHYSX_ROOT_DIR}/Include/vehicle/PxVehicleDrive.h
	${PHYSX_ROOT_DIR}/Include/vehicle/PxVehicleDrive4W.h
	${PHYSX_ROOT_DIR}/Include/vehicle/PxVehicleDriveNW.h
	${PHYSX_ROOT_DIR}/Include/vehicle/PxVehicleDriveTank.h
	${PHYSX_ROOT_DIR}/Include/vehicle/PxVehicleNoDrive.h
	${PHYSX_ROOT_DIR}/Include/vehicle/PxVehicleSDK.h
	${PHYSX_ROOT_DIR}/Include/vehicle/PxVehicleShaders.h
	${PHYSX_ROOT_DIR}/Include/vehicle/PxVehicleTireFriction.h
	${PHYSX_ROOT_DIR}/Include/vehicle/PxVehicleUpdate.h
	${PHYSX_ROOT_DIR}/Include/vehicle/PxVehicleUtil.h
	${PHYSX_ROOT_DIR}/Include/vehicle/PxVehicleUtilControl.h
	${PHYSX_ROOT_DIR}/Include/vehicle/PxVehicleUtilSetup.h
	${PHYSX_ROOT_DIR}/Include/vehicle/PxVehicleUtilTelemetry.h
	${PHYSX_ROOT_DIR}/Include/vehicle/PxVehicleWheels.h
)
SOURCE_GROUP(include FILES ${PHYSX_VEHICLE_HEADERS})

SET(PHYSX_VEHICLE_SOURCE
	${LL_SOURCE_DIR}/PxVehicleComponents.cpp
	${LL_SOURCE_DIR}/PxVehicleDrive.cpp
	${LL_SOURCE_DIR}/PxVehicleDrive4W.cpp
	${LL_SOURCE_DIR}/PxVehicleDriveNW.cpp
	${LL_SOURCE_DIR}/PxVehicleDriveTank.cpp
	${LL_SOURCE_DIR}/PxVehicleMetaData.cpp
	${LL_SOURCE_DIR}/PxVehicleNoDrive.cpp
	${LL_SOURCE_DIR}/PxVehicleSDK.cpp
	${LL_SOURCE_DIR}/PxVehicleSerialization.cpp
	${LL_SOURCE_DIR}/PxVehicleSuspWheelTire4.cpp
	${LL_SOURCE_DIR}/PxVehicleTireFriction.cpp
	${LL_SOURCE_DIR}/PxVehicleUpdate.cpp
	${LL_SOURCE_DIR}/PxVehicleWheels.cpp
	${LL_SOURCE_DIR}/VehicleUtilControl.cpp
	${LL_SOURCE_DIR}/VehicleUtilSetup.cpp
	${LL_SOURCE_DIR}/VehicleUtilTelemetry.cpp
	${LL_SOURCE_DIR}/PxVehicleDefaults.h
	${LL_SOURCE_DIR}/PxVehicleLinearMath.h
	${LL_SOURCE_DIR}/PxVehicleSerialization.h
	${LL_SOURCE_DIR}/PxVehicleSuspLimitConstraintShader.h
	${LL_SOURCE_DIR}/PxVehicleSuspWheelTire4.h
)
SOURCE_GROUP(src FILES ${PHYSX_VEHICLE_SOURCE})

SET(PHYSX_VEHICLE_METADATA_HEADERS
	${LL_SOURCE_DIR}/PhysXMetaData/include/PxVehicleAutoGeneratedMetaDataObjectNames.h
	${LL_SOURCE_DIR}/PhysXMetaData/include/PxVehicleAutoGeneratedMetaDataObjects.h
	${LL_SOURCE_DIR}/PhysXMetaData/include/PxVehicleMetaDataObjects.h
)
SOURCE_GROUP(metadata\\include FILES ${PHYSX_VEHICLE_METADATA_HEADERS})

SET(PHYSX_VEHICLE_METADATA_SOURCE
	${LL_SOURCE_DIR}/PhysXMetaData/src/PxVehicleAutoGeneratedMetaDataObjects.cpp
	${LL_SOURCE_DIR}/PhysXMetaData/src/PxVehicleMetaDataObjects.cpp
)
SOURCE_GROUP(metadata\\src FILES ${PHYSX_VEHICLE_METADATA_SOURCE})

ADD_LIBRARY(PhysXVehicle ${PHYSXVEHICLE_LIBTYPE}
	${PHYSX_VEHICLE_SOURCE}
	${PHYSX_VEHICLE_HEADERS}
	${PHYSX_VEHICLE_METADATA_HEADERS}
	${PHYSX_VEHICLE_METADATA_SOURCE}
)


TARGET_INCLUDE_DIRECTORIES(PhysXVehicle 
	PRIVATE ${PHYSXVEHICLE_PLATFORM_INCLUDES}

	PRIVATE ${PXSHARED_ROOT_DIR}/include
	PRIVATE ${PXSHARED_ROOT_DIR}/src/foundation/include
	PRIVATE ${PXSHARED_ROOT_DIR}/src/fastxml/include
	PRIVATE ${PXSHARED_ROOT_DIR}/src/pvd/include

	PRIVATE ${PHYSX_ROOT_DIR}/Include
	PRIVATE ${PHYSX_ROOT_DIR}/Include/vehicle
	PRIVATE ${PHYSX_ROOT_DIR}/Include/common
	PRIVATE ${PHYSX_ROOT_DIR}/Include/geometry
	PRIVATE ${PHYSX_ROOT_DIR}/Include/extensions
	PRIVATE ${PHYSX_ROOT_DIR}/Include/cloth
	PRIVATE ${PHYSX_ROOT_DIR}/Include/pvd
	PRIVATE ${PHYSX_ROOT_DIR}/Include/physxprofilesdk
	PRIVATE ${PHYSX_ROOT_DIR}/Include/GeomUtils

	PRIVATE ${PHYSX_SOURCE_DIR}/Common/include
	PRIVATE ${PHYSX_SOURCE_DIR}/Common/src

	PRIVATE ${PHYSX_SOURCE_DIR}/PhysXVehicle/src
	PRIVATE ${PHYSX_SOURCE_DIR}/PhysXVehicle/src/PhysXMetaData/include

	PRIVATE ${PHYSX_SOURCE_DIR}/PhysXMetaData/extensions/include
	PRIVATE ${PHYSX_SOURCE_DIR}/PhysXMetaData/core/include

	PRIVATE ${PHYSX_SOURCE_DIR}/PhysXExtensions/src/serialization/Xml

	PRIVATE ${PHYSX_SOURCE_DIR}/PvdSDK/src
)

# No linked libraries

# Use generator expressions to set config specific preprocessor definitions
TARGET_COMPILE_DEFINITIONS(PhysXVehicle 
	PRIVATE ${PHYSXVEHICLE_COMPILE_DEFS}
)

SET_TARGET_PROPERTIES(PhysXVehicle PROPERTIES
	OUTPUT_NAME PhysX3Vehicle
)
	
SET_TARGET_PROPERTIES(PhysXVehicle PROPERTIES 
	COMPILE_PDB_NAME_DEBUG "PhysX3Vehicle${CMAKE_DEBUG_POSTFIX}"
	COMPILE_PDB_NAME_CHECKED "PhysX3Vehicle${CMAKE_CHECKED_POSTFIX}"
	COMPILE_PDB_NAME_PROFILE "PhysX3Vehicle${CMAKE_PROFILE_POSTFIX}"
	COMPILE_PDB_NAME_RELEASE "PhysX3Vehicle${CMAKE_RELEASE_POSTFIX}"
)