File: CMakeLists.txt

package info (click to toggle)
kdbg 2.5.5-3
  • links: PTS
  • area: main
  • in suites: buster
  • size: 2,804 kB
  • ctags: 1,464
  • sloc: cpp: 12,294; xml: 802; makefile: 55; sh: 39; ansic: 10
file content (94 lines) | stat: -rw-r--r-- 2,677 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
add_subdirectory(doc)
add_subdirectory(pics)
add_subdirectory(typetables)

include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
include(CheckFunctionExists)

CHECK_INCLUDE_FILES(pty.h HAVE_PTY_H)
CHECK_INCLUDE_FILES(libutil.h HAVE_LIBUTIL_H)
CHECK_INCLUDE_FILES(util.h HAVE_UTIL_H)
CHECK_LIBRARY_EXISTS(util openpty "" HAVE_LIB_UTIL)
if (HAVE_LIB_UTIL)
    set(CMAKE_REQUIRED_LIBRARIES util)
endif (HAVE_LIB_UTIL)
CHECK_FUNCTION_EXISTS(openpty HAVE_FUNC_OPENPTY)

message("-- Looking for a suitable 'ps' invocation")
FIND_PROGRAM(PROG_PS ps)
IF (PROG_PS)
    set(PS_ARGS -eo pid,ppid,uid,vsz,etime,time,args)
    execute_process(COMMAND ${PROG_PS} ${PS_ARGS}
		RESULT_VARIABLE PS_FAILED
		OUTPUT_QUIET ERROR_QUIET)
    IF (NOT PS_FAILED)
	execute_process(
		COMMAND ${PROG_PS} ${PS_ARGS}
		COMMAND sed -e "s/  */ /g" -e 1q
		OUTPUT_VARIABLE PS_HEADER)
	string(STRIP "${PS_HEADER}" PS_HEADER)
	IF (PS_HEADER STREQUAL "PID PPID UID VSZ ELAPSED TIME COMMAND")
	    # enclose arguments in double-quotes
	    set(PS_COMMAND \"${PROG_PS}\")
	    set(PS_MSG ${PROG_PS})
	    foreach (I ${PS_ARGS})
		set(PS_COMMAND ${PS_COMMAND},\"${I}\")
		set(PS_MSG "${PS_MSG} ${I}")
	    endforeach (I)
	    message("-- Found 'ps' command: ${PS_MSG}")
	ENDIF (PS_HEADER STREQUAL "PID PPID UID VSZ ELAPSED TIME COMMAND")
    ENDIF (NOT PS_FAILED)
ENDIF (PROG_PS)
IF (NOT PS_COMMAND)
    message("-- Looking for a suitable 'ps' invocation - not found")
ENDIF (NOT PS_COMMAND)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)

set(kdbg_SRCS
    pgmargs.cpp
    procattach.cpp
    debugger.cpp
    dbgdriver.cpp
    gdbdriver.cpp
    xsldbgdriver.cpp
    brkpt.cpp
    exprwnd.cpp
    regwnd.cpp
    memwindow.cpp
    threadlist.cpp
    sourcewnd.cpp
    winstack.cpp
    ttywnd.cpp
    typetable.cpp
    prefdebugger.cpp
    prefmisc.cpp
    pgmsettings.cpp
    watchwindow.cpp
    dbgmainwnd.cpp
    main.cpp
)

set(kdbg_UI
    brkptbase.ui
    brkptcondition.ui
    pgmargsbase.ui
    procattachbase.ui
)

kde4_add_ui_files(kdbg_SRCS ${kdbg_UI})

kde4_add_app_icon(kdbg_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/pics/hi*-app-kdbg.png")
kde4_add_app_icon(kdbg_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/pics/lo*-app-kdbg.png")
kde4_add_executable(kdbg ${kdbg_SRCS})

IF (HAVE_LIB_UTIL)
    set(LIB_UTIL util)
ENDIF (HAVE_LIB_UTIL)

target_link_libraries(kdbg ${KDE4_KDECORE_LIBS} ${KDE4_KIO_LIBS} ${LIB_UTIL})

install(TARGETS kdbg ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES kdbg.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
install(FILES kdbgrc DESTINATION ${CONFIG_INSTALL_DIR})
install(FILES kdbgui.rc DESTINATION ${DATA_INSTALL_DIR}/kdbg)