libssh2 now included. CMake build cleaned up.

This commit is contained in:
Scott Duensing 2022-12-20 18:13:47 -06:00
parent b2905df911
commit c218812ef7
5 changed files with 47 additions and 27 deletions

1
.gitignore vendored
View file

@ -3,6 +3,7 @@
crapForLater/ crapForLater/
thirdparty/scintilla/ thirdparty/scintilla/
thirdparty/lexilla/ thirdparty/lexilla/
thirdparty/libssh2-1.10.0/
ui/generated/ ui/generated/
cmake-build-debug/ cmake-build-debug/
flatpak-build/ flatpak-build/

View file

@ -21,6 +21,8 @@
cmake_minimum_required(VERSION 3.22) cmake_minimum_required(VERSION 3.22)
include(FindPkgConfig)
project(joeydev LANGUAGES C VERSION 1.0) project(joeydev LANGUAGES C VERSION 1.0)
# There are also version numbers in: # There are also version numbers in:
@ -60,40 +62,37 @@ add_custom_target(GENERATE_UI_HEADERS
BYPRODUCTS BYPRODUCTS
${CMAKE_SOURCE_DIR}/thirdparty/scintilla/bin/scintilla.a ${CMAKE_SOURCE_DIR}/thirdparty/scintilla/bin/scintilla.a
${CMAKE_SOURCE_DIR}/thirdparty/lexilla/bin/liblexilla.a ${CMAKE_SOURCE_DIR}/thirdparty/lexilla/bin/liblexilla.a
${CMAKE_SOURCE_DIR}/thirdparty/libssh2-1.10.0/src/libssh2.a
) )
add_dependencies(${CMAKE_PROJECT_NAME} GENERATE_UI_HEADERS) add_dependencies(${CMAKE_PROJECT_NAME} GENERATE_UI_HEADERS)
# Find dependencies. # Find dependencies.
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
# GTK+ 3.0 is a PITA. This will be fixed in CMake 3.25 when FindGTK3 finally shows up.
execute_process(COMMAND pkg-config --cflags gtk+-3.0
OUTPUT_VARIABLE OUT_TMP_VAR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(STRIP ${OUT_TMP_VAR} GTK3_CFLAGS)
execute_process(COMMAND pkg-config --libs gtk+-3.0
OUTPUT_VARIABLE OUT_TMP_VAR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(STRIP ${OUT_TMP_VAR} GTK3_LIBRARIES)
# Compile Options. # Compile Options.
include_directories( include_directories(
${GTK3_INCLUDE_DIRS}
${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}
include include
ui/generated ui/generated
thirdparty/libssh2-1.10.0/include
thirdparty/scintilla/include thirdparty/scintilla/include
thirdparty/lexilla/include thirdparty/lexilla/include
thirdparty/memwatch thirdparty/memwatch
) )
add_definitions( add_definitions(
${GTK3_CFLAGS}
-Wall -Wall
-Wno-unknown-pragmas -Wno-unknown-pragmas
-O2 -O2
${GTK3_CFLAGS} )
target_link_directories(${CMAKE_PROJECT_NAME} PUBLIC
${GTK3_LIBRARY_DIRS}
) )
@ -101,7 +100,14 @@ target_link_libraries(${CMAKE_PROJECT_NAME}
-rdynamic -rdynamic
${CMAKE_SOURCE_DIR}/thirdparty/scintilla/bin/scintilla.a ${CMAKE_SOURCE_DIR}/thirdparty/scintilla/bin/scintilla.a
${CMAKE_SOURCE_DIR}/thirdparty/lexilla/bin/liblexilla.a ${CMAKE_SOURCE_DIR}/thirdparty/lexilla/bin/liblexilla.a
${CMAKE_SOURCE_DIR}/thirdparty/libssh2-1.10.0/src/libssh2.a
${GTK3_LIBRARIES} ${GTK3_LIBRARIES}
# -lgpg-error
# -lssl
# -lcrypto
# -ldl
# -pthread
# -lz
-lm -lm
-lstdc++ -lstdc++
) )

View file

@ -55,6 +55,10 @@ modules:
path: thirdparty/lexilla520.tgz path: thirdparty/lexilla520.tgz
dest: thirdparty/ dest: thirdparty/
- type: file
path: thirdparty/libssh2-1.10.0.tar.gz
dest: thirdparty/
- type: file - type: file
path: CMakeLists.txt path: CMakeLists.txt

BIN
thirdparty/libssh2-1.10.0.tar.gz vendored Normal file

Binary file not shown.

View file

@ -27,26 +27,35 @@ ROOT=$1
pushd "${ROOT}" || exit &> /dev/null pushd "${ROOT}" || exit &> /dev/null
if [[ ! -f thirdparty/scintilla/bin/scintilla.a ]]; then pushd thirdparty || exit &> /dev/null
pushd thirdparty || exit &> /dev/null
echo Building Dependency: Scintilla... if [[ ! -f scintilla/bin/scintilla.a ]]; then
tar xzf scintilla531.tgz echo Building Dependency: Scintilla...
pushd scintilla/gtk || exit &> /dev/null tar xzf scintilla531.tgz
GTK3=1 make pushd scintilla/gtk || exit &> /dev/null
popd || true &> /dev/null GTK3=1 make
popd || true &> /dev/null popd || true &> /dev/null
fi fi
if [[ ! -f thirdparty/lexilla/bin/liblexilla.a ]]; then if [[ ! -f lexilla/bin/liblexilla.a ]]; then
pushd thirdparty || exit &> /dev/null echo Building Dependency: Lexilla...
echo Building Dependency: Lexilla... tar xzf lexilla520.tgz
tar xzf lexilla520.tgz pushd lexilla/src || exit &> /dev/null
pushd lexilla/src || exit &> /dev/null make
make
popd || true &> /dev/null
popd || true &> /dev/null popd || true &> /dev/null
fi fi
if [[ ! -f libssh2-1.10.0/src/libssh2.a ]]; then
echo Building Dependency: libssh2...
tar xzf libssh2-1.10.0.tar.gz
pushd libssh2-1.10.0 || exit &> /dev/null
cmake -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DENABLE_ZLIB_COMPRESSION=ON -G Ninja -S . -B .
ninja
popd || true &> /dev/null
fi
popd || true &> /dev/null
echo Generating UI Embedded Code... echo Generating UI Embedded Code...
mkdir -p ui/generated mkdir -p ui/generated
glib-compile-resources \ glib-compile-resources \