cmake_minimum_required(VERSION 2.6)

include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${GLUON_CORE_INCLUDES} ${QT_QTSCRIPT_INCLUDES})

set(scriptingcomponent_SRCS
 scriptingengine.cpp
 scriptingasset.cpp
 scriptingcomponent.cpp
 scriptingcomponentprivate.cpp
)

qt4_automoc(${scriptingcomponent_SRCS})
add_library(gluon_component_scripting SHARED ${scriptingcomponent_SRCS})

if(GLUON_BUILD_ALL)
    add_dependencies(gluon_component_scripting GluonEngine)
endif()

set_target_properties(gluon_component_scripting PROPERTIES VERSION ${GLUON_VERSION_STRING} SOVERSION ${GLUON_VERSION_STRING} DEFINE_SYMBOL MAKE_GLUON_COMPONENT_SCRIPTING_LIB)
target_link_libraries(gluon_component_scripting GluonEngine ${QT_QTSCRIPT_LIBRARY} ${GLUON_GRAPHICS_LIBS})

install(
    TARGETS
    gluon_component_scripting
    DESTINATION
    ${LIB_INSTALL_DIR}/gluon
)

install(
    FILES
    scripting_template.js
    DESTINATION
    ${SHARE_INSTALL_DIR}/gluon/templates/scripting
)
