Translations:Development/Tutorials/First program/KDE4/24/en

    From KDE TechBase
    Revision as of 10:31, 11 March 2016 by FuzzyBot (talk | contribs) (Importing a new version from external source)
    (diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

    Create a file named CMakeLists.txt in the same directory as main.cpp with this content:

    project (tutorial1)
    find_package(KDE4 REQUIRED)
    include (KDE4Defaults)
    include_directories(${KDE4_INCLUDES})
    set(tutorial1_SRCS main.cpp)
    kde4_add_executable(tutorial1 ${tutorial1_SRCS})
    target_link_libraries(tutorial1 ${KDE4_KDEUI_LIBS})
    install(TARGETS tutorial1  ${INSTALL_TARGETS_DEFAULT_ARGS})
    

    The find_package() function locates the package that you ask it for (in this case KDE4) and sets some variables describing the location of the package's headers and libraries. In this case we will use the KDE4_INCLUDES variable which contains the path to the KDE4 header files.