Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake support for Qt5 and Qt6 #100

Draft
wants to merge 94 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
83ed448
CMake support for Qt5
diegoiast Apr 16, 2022
a167543
Fix clang build
diegoiast Apr 16, 2022
d6f1a0f
Uprade lua to v5.4.4
diegoiast Apr 17, 2022
bed2be6
update luabridge + SingleApplication
diegoiast Apr 17, 2022
5bf8e88
Update scintilla related libs - they no longer add the NDEBUG hack
diegoiast Apr 18, 2022
f9891b7
Move to newer scintilla
diegoiast Apr 18, 2022
83929a2
Build cmake-qt5
diegoiast Apr 19, 2022
e8d13be
on setup - install ninja, as this is not available by default
diegoiast Apr 19, 2022
ee266af
fix setup step
diegoiast Apr 19, 2022
849d9b2
Lets build on Windows, I hope
diegoiast Apr 19, 2022
194b106
Lets build on Windows, I hope (2)
diegoiast Apr 19, 2022
4f64763
Support OSX, and fix ubuntu/windows setup (maybe?)
diegoiast Apr 19, 2022
0eea772
Track the scintilla branch, and not a tag, as the tag does not build …
diegoiast Apr 19, 2022
2c68a89
OOPS, macos, not osx....
diegoiast Apr 19, 2022
bab61e9
Fix linking on MSVC
diegoiast Apr 19, 2022
17b76fb
Disable windows build - until I have a proper fix for it
diegoiast Apr 19, 2022
48e8582
Fix the name of github task
diegoiast Apr 24, 2022
7726b03
Use static builds for all libraries
diegoiast Apr 25, 2022
d1ac7a6
Create an AppImage
diegoiast Apr 25, 2022
1757daf
Attempt to fix cmake install
diegoiast Apr 25, 2022
d9368bc
Attempt to fix make install
diegoiast Apr 26, 2022
c0bb613
Attempt to use a more specific path for installing app?
diegoiast Apr 26, 2022
3b09454
at this stage, honestly, I have no idea what I am doing
diegoiast Apr 26, 2022
c9315bf
another attempt of fixing the github install
diegoiast Apr 27, 2022
dbe2a27
another attempt of fixing the github install (2)
diegoiast Apr 27, 2022
2b1d97d
Fix build - as new files were added to qmake build
diegoiast Jul 17, 2022
86822ce
Move new macro to the hpp file, this reduces the changes on main code
diegoiast Jul 17, 2022
6c33eab
re-enable windows build
diegoiast Jul 18, 2022
47e1558
Fix Qt6 support
diegoiast Jul 18, 2022
49c5869
Use Qt6 on CI
diegoiast Jul 18, 2022
212d5c8
missing compat module...
diegoiast Jul 18, 2022
e9cfdac
Update ubuntu builder to 20.04
diegoiast Jul 18, 2022
b4368bd
Fix compilation for version 0.5.5
diegoiast Sep 24, 2022
69f4f68
Build using ninja
diegoiast Sep 25, 2022
1e22932
Updates to various libraries
diegoiast Sep 25, 2022
6c17f3a
Fix build
diegoiast Sep 25, 2022
e14db3a
Fix building on windows
diegoiast Sep 25, 2022
4f258ac
Debug linux build, lets try building a DMG
diegoiast Sep 25, 2022
82ad512
Debug linux build, lets try building a DMG (fix)
diegoiast Sep 25, 2022
98814e3
fix mac + ubuntu build images?
diegoiast Sep 25, 2022
6b43166
Does this fix the macos build...?
diegoiast Sep 27, 2022
ea0924b
Merge remote-tracking branch 'upstream/master' into cmake-build
diegoiast Sep 27, 2022
3368536
Move to a local build system for QSimpleUpdater
diegoiast Sep 29, 2022
b418cba
Simplify build system
diegoiast Oct 3, 2022
4ece07f
Fix compilation
diegoiast Oct 3, 2022
4a88b2d
Merge remote-tracking branch 'upstream/master' into cmake-build
diegoiast Oct 3, 2022
ff27b7e
Fix compilation and appimage ?
diegoiast Oct 3, 2022
03fbc1f
Fix windows build, increase qt version
diegoiast Oct 3, 2022
f3b0954
Partly revert b418cbad250dbf74abb70c83f857ea1a2dd198a7
diegoiast Oct 3, 2022
b2bdb2b
Lexilla is built statically on the CI, wtf
diegoiast Oct 3, 2022
c75f333
all libraries are build statically on ci!
diegoiast Oct 3, 2022
45d8c29
Merge remote-tracking branch 'upstream/master' into cmake-build
diegoiast Oct 17, 2022
4fa992a
Merge remote-tracking branch 'upstream/master' into cmake-build
diegoiast Oct 31, 2022
9170d8f
Remove initialization of ADS
diegoiast Nov 3, 2022
2bd9274
Fix build on Windows
diegoiast Nov 3, 2022
c1a91a5
Merge branch 'master' into cmake-build
diegoiast Nov 3, 2022
2f7ef95
Fix build - new file added
diegoiast Nov 3, 2022
dbdbc1f
Merge remote-tracking branch 'upstream/master' into cmake-build
diegoiast Nov 7, 2022
3707317
New files added to the build - FileDialogHelpers
diegoiast Nov 8, 2022
91f4094
Reduce some warnings (#257)
diegoiast Nov 9, 2022
1aa4045
Disable Scintilla symbols being exported from EXE
dail8859 Nov 11, 2022
082c7d6
Add codespell workflow to check for spelling errors (#266)
dail8859 Nov 11, 2022
6933aa2
Adjust logic to force window to foreground on Windows
dail8859 Nov 12, 2022
749a406
Merge remote-tracking branch 'upstream/master' into cmake-build
diegoiast Nov 16, 2022
e9b58cb
Merge remote-tracking branch 'upstream/master' into cmake-build
diegoiast Nov 19, 2022
5f225b0
Compile decorators/URLFinder.cpp
diegoiast Nov 19, 2022
9bcd559
Update versions.. .for almost everything
diegoiast Nov 19, 2022
6d4ca35
Merge branch 'cmake-build' of https://github.com/elcuco/NotepadNext i…
diegoiast Nov 19, 2022
311bbc0
Update scintilla-code to a version that compiles on Windows
diegoiast Nov 19, 2022
dc3b61c
Merge remote-tracking branch 'upstream/master' into cmake-build
diegoiast Nov 30, 2022
1624591
Update cmake to display version 0.5.6. as main
diegoiast Nov 30, 2022
45bee8f
Merge branch 'master' into cmake-build
diegoiast Dec 5, 2022
0c40bd3
Fix buildings
diegoiast Dec 5, 2022
ac632bb
Use Qt 6.4.1 for builds, as QMake/master does
diegoiast Dec 5, 2022
6f3b8c8
Fix Lexilla build - using upstream version 5.2.1
diegoiast Dec 7, 2022
333d3f4
Merge remote-tracking branch 'upstream/master' into cmake-build
diegoiast Dec 23, 2022
e687865
Merge branch 'master' into cmake-build
diegoiast Feb 10, 2023
c1c4dfd
Added new files to the CMake build
diegoiast Feb 10, 2023
0254f14
Version updates
diegoiast Feb 10, 2023
e7dd220
Update building documentation for Qt6
diegoiast Feb 10, 2023
6195ddb
Merge branch 'master' into cmake-build
diegoiast Mar 4, 2023
d4615e5
Merge branch 'master' into cmake-build
diegoiast Mar 17, 2023
c59c7eb
New search functionality from master
diegoiast Mar 17, 2023
4e76321
Update Qt versions, and on linux - build on newer ubuntu
diegoiast Mar 17, 2023
27cdd3e
Use Ubuntu 20.04, and install fuse, this should fix build
diegoiast Mar 18, 2023
78ff74a
This should fix build on ubuntu
diegoiast Mar 18, 2023
ca88456
Reduce warnings on build (checkout)
diegoiast Mar 18, 2023
2d5825e
Reduce warnings on build (upload-artifact)
diegoiast Mar 18, 2023
24f4413
Merge branch 'master' into cmake-build
diegoiast Nov 28, 2023
d34fe4d
Fix compilation against main
diegoiast Nov 28, 2023
80e5151
Updated Qt version, minor tweaks to app image building
diegoiast Nov 28, 2023
66b5a35
compile using qt65 on osx, maybe this fixes compilation errors?
diegoiast Nov 28, 2023
bc794b0
compile using qt6.6.1 - change target deployment on osx
diegoiast Nov 28, 2023
b640125
fixing osx compilation problem?
diegoiast Nov 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,79 @@ env:
QT_RELEASE_VER: 6.5

jobs:
cmake-build:
strategy:
fail-fast: false
matrix:
config:
-
qt_version: "6.6.1"
modules: "qt5compat"
os: ubuntu-20.04
-
qt_version: "6.6.1"
modules: "qt5compat"
os: windows-latest
-
qt_version: "6.6.1"
modules: "qt5compat"
os: macos-latest

runs-on: ${{ matrix.config.os }}

steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.config.qt_version }}
modules: ${{ matrix.config.modules }}

- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master

- name: Setup (Linux)
if: startsWith (matrix.config.os, 'ubuntu')
run: |
echo "DISTRIBUTION=AppImage" >> "$GITHUB_ENV"
sudo apt-get install libxkbcommon-dev libxkbcommon-x11-0 fuse libxcb-cursor-dev

- name: Setup VS tools (Windows)
if: startsWith (matrix.config.os, 'windows')
uses: egor-tensin/vs-shell@v2
with:
arch: x64

- name: Compile
run: |
cmake -S . -B cbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC=ON
cmake --build cbuild

- name: Create App Image
if: startsWith (matrix.config.os, 'ubuntu')
run: |
cmake --install cbuild --prefix=${{ github.workspace }}/cbuild/AppDir/usr/
cd cbuild

wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage"
chmod +x linuxdeploy*.AppImage

export OUTPUT=NotepadNext-x86_64.AppImage
export LD_LIBRARY_PATH=AppDir/usr/lib/:$LD_LIBRARY_PATH
export DEBUG=1
./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage

- name: Upload AppImage
if: startsWith (matrix.config.os, 'ubuntu')
uses: actions/upload-artifact@v3
with:
name: NotepadNext-Linux-Qt${{ matrix.config.qt_version }}-cmake-AppImage
path: ${{ github.workspace }}/cbuild/NotepadNext-x86_64.AppImage

