Skip to content

Commit

Permalink
cleaning up how our cmake files are organized. No more need to manual…
Browse files Browse the repository at this point in the history
…ly use the

qt5_wrap_* functions, since we can have cmake automagically moc, uic, etc...
  • Loading branch information
eteran committed Aug 7, 2018
1 parent c921aae commit 99ada39
Show file tree
Hide file tree
Showing 24 changed files with 107 additions and 257 deletions.
17 changes: 8 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,13 @@ set_property(GLOBAL PROPERTY VERSION ${TARGET_VERSION_MAJOR}.${TARGET_VERSION_MI


if (UNIX)
# TODO(eteran): how low can we make this
find_package(PkgConfig REQUIRED)
pkg_check_modules(GRAPHVIZ libgvc>=2.38.0)
if(${GRAPHVIZ_FOUND})
include_directories(${GRAPHVIZ_INCLUDE_DIRS})
link_directories(${GRAPHVIZ_LIBRARY_DIRS})
add_definitions(-DENABLE_GRAPH)
endif()
find_package(PkgConfig REQUIRED)
pkg_check_modules(GRAPHVIZ libgvc>=2.38.0)
if(${GRAPHVIZ_FOUND})
include_directories(${GRAPHVIZ_INCLUDE_DIRS})
link_directories(${GRAPHVIZ_LIBRARY_DIRS})
add_definitions(-DENABLE_GRAPH)
endif()
endif()


Expand All @@ -53,7 +52,7 @@ include_directories("include")
if(UNIX)
include_directories("include/os/unix")
elseif(WIN32)
include_directories("include/os/win32")
include_directories("include/os/win32")
endif()

if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
Expand Down
24 changes: 9 additions & 15 deletions plugins/Analyzer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,22 @@ set(CMAKE_AUTORCC ON)

set(PluginName "Analyzer")

set(UI_FILES
OptionsPage.ui
SpecifiedFunctions.ui
DialogXRefs.ui)

find_package(Qt5 5.0.0 REQUIRED Widgets Concurrent)
qt5_wrap_ui(UI_H ${UI_FILES})

# we put the header files from the include directory here
# too so automoc can "just work"
add_library(${PluginName} SHARED
Analyzer.h
AnalyzerWidget.h
OptionsPage.h
SpecifiedFunctions.h
Analyzer.cpp
Analyzer.h
AnalyzerWidget.cpp
OptionsPage.cpp
SpecifiedFunctions.cpp
AnalyzerWidget.h
DialogXRefs.cpp
DialogXRefs.h
${UI_H}
DialogXRefs.ui
OptionsPage.cpp
OptionsPage.h
OptionsPage.ui
SpecifiedFunctions.cpp
SpecifiedFunctions.h
SpecifiedFunctions.ui
)

target_link_libraries(${PluginName} Qt5::Widgets Qt5::Concurrent)
Expand Down
14 changes: 3 additions & 11 deletions plugins/Assembler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,18 @@ set(CMAKE_AUTORCC ON)

set(PluginName "Assembler")

set(UI_FILES
DialogAssembler.ui
OptionsPage.ui)
set(RC_FILES Assembler.qrc)

find_package(Qt5 5.0.0 REQUIRED Widgets Xml XmlPatterns)
qt5_wrap_ui(UI_H ${UI_FILES})
qt5_add_resources(RC_SRCS ${RC_FILES})

# we put the header files from the include directory here
# too so automoc can "just work"
add_library(${PluginName} SHARED
Assembler.cpp
Assembler.h
Assembler.qrc
DialogAssembler.cpp
DialogAssembler.h
DialogAssembler.ui
OptionsPage.cpp
OptionsPage.h
${RC_SRCS}
${UI_H}
OptionsPage.ui
)

target_link_libraries(${PluginName} Qt5::Widgets Qt5::Xml Qt5::XmlPatterns)
Expand Down
12 changes: 3 additions & 9 deletions plugins/Backtrace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,16 @@ set(CMAKE_AUTORCC ON)

set(PluginName "Backtrace")

set(UI_FILES
DialogBacktrace.ui)

find_package(Qt5 5.0.0 REQUIRED Widgets)
qt5_wrap_ui(UI_H ${UI_FILES})

# we put the header files from the include directory here
# too so automoc can "just work"
add_library(${PluginName} SHARED
Backtrace.cpp
Backtrace.h
DialogBacktrace.cpp
DialogBacktrace.h
CallStack.cpp
CallStack.h
${UI_H}
DialogBacktrace.cpp
DialogBacktrace.h
DialogBacktrace.ui
)

target_link_libraries(${PluginName} Qt5::Widgets)
Expand Down
12 changes: 3 additions & 9 deletions plugins/BinaryInfo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,27 @@ set(CMAKE_AUTORCC ON)

set(PluginName "BinaryInfo")

set(UI_FILES
OptionsPage.ui
DialogHeader.ui)

find_package(Qt5 5.0.0 REQUIRED Widgets)
qt5_wrap_ui(UI_H ${UI_FILES})

# we put the header files from the include directory here
# too so automoc can "just work"
add_library(${PluginName} SHARED
BinaryInfo.cpp
BinaryInfo.h
demangle.h
DialogHeader.cpp
DialogHeader.h
ELFXX.cpp
DialogHeader.ui
ELF32.cpp
ELF64.cpp
elf_binary.h
ELFXX.cpp
OptionsPage.cpp
OptionsPage.h
OptionsPage.ui
PE32.cpp
PE32.h
pe_binary.h
symbols.cpp
symbols.h
${UI_H}
)

target_link_libraries(${PluginName} Qt5::Widgets)
Expand Down
10 changes: 2 additions & 8 deletions plugins/BinarySearcher/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,17 @@ set(CMAKE_AUTORCC ON)

set(PluginName "BinarySearcher")

set(UI_FILES
DialogASCIIString.ui
DialogBinaryString.ui)

find_package(Qt5 5.0.0 REQUIRED Widgets)
qt5_wrap_ui(UI_H ${UI_FILES})

# we put the header files from the include directory here
# too so automoc can "just work"
add_library(${PluginName} SHARED
BinarySearcher.cpp
BinarySearcher.h
DialogASCIIString.cpp
DialogASCIIString.h
DialogASCIIString.ui
DialogBinaryString.cpp
DialogBinaryString.h
${UI_H}
DialogBinaryString.ui
)

target_link_libraries(${PluginName} Qt5::Widgets)
Expand Down
8 changes: 1 addition & 7 deletions plugins/Bookmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,16 @@ set(CMAKE_AUTORCC ON)

set(PluginName "Bookmarks")

set(UI_FILES
Bookmarks.ui)

find_package(Qt5 5.0.0 REQUIRED Widgets)
qt5_wrap_ui(UI_H ${UI_FILES})

# we put the header files from the include directory here
# too so automoc can "just work"
add_library(${PluginName} SHARED
Bookmarks.cpp
Bookmarks.h
BookmarkWidget.cpp
BookmarkWidget.h
BookmarksModel.cpp
BookmarksModel.h
${UI_H}
Bookmarks.ui
)

target_link_libraries(${PluginName} Qt5::Widgets)
Expand Down
8 changes: 1 addition & 7 deletions plugins/BreakpointManager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,14 @@ set(CMAKE_AUTORCC ON)

set(PluginName "BreakpointManager")

set(UI_FILES
DialogBreakpoints.ui)

find_package(Qt5 5.0.0 REQUIRED Widgets)
qt5_wrap_ui(UI_H ${UI_FILES})

# we put the header files from the include directory here
# too so automoc can "just work"
add_library(${PluginName} SHARED
BreakpointManager.cpp
BreakpointManager.h
DialogBreakpoints.cpp
DialogBreakpoints.h
${UI_H}
DialogBreakpoints.ui
)

target_link_libraries(${PluginName} Qt5::Widgets)
Expand Down
8 changes: 1 addition & 7 deletions plugins/CheckVersion/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,14 @@ set(CMAKE_AUTORCC ON)

set(PluginName "CheckVersion")

set(UI_FILES
OptionsPage.ui)

find_package(Qt5 5.0.0 REQUIRED Widgets Network)
qt5_wrap_ui(UI_H ${UI_FILES})

# we put the header files from the include directory here
# too so automoc can "just work"
add_library(${PluginName} SHARED
CheckVersion.cpp
CheckVersion.h
OptionsPage.cpp
OptionsPage.h
${UI_H}
OptionsPage.ui
)

target_link_libraries(${PluginName} Qt5::Widgets Qt5::Network)
Expand Down
54 changes: 22 additions & 32 deletions plugins/DebuggerCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,7 @@ set(PluginName "DebuggerCore")

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")

set(UI_FILES
unix/linux/DialogMemoryAccess.ui
)

endif()

find_package(Qt5 5.0.0 REQUIRED Widgets)
qt5_wrap_ui(UI_H ${UI_FILES})

set(DebuggerCore_SRCS
DebuggerCoreBase.cpp
Expand Down Expand Up @@ -48,6 +39,11 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
${DebuggerCore_SRCS}
unix/linux/DebuggerCore.cpp
unix/linux/DebuggerCore.h
unix/linux/DialogMemoryAccess.cpp
unix/linux/DialogMemoryAccess.h
unix/linux/DialogMemoryAccess.ui
unix/linux/FeatureDetect.cpp
unix/linux/FeatureDetect.h
unix/linux/PlatformCommon.cpp
unix/linux/PlatformCommon.h
unix/linux/PlatformEvent.cpp
Expand All @@ -58,32 +54,26 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
unix/linux/PlatformRegion.h
unix/linux/PlatformThread.cpp
unix/linux/PlatformThread.h
unix/linux/FeatureDetect.cpp
unix/linux/FeatureDetect.h
unix/linux/DialogMemoryAccess.cpp
unix/linux/DialogMemoryAccess.h
${UI_H}
)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")

include_directories(
"win32"
)

set(DebuggerCore_SRCS
${DebuggerCore_SRCS}
win32/DebuggerCore.cpp
win32/DebuggerCore.h
win32/PlatformEvent.cpp
win32/PlatformEvent.h
win32/PlatformProcess.cpp
win32/PlatformProcess.h
win32/PlatformRegion.cpp
win32/PlatformRegion.h
win32/PlatformState.cpp
win32/PlatformState.h
${UI_H}
)
include_directories(
"win32"
)

set(DebuggerCore_SRCS
${DebuggerCore_SRCS}
win32/DebuggerCore.cpp
win32/DebuggerCore.h
win32/PlatformEvent.cpp
win32/PlatformEvent.h
win32/PlatformProcess.cpp
win32/PlatformProcess.h
win32/PlatformRegion.cpp
win32/PlatformRegion.h
win32/PlatformState.cpp
win32/PlatformState.h
)
endif()

if((${CMAKE_SYSTEM_PROCESSOR} MATCHES "i[3456]86") OR (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") OR (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64"))
Expand Down
2 changes: 0 additions & 2 deletions plugins/DebuggerErrorConsole/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ set(PluginName "DebuggerErrorConsole")

find_package(Qt5 5.0.0 REQUIRED Widgets)

# we put the header files from the include directory here
# too so automoc can "just work"
add_library(${PluginName} SHARED
Plugin.cpp
Plugin.h
Expand Down
8 changes: 1 addition & 7 deletions plugins/DumpState/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,14 @@ set(CMAKE_AUTORCC ON)

set(PluginName "DumpState")

set(UI_FILES
OptionsPage.ui)

find_package(Qt5 5.0.0 REQUIRED Widgets)
qt5_wrap_ui(UI_H ${UI_FILES})

# we put the header files from the include directory here
# too so automoc can "just work"
add_library(${PluginName} SHARED
DumpState.cpp
DumpState.h
OptionsPage.cpp
OptionsPage.h
${UI_H}
OptionsPage.ui
)

target_link_libraries(${PluginName} Qt5::Widgets)
Expand Down
8 changes: 1 addition & 7 deletions plugins/FunctionFinder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,14 @@ set(CMAKE_AUTORCC ON)

set(PluginName "FunctionFinder")

set(UI_FILES
DialogFunctions.ui)

find_package(Qt5 5.0.0 REQUIRED Widgets)
qt5_wrap_ui(UI_H ${UI_FILES})

# we put the header files from the include directory here
# too so automoc can "just work"
add_library(${PluginName} SHARED
DialogFunctions.cpp
DialogFunctions.h
DialogFunctions.ui
FunctionFinder.cpp
FunctionFinder.h
${UI_H}
)

target_link_libraries(${PluginName} Qt5::Widgets)
Expand Down
Loading

0 comments on commit 99ada39

Please sign in to comment.