set(SOURCE_FILES
    "mayautils/jointAnimData.h"
    "mayautils/meshSkinData.h"
    "mayautils/meshAnimData.h"
    "mayautils/dgUtils.h"
	"mayautils/dagUtils.h"
	"mayautils/skinUtils.h"
    "demBonesCmd.h"
    "demBonesCustom.h"

    "mayautils/jointAnimData.cpp"
    "mayautils/meshSkinData.cpp"
    "mayautils/meshAnimData.cpp"
    "mayautils/dgUtils.cpp"
	"mayautils/dagUtils.cpp"
	"mayautils/skinUtils.cpp"
    "demBonesCmd.cpp"
    "pluginMain.cpp"
)

# Ordering files with Filters
foreach(FILE ${SOURCE_FILES}) 
  get_filename_component(PARENT_DIR "${FILE}" PATH)
  string(REPLACE "/" "\\" GROUP "${PARENT_DIR}")

  if (("${FILE}" MATCHES ".*\\.cpp") OR ("${FILE}" MATCHES ".*\\.c"))
    set(GROUP "Source Files\\${GROUP}")
  elseif(("${FILE}" MATCHES ".*\\.hpp") OR ("${FILE}" MATCHES ".*\\.h"))
    set(GROUP "Header Files\\${GROUP}")
  endif()

  source_group("${GROUP}" FILES "${FILE}")
endforeach()

find_package(OpenGL REQUIRED)
find_package(Maya REQUIRED)

include_directories(${CMAKE_SOURCE_DIR}/src ${MAYA_INCLUDE_DIR})
link_directories(${MAYA_LIBRARY_DIR})

add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES})

target_link_libraries(${PROJECT_NAME} ${MAYA_LIBRARIES})
target_link_libraries(${PROJECT_NAME} ${OPENGL_gl_LIBRARY})

# Preprocessor definitions
# add_definitions(-DMAYA_${MAYA_VERSION}) # We are gonna use MAYA_API_VERSION instead
MAYA_PLUGIN(${PROJECT_NAME})

install(TARGETS ${PROJECT_NAME} ${MAYA_TARGET_TYPE} DESTINATION plug-ins)