build:
strategy:
fail-fast: false
Expand Down
44 changes: 44 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
cmake_minimum_required(VERSION 3.20)

project(NotepadNext)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(CPM.cmake)

# setup SingleApplication
set(QAPPLICATION_CLASS QApplication)
set(QT_DEFAULT_MAJOR_VERSION 6)

# setup QDS
set(BUILD_EXAMPLES OFF)

# setup uchardet
set(BUILD_BINARY OFF)
set(BUILD_STATICCACHE OFF)
set(BUILD_SHARED_LIBS OFF)


# an commit after v0.0.8
CPMAddPackage(NAME uchardet
GIT_REPOSITORY https://gitlab.freedesktop.org/uchardet/uchardet
GIT_TAG 2f5c24006ebc7f005040358f58f22a61a3c92522)
CPMAddPackage("gh:vinniefalco/LuaBridge#5d21e35633a1f87ed08af115b07d3386096f792b")
CPMAddPackage("gh:githubuser0xFFFF/Qt-Advanced-Docking-System#4.1.1")
CPMAddPackage("gh:itay-grudev/SingleApplication#v3.5.1")
CPMAddPackage("gh:editorconfig/editorconfig-core-qt#bf86460fe29b53731bba650d2a59d4c47eb25de9")

# the following libraries have no upstream cmake support,
# so we do own own locally (internally they clone the upstream repo)
include(lua.cmake)
include(qsimpleupdater.cmake)

