Skip to content

Commit

Permalink
Fix QScintilla2 CMake Issues (#97)
Browse files Browse the repository at this point in the history
* Remove duplicate `CodeWidgetPlain.cpp` in sources list.
* Add additional library names so QScintilla can actually be found.
* Add neat little status message telling when and where QScintilla was found.
* Define `QSCINTILLA_DLL` so QScintilla knows we are using it as a shared library instead of a static library and so signals and slots will work.
  • Loading branch information
RobertBColton authored Mar 9, 2020
1 parent d7c4ea2 commit a02a2c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ set(RGM_SOURCES
Editors/SpriteEditor.cpp
Editors/BaseEditor.cpp
Editors/RoomEditor.cpp
Widgets/CodeWidgetPlain.cpp
Widgets/AssetView.cpp
Widgets/CodeWidget.cpp
Widgets/BackgroundView.cpp
Expand Down Expand Up @@ -153,7 +152,7 @@ set(RGM_RC
)

# Check for QScintilla
find_library(LIB_QSCINTILLA NAMES qscintilla2)
find_library(LIB_QSCINTILLA NAMES qscintilla2 qscintilla2_qt5 qscintilla2-qt5 qt5scintilla2 libqscintilla2_qt5.so libqscintilla2.so libqscintilla2.a qscintilla2.lib)
if (NOT LIB_QSCINTILLA)
set(EDITOR_SOURCES Widgets/CodeWidgetPlain.cpp)
else()
Expand Down Expand Up @@ -197,6 +196,8 @@ foreach(CompilerFlag ${CompilerFlags})
endforeach()

if (LIB_QSCINTILLA)
message(STATUS "Found QScintilla: ${LIB_QSCINTILLA}")
add_definitions(-DQSCINTILLA_DLL)
target_link_libraries(${EXE} PRIVATE ${LIB_QSCINTILLA})
endif()

Expand Down

0 comments on commit a02a2c3

Please sign in to comment.