file(GLOB SRCS ./*.cpp ./*.c)
file(GLOB HDRS ./*.h )


if(FBX_LIBRARY)
    set(HDRS ${HDRS} fbxfile/fbx_file.h)
    set(SRCS ${SRCS} fbxfile/fbx_file.cpp)
    #add_definitions(-DFBXSDK_SHARED)
endif()

add_library(graphene_character STATIC ${SRCS} ${HDRS})

if(FBX_LIBRARY)
    find_package(LibXml2 REQUIRED)
    find_package(ZLIB REQUIRED)
    if(APPLE)
        find_package(Iconv REQUIRED)
        target_link_libraries(graphene_character graphene_surface_mesh tinyxml ${OPENMP_LIBRARIES} ${FBX_LIBRARY} ${CORE_FOUNDATION} ${LIBXML2_LIBRARIES} ${ZLIB_LIBRARIES} ${CMAKE_DL_LIBS} ${Iconv_LIBRARY})
    else()
        target_link_libraries(graphene_character graphene_surface_mesh tinyxml ${OPENMP_LIBRARIES} ${FBX_LIBRARY} ${LIBXML2_LIBRARIES} ${ZLIB_LIBRARIES} ${CMAKE_DL_LIBS})
    endif()
else()
    target_link_libraries(graphene_character graphene_surface_mesh tinyxml ${OPENMP_LIBRARIES})
endif()
