From e2bdd6b3b58d9a48ebd410940cb323c4e343c92b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Mon, 18 May 2020 01:55:27 +0200 Subject: [PATCH] Fixes for cmake conversion. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- ConfigureChecks.cmake | 1 + src/CMakeLists.txt | 38 ++++++++++++++++++++++++++++---------- src/makelayout.ui | 2 +- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index f92d8a3..50718fc 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -29,3 +29,4 @@ endif( WITH_GCC_VISIBILITY ) ##### check for yacc (bison) find_program( BISON_EXECUTABLE bison ) +find_program( FLEX_EXECUTABLE NAMES flex lex ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4a42b7d..12efd27 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,21 +11,37 @@ link_directories( ${TQT_LIBRARY_DIRS} ) -set( _basename dotparse ) +tde_import( kate ) add_custom_command( - OUTPUT ${_basename}.cpp ${_basename}.hpp + OUTPUT dotparse.cpp dotparse.hpp COMMAND ${BISON_EXECUTABLE} - ARGS -y --output ${_basename}.cpp --defines=${_basename}.hpp ${CMAKE_CURRENT_SOURCE_DIR}/${_basename}.ypp - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_basename}.ypp + ARGS -y --output dotparse.cpp --defines=dotparse.hpp ${CMAKE_CURRENT_SOURCE_DIR}/dotparse.ypp + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/dotparse.ypp ) add_custom_target( - ${_basename}.output - DEPENDS ${_basename}.cpp ${_basename}.hpp + dotparse.bison + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/dotparse.cpp + ${CMAKE_CURRENT_BINARY_DIR}/dotparse.hpp ) -##### kscope (executable) +add_custom_command( + OUTPUT dotscan.cc + COMMAND ${FLEX_EXECUTABLE} + ARGS ${CMAKE_CURRENT_SOURCE_DIR}/dotscan.lpp + COMMAND ${CMAKE_COMMAND} + ARGS -E rename lex.yy.c dotscan.cc + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/dotscan.lpp +) + +add_custom_target( + dotscan.lex + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/dotscan.cc +) + +##### kscope (executable) tde_add_executable( kscope AUTOMOC @@ -45,7 +61,7 @@ tde_add_executable( kscope AUTOMOC cscopefrontend.cpp cscopemsgdlg.cpp ctagsfrontend.cpp ctagslist.cpp dirscanner.cpp dotfrontend.cpp - dotscan.lpp editormanager.cpp + editormanager.cpp editorpage.cpp editortabs.cpp encoder.cpp filelist.cpp fileview.cpp frontend.cpp @@ -68,16 +84,18 @@ tde_add_executable( kscope AUTOMOC searchlist.cpp searchresultsdlg.cpp symbolcompletion.cpp symboldlg.cpp tabwidget.cpp treewidget.cpp - ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp + ${CMAKE_CURRENT_BINARY_DIR}/dotparse.cpp + ${CMAKE_CURRENT_BINARY_DIR}/dotscan.cc LINK tdeui-shared tdeio-shared tdecore-shared tdeparts-shared - kateinterfaces + kateinterfaces-shared katepartinterfaces-shared DESTINATION ${BIN_INSTALL_DIR} + DEPENDENCIES dotparse.bison dotscan.lex ) diff --git a/src/makelayout.ui b/src/makelayout.ui index 6219223..eb3dcfd 100644 --- a/src/makelayout.ui +++ b/src/makelayout.ui @@ -239,6 +239,6 @@ klineedit.h kurlrequester.h ktextbrowser.h - queryview.h + queryview.h