# This is scintilla - which upstream uses mercurial, and as part of the build
# they need python. This fork uses github, and has auto-generated files as
# part of the repo.
#
CPMAddPackage("gh:elcuco/scintilla-code#rel-5-3-3-cmake")
#CPMAddPackage("gh:elcuco/lexilla#rel-5-2-1-cmake")
include(lexilla.cmake)

add_subdirectory(src/NotepadNext)
24 changes: 24 additions & 0 deletions CPM.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SPDX-License-Identifier: MIT
#
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors

set(CPM_DOWNLOAD_VERSION 0.38.6)
set(CPM_HASH_SUM "11c3fa5f1ba14f15d31c2fb63dbc8628ee133d81c8d764caad9a8db9e0bacb07")

if(CPM_SOURCE_CACHE)
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
else()
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
endif()

# Expand relative path. This is important if the provided path contains a tilde (~)
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)

file(DOWNLOAD
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM}
)

include(${CPM_DOWNLOAD_LOCATION})
32 changes: 31 additions & 1 deletion doc/Building.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,42 @@ This section specifically describes how to build Notepad Next using Microsoft's

Using a fresh Ubuntu 21.10 setup, the following script will install the needed dependencies and build the executable:

Note - that while Qt5 can be built, we are not longer effectively supporting it,
nor recommending it. Please build using Qt6 only. Qt5 is not effectively removed
but it is not used, so code base might rot - and not work/compile.

```
sudo apt install qtbase5-dev qt5-qmake qtbase5-dev-tools qttools5-dev-tools qtbase5-private-dev libqt5x11extras5-dev build-essential git
sudo apt install qtbase6-dev qt6-qmake qtbase6-dev-tools qtbase6-private-dev qt6-5compat-dev build-essential git
git clone --recurse-submodules https://github.com/dail8859/NotepadNext.git
cd NotepadNext
mkdir build
cd build
qmake ../src/NotepadNext.pro
make -j$(nproc)
```

# CMake support

To build this project using CMake (currently the official way is QMake), you should type this
on the command line (tested on Linux, but should work on Windows as well as OSX):

```
cmake -S . -B cbuild -G Ninja
cmake --build cbuild
```

If you are using Visual Studio - you can open the directory containing the source
and then use CMake directly on Visual Studio, no addons needed (as Visual Studio 2019
and above have really good support for CMake).

Using CLion should be similar - just open the directory inside CLion and you
should be ready to code.

Currently CMake uses [CPM](https://github.com/cpm-cmake/CPM.cmake) to pull all 3rd parties (originally 3rd parties where
a mix of submodules and in-repo code). The initial config should take a large time
(the main time consumer is cloning of scintilla).

A future goal is to move all 3rd party dependencies to conan or vcpkg (or some
other package manager). This will also give us pre-compiled 3rd parties which
will reduce compile times as we will use pre-compiled binaries - and will ease the
ability to gain build-reproducability.
168 changes: 168 additions & 0 deletions lexilla.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
CPMAddPackage("gh:ScintillaOrg/lexilla#rel-5-2-2")

