mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-13 16:18:30 +00:00
CMake: Parse iaito.pro to get filenames
This commit is contained in:
parent
ca4ed55cf1
commit
5d46610721
@ -33,106 +33,23 @@ find_package(Radare2 REQUIRED)
|
||||
include_directories(${RADARE2_INCLUDE_DIRS})
|
||||
|
||||
|
||||
set(SOURCE_FILES
|
||||
main.cpp
|
||||
mainwindow.cpp
|
||||
newfiledialog.cpp
|
||||
optionsdialog.cpp
|
||||
highlighter.cpp
|
||||
qrcore.cpp
|
||||
createnewdialog.cpp
|
||||
hexascii_highlighter.cpp
|
||||
webserverthread.cpp
|
||||
widgets/pieview.cpp
|
||||
widgets/sectionswidget.cpp
|
||||
widgets/codegraphic.cpp
|
||||
widgets/notepad.cpp
|
||||
mdhighlighter.cpp
|
||||
widgets/functionswidget.cpp
|
||||
dialogs/renamedialog.cpp
|
||||
dialogs/aboutdialog.cpp
|
||||
widgets/importswidget.cpp
|
||||
widgets/symbolswidget.cpp
|
||||
widgets/relocswidget.cpp
|
||||
widgets/commentswidget.cpp
|
||||
widgets/stringswidget.cpp
|
||||
widgets/flagswidget.cpp
|
||||
widgets/memorywidget.cpp
|
||||
qrdisasm.cpp
|
||||
widgets/sdbdock.cpp
|
||||
analthread.cpp
|
||||
dialogs/commentsdialog.cpp
|
||||
widgets/sidebar.cpp
|
||||
helpers.cpp
|
||||
widgets/omnibar.cpp
|
||||
widgets/dashboard.cpp
|
||||
dialogs/xrefsdialog.cpp
|
||||
hexhighlighter.cpp)
|
||||
# Parse iaito.pro to get filenames
|
||||
include(QMakeProParse)
|
||||
parse_qmake_pro("${CMAKE_CURRENT_SOURCE_DIR}/iaito.pro" IAITO_PRO)
|
||||
set(SOURCE_FILES ${IAITO_PRO_SOURCES})
|
||||
set(HEADER_FILES ${IAITO_PRO_HEADERS})
|
||||
set(UI_FILES ${IAITO_PRO_FORMS})
|
||||
set(QRC_FILES ${IAITO_PRO_RESOURCES})
|
||||
|
||||
set(HEADER_FILES
|
||||
mainwindow.h
|
||||
newfiledialog.h
|
||||
optionsdialog.h
|
||||
highlighter.h
|
||||
qrcore.h
|
||||
createnewdialog.h
|
||||
hexascii_highlighter.h
|
||||
webserverthread.h
|
||||
widgets/pieview.h
|
||||
widgets/sectionswidget.h
|
||||
widgets/codegraphic.h
|
||||
widgets/notepad.h
|
||||
mdhighlighter.h
|
||||
widgets/functionswidget.h
|
||||
dialogs/renamedialog.h
|
||||
dialogs/aboutdialog.h
|
||||
widgets/importswidget.h
|
||||
widgets/symbolswidget.h
|
||||
widgets/relocswidget.h
|
||||
widgets/commentswidget.h
|
||||
widgets/stringswidget.h
|
||||
widgets/flagswidget.h
|
||||
widgets/memorywidget.h
|
||||
qrdisasm.h
|
||||
widgets/sdbdock.h
|
||||
analthread.h
|
||||
dialogs/commentsdialog.h
|
||||
widgets/sidebar.h
|
||||
helpers.h
|
||||
widgets/omnibar.h
|
||||
widgets/dashboard.h
|
||||
dialogs/xrefsdialog.h
|
||||
widgets/banned.h
|
||||
hexhighlighter.h)
|
||||
|
||||
set(UI_FILES
|
||||
mainwindow.ui
|
||||
newfiledialog.ui
|
||||
optionsdialog.ui
|
||||
createnewdialog.ui
|
||||
widgets/notepad.ui
|
||||
widgets/functionswidget.ui
|
||||
dialogs/aboutdialog.ui
|
||||
dialogs/renamedialog.ui
|
||||
widgets/importswidget.ui
|
||||
widgets/symbolswidget.ui
|
||||
widgets/relocswidget.ui
|
||||
widgets/commentswidget.ui
|
||||
widgets/stringswidget.ui
|
||||
widgets/flagswidget.ui
|
||||
widgets/memorywidget.ui
|
||||
widgets/sdbdock.ui
|
||||
dialogs/commentsdialog.ui
|
||||
widgets/sidebar.ui
|
||||
widgets/dashboard.ui
|
||||
dialogs/xrefsdialog.ui)
|
||||
|
||||
set(QRC_FILES resources.qrc)
|
||||
message(STATUS "sources from iaito.pro: ${SOURCE_FILES}")
|
||||
message(STATUS "headers from iaito.pro: ${HEADER_FILES}")
|
||||
message(STATUS "forms from iaito.pro: ${UI_FILES}")
|
||||
message(STATUS "resources from iaito.pro: ${QRC_FILES}")
|
||||
|
||||
|
||||
set(IAITO_VERSION_SUFFIX "-dev")
|
||||
set(IAITO_VERSION_FULL "${PROJECT_VERSION}${IAITO_VERSION_SUFFIX}")
|
||||
message("Building Iaito version ${IAITO_VERSION_FULL}")
|
||||
message(STATUS "Building Iaito version ${IAITO_VERSION_FULL}")
|
||||
add_definitions("-DAPP_VERSION=\"${IAITO_VERSION_FULL}\"")
|
||||
|
||||
|
||||
|
49
src/cmake/QMakeProParse.cmake
Normal file
49
src/cmake/QMakeProParse.cmake
Normal file
@ -0,0 +1,49 @@
|
||||
# -------------------
|
||||
# QMakeProParse.cmake
|
||||
# -------------------
|
||||
#
|
||||
# qmake project parsing utilities
|
||||
#
|
||||
|
||||
# parse_qmake_pro(<PRO_FILE> <PREFIX>)
|
||||
#
|
||||
# parse qmake .pro file PRO_FILE and set cmake variables <PREFIX>_<VAR_NAME>
|
||||
# to content of variable VAR_NAME in the .pro file.
|
||||
#
|
||||
# supported qmake syntax:
|
||||
# - VARIABLE = values
|
||||
# - VARIABLE += values
|
||||
#
|
||||
# not (yet) supported:
|
||||
# - VARIABLE -= values
|
||||
# - scopes
|
||||
#
|
||||
function(parse_qmake_pro PRO_FILE PREFIX)
|
||||
file(READ ${PRO_FILE} PRO_CONTENT)
|
||||
|
||||
# concatenate lines with backslashes
|
||||
string(REGEX REPLACE "\\\\\ *\n" "" PRO_CONTENT "${PRO_CONTENT}")
|
||||
|
||||
# separate lines
|
||||
string(REGEX MATCHALL "[^\n]+(\n|$)" PRO_LINES "${PRO_CONTENT}")
|
||||
|
||||
foreach(LINE IN LISTS PRO_LINES)
|
||||
string(STRIP "${LINE}" LINE)
|
||||
|
||||
# VARIABLE = some values ...
|
||||
string(REGEX MATCH "^([a-zA-Z_]+)\ *=(.*)" VAR_SET "${LINE}")
|
||||
if(CMAKE_MATCH_1)
|
||||
separate_arguments(VALUES UNIX_COMMAND ${CMAKE_MATCH_2})
|
||||
set(${PREFIX}_${CMAKE_MATCH_1} "${VALUES}" PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
# VARIABLE += some values ...
|
||||
string(REGEX MATCH "^([a-zA-Z_]+)\ *\\+=(.*)" VAR_SET "${LINE}")
|
||||
if(CMAKE_MATCH_1)
|
||||
separate_arguments(VALUES UNIX_COMMAND ${CMAKE_MATCH_2})
|
||||
set(VAR_NAME ${PREFIX}_${CMAKE_MATCH_1})
|
||||
set(${VAR_NAME} "${${VAR_NAME}}" "${VALUES}" PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
endforeach()
|
||||
endfunction()
|
Loading…
Reference in New Issue
Block a user