# plugins-src/TWLuaPlugin/CMakeLists.txt

# plugins-src/TWLuaPlugin/CMakeLists.txt |
--- | ---
¶ # Build Lua Plugin |
    INCLUDE_DIRECTORIES(
      ${TeXworks_SOURCE_DIR}/src
      ${QT_INCLUDE_DIR}
      ${LUA_INCLUDE_DIR}
    )

    LINK_DIRECTORIES(${QT_LIBRARY_DIR})

    IF (NOT ${BUILD_SHARED_PLUGINS})
      SET(TWLUAPLUGIN_LIB_TYPE STATIC)
    ENDIF()

    ADD_LIBRARY(TWLuaPlugin ${TWLUAPLUGIN_LIB_TYPE}
      TWLuaPlugin.cpp
      ${LUA_PLUGIN_MOC}
    )

    IF (${BUILD_SHARED_PLUGINS})
      TARGET_LINK_LIBRARIES(TWLuaPlugin ${QT_LIBRARIES} ${LUA_LIBRARIES} ${TEXWORKS_ADDITIONAL_LIBS})
      INSTALL(TARGETS TWLuaPlugin
        LIBRARY DESTINATION ${TeXworks_PLUGIN_DIR}
      )
    ENDIF()