if (lexilla_ADDED)
add_library(lexilla
${lexilla_SOURCE_DIR}/src/Lexilla.cxx
${lexilla_SOURCE_DIR}/access/LexillaAccess.cxx
${lexilla_SOURCE_DIR}/access/LexillaAccess.h
${lexilla_SOURCE_DIR}/lexlib/Accessor.cxx
${lexilla_SOURCE_DIR}/lexlib/Accessor.h
${lexilla_SOURCE_DIR}/lexlib/CatalogueModules.h
${lexilla_SOURCE_DIR}/lexlib/CharacterCategory.cxx
${lexilla_SOURCE_DIR}/lexlib/CharacterCategory.h
${lexilla_SOURCE_DIR}/lexlib/CharacterSet.cxx
${lexilla_SOURCE_DIR}/lexlib/CharacterSet.h
${lexilla_SOURCE_DIR}/lexlib/DefaultLexer.cxx
${lexilla_SOURCE_DIR}/lexlib/DefaultLexer.h
${lexilla_SOURCE_DIR}/lexlib/LexAccessor.cxx
${lexilla_SOURCE_DIR}/lexlib/LexAccessor.h
${lexilla_SOURCE_DIR}/lexlib/LexerBase.cxx
${lexilla_SOURCE_DIR}/lexlib/LexerBase.h
${lexilla_SOURCE_DIR}/lexlib/LexerModule.cxx
${lexilla_SOURCE_DIR}/lexlib/LexerModule.h
${lexilla_SOURCE_DIR}/lexlib/LexerNoExceptions.cxx
${lexilla_SOURCE_DIR}/lexlib/LexerNoExceptions.h
${lexilla_SOURCE_DIR}/lexlib/LexerSimple.cxx
${lexilla_SOURCE_DIR}/lexlib/LexerSimple.h
${lexilla_SOURCE_DIR}/lexlib/OptionSet.h
${lexilla_SOURCE_DIR}/lexlib/PropSetSimple.cxx
${lexilla_SOURCE_DIR}/lexlib/PropSetSimple.h
${lexilla_SOURCE_DIR}/lexlib/SparseState.h
${lexilla_SOURCE_DIR}/lexlib/StringCopy.h
${lexilla_SOURCE_DIR}/lexlib/StyleContext.cxx
${lexilla_SOURCE_DIR}/lexlib/StyleContext.h
${lexilla_SOURCE_DIR}/lexlib/SubStyles.h
${lexilla_SOURCE_DIR}/lexlib/WordList.cxx
${lexilla_SOURCE_DIR}/lexlib/WordList.h
${lexilla_SOURCE_DIR}/lexers/LexA68k.cxx
${lexilla_SOURCE_DIR}/lexers/LexAbaqus.cxx
${lexilla_SOURCE_DIR}/lexers/LexAda.cxx
${lexilla_SOURCE_DIR}/lexers/LexAPDL.cxx
${lexilla_SOURCE_DIR}/lexers/LexAsciidoc.cxx
${lexilla_SOURCE_DIR}/lexers/LexAsm.cxx
${lexilla_SOURCE_DIR}/lexers/LexAsn1.cxx
${lexilla_SOURCE_DIR}/lexers/LexASY.cxx
${lexilla_SOURCE_DIR}/lexers/LexAU3.cxx
${lexilla_SOURCE_DIR}/lexers/LexAVE.cxx
${lexilla_SOURCE_DIR}/lexers/LexAVS.cxx
${lexilla_SOURCE_DIR}/lexers/LexBaan.cxx
${lexilla_SOURCE_DIR}/lexers/LexBash.cxx
${lexilla_SOURCE_DIR}/lexers/LexBasic.cxx
${lexilla_SOURCE_DIR}/lexers/LexBatch.cxx
${lexilla_SOURCE_DIR}/lexers/LexBibTeX.cxx
${lexilla_SOURCE_DIR}/lexers/LexBullant.cxx
${lexilla_SOURCE_DIR}/lexers/LexCaml.cxx
${lexilla_SOURCE_DIR}/lexers/LexCIL.cxx
${lexilla_SOURCE_DIR}/lexers/LexCLW.cxx
${lexilla_SOURCE_DIR}/lexers/LexCmake.cxx
${lexilla_SOURCE_DIR}/lexers/LexCOBOL.cxx
${lexilla_SOURCE_DIR}/lexers/LexCoffeeScript.cxx
${lexilla_SOURCE_DIR}/lexers/LexConf.cxx
${lexilla_SOURCE_DIR}/lexers/LexCPP.cxx
${lexilla_SOURCE_DIR}/lexers/LexCrontab.cxx
${lexilla_SOURCE_DIR}/lexers/LexCsound.cxx
${lexilla_SOURCE_DIR}/lexers/LexCSS.cxx
${lexilla_SOURCE_DIR}/lexers/LexDataflex.cxx
${lexilla_SOURCE_DIR}/lexers/LexD.cxx
${lexilla_SOURCE_DIR}/lexers/LexDiff.cxx
${lexilla_SOURCE_DIR}/lexers/LexDMAP.cxx
${lexilla_SOURCE_DIR}/lexers/LexDMIS.cxx
${lexilla_SOURCE_DIR}/lexers/LexECL.cxx
${lexilla_SOURCE_DIR}/lexers/LexEDIFACT.cxx
${lexilla_SOURCE_DIR}/lexers/LexEiffel.cxx
${lexilla_SOURCE_DIR}/lexers/LexErlang.cxx
${lexilla_SOURCE_DIR}/lexers/LexErrorList.cxx
${lexilla_SOURCE_DIR}/lexers/LexEScript.cxx
${lexilla_SOURCE_DIR}/lexers/LexFlagship.cxx
${lexilla_SOURCE_DIR}/lexers/LexForth.cxx
${lexilla_SOURCE_DIR}/lexers/LexFortran.cxx
${lexilla_SOURCE_DIR}/lexers/LexFSharp.cxx
${lexilla_SOURCE_DIR}/lexers/LexGAP.cxx
${lexilla_SOURCE_DIR}/lexers/LexGDScript.cxx
${lexilla_SOURCE_DIR}/lexers/LexGui4Cli.cxx
${lexilla_SOURCE_DIR}/lexers/LexHaskell.cxx
${lexilla_SOURCE_DIR}/lexers/LexHex.cxx
${lexilla_SOURCE_DIR}/lexers/LexHollywood.cxx
${lexilla_SOURCE_DIR}/lexers/LexHTML.cxx
${lexilla_SOURCE_DIR}/lexers/LexIndent.cxx
${lexilla_SOURCE_DIR}/lexers/LexInno.cxx
${lexilla_SOURCE_DIR}/lexers/LexJSON.cxx
${lexilla_SOURCE_DIR}/lexers/LexJulia.cxx
${lexilla_SOURCE_DIR}/lexers/LexKix.cxx
${lexilla_SOURCE_DIR}/lexers/LexKVIrc.cxx
${lexilla_SOURCE_DIR}/lexers/LexLaTeX.cxx
${lexilla_SOURCE_DIR}/lexers/LexLisp.cxx
${lexilla_SOURCE_DIR}/lexers/LexLout.cxx
${lexilla_SOURCE_DIR}/lexers/LexLua.cxx
${lexilla_SOURCE_DIR}/lexers/LexMagik.cxx
${lexilla_SOURCE_DIR}/lexers/LexMake.cxx
${lexilla_SOURCE_DIR}/lexers/LexMarkdown.cxx
${lexilla_SOURCE_DIR}/lexers/LexMatlab.cxx
${lexilla_SOURCE_DIR}/lexers/LexMaxima.cxx
${lexilla_SOURCE_DIR}/lexers/LexMetapost.cxx
${lexilla_SOURCE_DIR}/lexers/LexMMIXAL.cxx
${lexilla_SOURCE_DIR}/lexers/LexModula.cxx
${lexilla_SOURCE_DIR}/lexers/LexMPT.cxx
${lexilla_SOURCE_DIR}/lexers/LexMSSQL.cxx
${lexilla_SOURCE_DIR}/lexers/LexMySQL.cxx
${lexilla_SOURCE_DIR}/lexers/LexNim.cxx
${lexilla_SOURCE_DIR}/lexers/LexNimrod.cxx
${lexilla_SOURCE_DIR}/lexers/LexNsis.cxx
${lexilla_SOURCE_DIR}/lexers/LexNull.cxx
${lexilla_SOURCE_DIR}/lexers/LexOpal.cxx
${lexilla_SOURCE_DIR}/lexers/LexOScript.cxx
${lexilla_SOURCE_DIR}/lexers/LexPascal.cxx
${lexilla_SOURCE_DIR}/lexers/LexPB.cxx
${lexilla_SOURCE_DIR}/lexers/LexPerl.cxx
${lexilla_SOURCE_DIR}/lexers/LexPLM.cxx
${lexilla_SOURCE_DIR}/lexers/LexPO.cxx
${lexilla_SOURCE_DIR}/lexers/LexPOV.cxx
${lexilla_SOURCE_DIR}/lexers/LexPowerPro.cxx
${lexilla_SOURCE_DIR}/lexers/LexPowerShell.cxx
${lexilla_SOURCE_DIR}/lexers/LexProgress.cxx
${lexilla_SOURCE_DIR}/lexers/LexProps.cxx
${lexilla_SOURCE_DIR}/lexers/LexPS.cxx
${lexilla_SOURCE_DIR}/lexers/LexPython.cxx
${lexilla_SOURCE_DIR}/lexers/LexRaku.cxx
${lexilla_SOURCE_DIR}/lexers/LexR.cxx
${lexilla_SOURCE_DIR}/lexers/LexRebol.cxx
${lexilla_SOURCE_DIR}/lexers/LexRegistry.cxx
${lexilla_SOURCE_DIR}/lexers/LexRuby.cxx
${lexilla_SOURCE_DIR}/lexers/LexRust.cxx
${lexilla_SOURCE_DIR}/lexers/LexSAS.cxx
${lexilla_SOURCE_DIR}/lexers/LexScriptol.cxx
${lexilla_SOURCE_DIR}/lexers/LexSmalltalk.cxx
${lexilla_SOURCE_DIR}/lexers/LexSML.cxx
${lexilla_SOURCE_DIR}/lexers/LexSorcus.cxx
${lexilla_SOURCE_DIR}/lexers/LexSpecman.cxx
${lexilla_SOURCE_DIR}/lexers/LexSpice.cxx
${lexilla_SOURCE_DIR}/lexers/LexSQL.cxx
${lexilla_SOURCE_DIR}/lexers/LexStata.cxx
${lexilla_SOURCE_DIR}/lexers/LexSTTXT.cxx
${lexilla_SOURCE_DIR}/lexers/LexTACL.cxx
${lexilla_SOURCE_DIR}/lexers/LexTADS3.cxx
${lexilla_SOURCE_DIR}/lexers/LexTAL.cxx
${lexilla_SOURCE_DIR}/lexers/LexTCL.cxx
${lexilla_SOURCE_DIR}/lexers/LexTCMD.cxx
${lexilla_SOURCE_DIR}/lexers/LexTeX.cxx
${lexilla_SOURCE_DIR}/lexers/LexTxt2tags.cxx
${lexilla_SOURCE_DIR}/lexers/LexVB.cxx
${lexilla_SOURCE_DIR}/lexers/LexVerilog.cxx
${lexilla_SOURCE_DIR}/lexers/LexVHDL.cxx
${lexilla_SOURCE_DIR}/lexers/LexVisualProlog.cxx
${lexilla_SOURCE_DIR}/lexers/LexX12.cxx
${lexilla_SOURCE_DIR}/lexers/LexYAML.cxx
)

