diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e3d3e9bd..1e50d1a86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,11 +61,13 @@ if(WIN32 AND MSVC) set(CMAKE_PREFIX_PATH "${QT5_PATH};${SQLITE3_PATH}") endif() +find_package(Qt5 REQUIRED COMPONENTS Concurrent Gui LinguistTools Network PrintSupport Test Widgets Xml) + if(NOT FORCE_INTERNAL_ANTLR) find_package(Antlr2 QUIET) endif() if(NOT FORCE_INTERNAL_QSCINTILLA) - find_package(QScintilla QUIET) + find_package(QScintilla 2.8.10 QUIET) endif() set(QHEXEDIT_DIR libs/qhexedit) @@ -82,8 +84,6 @@ endif() add_subdirectory(${QHEXEDIT_DIR}) add_subdirectory(${QCUSTOMPLOT_DIR}) -find_package(Qt5 REQUIRED COMPONENTS Concurrent Gui LinguistTools Network PrintSupport Test Widgets Xml) - set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) diff --git a/cmake/FindQScintilla.cmake b/cmake/FindQScintilla.cmake index 082b94f1b..4d2317744 100644 --- a/cmake/FindQScintilla.cmake +++ b/cmake/FindQScintilla.cmake @@ -42,9 +42,23 @@ # either expressed or implied, of the FreeBSD Project. #============================================================================= - +# When using pkg-config, paths may contain odd slash placement. Each +# include directory is pre-processed here. Resultant list variable +# then used for search hinting. Depends on successful find_package(Qt5). +set(Qt5QScintillaHintDirs) +if(UNIX) + foreach(item ${Qt5Widgets_INCLUDE_DIRS}) + # remove slash at end of line + STRING(REGEX REPLACE "\\/$" "" item ${item}) + # replace double slashes is single slashes + STRING(REGEX REPLACE "\\/\\/" "/" item ${item}) + list(APPEND Qt5QScintillaHintDirs "${item}/Qsci") + endforeach() +endif() find_path ( QSCINTILLA_INCLUDE_DIR qsciscintilla.h - HINTS /usr/local/include/Qsci /usr/local/opt/qscintilla2/include/Qsci + HINTS /usr/local/include/Qsci + /usr/local/opt/qscintilla2/include/Qsci + ${Qt5QScintillaHintDirs} ) set ( QSCINTILLA_INCLUDE_DIRS ${QSCINTILLA_INCLUDE_DIR} )