target_link_libraries(lexilla PRIVATE scintilla-qt-edit)
target_include_directories(lexilla PUBLIC
${lexilla_SOURCE_DIR}/include/
)
target_include_directories(lexilla PRIVATE
${lexilla_SOURCE_DIR}/access/
${lexilla_SOURCE_DIR}/lexlib/
${lexilla_SOURCE_DIR}/include/
)
set_property(TARGET lexilla PROPERTY VERSION "5.22")
set_property(TARGET lexilla PROPERTY SOVERSION 5 )
endif()
16 changes: 16 additions & 0 deletions lua.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CPMAddPackage("gh:lua/lua#26be27459b11feabed52cf40aaa76f86c7edc977")

if (lua_ADDED)
set(CMAKE_C_STANDARD 99)
FILE(GLOB lua_sources ${lua_SOURCE_DIR}/*.c)
list(REMOVE_ITEM lua_sources "${lua_SOURCE_DIR}/lua.c" "${lua_SOURCE_DIR}/luac.c" "${lua_SOURCE_DIR}/onelua.c")
add_library(lua STATIC ${lua_sources})
target_include_directories(lua PUBLIC $<BUILD_INTERFACE:${lua_SOURCE_DIR}>)
#target_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")

if (WINDOWS)
target_compile_definitions(lua PRIVATE "-DLUA_USE_WINDOWS")
endif()

target_compile_definitions(lua PRIVATE "-DLUA_COMPAT_5_2")
endif()
Loading
Loading