Compare commits
6 Commits
v0.2.1
...
bc1dd64fdf
| Author | SHA1 | Date | |
|---|---|---|---|
|
bc1dd64fdf
|
|||
|
8c290df7b5
|
|||
|
5fc35517cb
|
|||
|
5a4cffd35e
|
|||
|
3a087ad581
|
|||
|
4305c603e9
|
@@ -1,5 +1,5 @@
|
|||||||
# The last version with Windows XP support is 3.13, we want to keep that
|
# The last version with Windows XP support is 3.13, we want to keep that
|
||||||
cmake_minimum_required (VERSION 3.9)
|
cmake_minimum_required (VERSION 3.10)
|
||||||
project (logdiag VERSION 0.2.1 LANGUAGES C)
|
project (logdiag VERSION 0.2.1 LANGUAGES C)
|
||||||
|
|
||||||
# Options
|
# Options
|
||||||
@@ -250,13 +250,22 @@ endif (BUILD_TESTING)
|
|||||||
|
|
||||||
# Generate documentation
|
# Generate documentation
|
||||||
if (GTKDOC_FOUND)
|
if (GTKDOC_FOUND)
|
||||||
# FIXME: not our bug but xml/gtkdocentities.ent cannot be passed
|
# Extracted LDFLAGS didn't contain -l in CMake 3.21.3 and gtk-doc 1.33.2,
|
||||||
target_link_libraries (liblogdiag ${logdiag_LIBS})
|
# pass them explicitly and work around insanity; CMake still exits with
|
||||||
|
# an error and gtk-doc produces empty HTML documentation
|
||||||
|
string (REGEX REPLACE "(;)([^-])" "\\1-l\\2" xldflags "${logdiag_LIBS}")
|
||||||
|
set_target_properties (liblogdiag PROPERTIES LINK_LIBRARIES "")
|
||||||
|
|
||||||
|
# The "official" module wants an XML file I don't want to give it
|
||||||
|
file (WRITE ${PROJECT_BINARY_DIR}/liblogdiag-docs-dummy.xml "<book/>")
|
||||||
|
|
||||||
|
# XXX: not our bug but xml/gtkdocentities.ent cannot be passed
|
||||||
|
# XXX: this causes `make clean` to remove the entire build directory,
|
||||||
|
# because it marks CMAKE_CURRENT_BINARY_DIR as an output
|
||||||
gtk_doc_add_module (liblogdiag
|
gtk_doc_add_module (liblogdiag
|
||||||
SOURCE ${PROJECT_SOURCE_DIR}/liblogdiag
|
SOURCE ${PROJECT_SOURCE_DIR}/liblogdiag
|
||||||
SUFFIXES c h
|
SUFFIXES c h LDFLAGS "-l${xldflags}"
|
||||||
# The "official" module wants an XML file I don't want to give it
|
XML ${PROJECT_BINARY_DIR}/liblogdiag-docs-dummy.xml
|
||||||
XML ${PROJECT_BINARY_DIR}/liblogdiag/liblogdiag-docs.xml
|
|
||||||
LIBRARIES liblogdiag)
|
LIBRARIES liblogdiag)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
@@ -333,8 +342,7 @@ if (WIN32)
|
|||||||
install (DIRECTORY
|
install (DIRECTORY
|
||||||
${WIN32_DEPENDS_PATH}/bin/
|
${WIN32_DEPENDS_PATH}/bin/
|
||||||
DESTINATION .
|
DESTINATION .
|
||||||
FILES_MATCHING PATTERN "*.dll"
|
FILES_MATCHING PATTERN "*.dll")
|
||||||
PATTERN "libgettext*" EXCLUDE)
|
|
||||||
install (DIRECTORY
|
install (DIRECTORY
|
||||||
${WIN32_DEPENDS_PATH}/etc/
|
${WIN32_DEPENDS_PATH}/etc/
|
||||||
DESTINATION etc)
|
DESTINATION etc)
|
||||||
@@ -366,6 +374,8 @@ if (WIN32)
|
|||||||
DESTINATION share/locale)
|
DESTINATION share/locale)
|
||||||
endif (translation_found GREATER -1)
|
endif (translation_found GREATER -1)
|
||||||
endforeach (locale)
|
endforeach (locale)
|
||||||
|
|
||||||
|
install (SCRIPT Win32Cleanup.cmake)
|
||||||
else (WIN32)
|
else (WIN32)
|
||||||
install (TARGETS logdiag DESTINATION bin)
|
install (TARGETS logdiag DESTINATION bin)
|
||||||
install (FILES share/logdiag.desktop DESTINATION share/applications)
|
install (FILES share/logdiag.desktop DESTINATION share/applications)
|
||||||
@@ -379,11 +389,11 @@ endif (WIN32)
|
|||||||
|
|
||||||
install (DIRECTORY share/gui share/library DESTINATION share/${PROJECT_NAME})
|
install (DIRECTORY share/gui share/library DESTINATION share/${PROJECT_NAME})
|
||||||
install (FILES ${GSETTINGS_SCHEMAS} DESTINATION share/glib-2.0/schemas)
|
install (FILES ${GSETTINGS_SCHEMAS} DESTINATION share/glib-2.0/schemas)
|
||||||
install (CODE " # DESTDIR is not in use on Windows
|
install (CODE " # DESTDIR is not in use on Windows (WIN32 is only native here!)
|
||||||
if (WIN32 OR \"\$ENV{DESTDIR}\" STREQUAL \"\")
|
if (WIN32 OR \"\$ENV{DESTDIR}\" STREQUAL \"\")
|
||||||
execute_process (COMMAND \"${GLIB_COMPILE_SCHEMAS_EXECUTABLE}\"
|
execute_process (COMMAND \"${GLIB_COMPILE_SCHEMAS_EXECUTABLE}\"
|
||||||
\"\${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas\")
|
\"\${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas\")
|
||||||
endif (WIN32 OR \"\$ENV{DESTDIR}\" STREQUAL \"\")")
|
endif ()")
|
||||||
|
|
||||||
# CPack
|
# CPack
|
||||||
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Schematic editor")
|
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Schematic editor")
|
||||||
@@ -409,19 +419,23 @@ set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${PROJECT_NAME}")
|
|||||||
|
|
||||||
set (CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/share\\\\header.bmp")
|
set (CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/share\\\\header.bmp")
|
||||||
set (CPACK_NSIS_INSTALLED_ICON_NAME "logdiag.exe")
|
set (CPACK_NSIS_INSTALLED_ICON_NAME "logdiag.exe")
|
||||||
set (CPACK_NSIS_CREATE_ICONS_EXTRA "
|
set (CPACK_NSIS_CREATE_ICONS_EXTRA [[
|
||||||
CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\logdiag.lnk' '\$INSTDIR\\\\logdiag.exe'")
|
CreateShortCut '$SMPROGRAMS\\$STARTMENU_FOLDER\\logdiag.lnk' '$INSTDIR\\logdiag.exe'
|
||||||
set (CPACK_NSIS_DELETE_ICONS_EXTRA "
|
]])
|
||||||
Delete '\$SMPROGRAMS\\\\$MUI_TEMP\\\\logdiag.lnk'")
|
set (CPACK_NSIS_DELETE_ICONS_EXTRA [[
|
||||||
set (CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
|
Delete '$SMPROGRAMS\\$MUI_TEMP\\logdiag.lnk'
|
||||||
|
]])
|
||||||
|
set (CPACK_NSIS_EXTRA_INSTALL_COMMANDS [[
|
||||||
WriteRegStr HKCR '.ldd' '' 'logdiag.Diagram'
|
WriteRegStr HKCR '.ldd' '' 'logdiag.Diagram'
|
||||||
WriteRegStr HKCR 'logdiag.Diagram' '' 'logdiag Diagram'
|
WriteRegStr HKCR 'logdiag.Diagram' '' 'logdiag Diagram'
|
||||||
WriteRegStr HKCR 'logdiag.Diagram\\\\shell\\\\open\\\\command' '' '\\\"\$INSTDIR\\\\logdiag.exe\\\" \\\"%1\\\"'
|
WriteRegStr HKCR 'logdiag.Diagram\\shell\\open\\command' '' '\"$INSTDIR\\logdiag.exe\" \"%1\"'
|
||||||
WriteRegStr HKCR 'logdiag.Diagram\\\\shell\\\\edit\\\\command' '' '\\\"\$INSTDIR\\\\logdiag.exe\\\" \\\"%1\\\"'
|
WriteRegStr HKCR 'logdiag.Diagram\\shell\\edit\\command' '' '\"$INSTDIR\\logdiag.exe\" \"%1\"'
|
||||||
System::Call 'shell32::SHChangeNotify(i,i,i,i) (0x08000000, 0x1000, 0, 0)'")
|
System::Call 'shell32::SHChangeNotify(i,i,i,i) (0x08000000, 0x1000, 0, 0)'
|
||||||
set (CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
|
]])
|
||||||
|
set (CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS [[
|
||||||
DeleteRegKey HKCR 'logdiag.Diagram'
|
DeleteRegKey HKCR 'logdiag.Diagram'
|
||||||
System::Call 'shell32::SHChangeNotify(i,i,i,i) (0x08000000, 0x1000, 0, 0)'")
|
System::Call 'shell32::SHChangeNotify(i,i,i,i) (0x08000000, 0x1000, 0, 0)'
|
||||||
|
]])
|
||||||
|
|
||||||
string (REPLACE "https://" "https:\\\\\\\\" project_URL_NSIS "${project_URL}")
|
string (REPLACE "https://" "https:\\\\\\\\" project_URL_NSIS "${project_URL}")
|
||||||
set (CPACK_NSIS_URL_INFO_ABOUT "${project_URL_NSIS}")
|
set (CPACK_NSIS_URL_INFO_ABOUT "${project_URL_NSIS}")
|
||||||
|
|||||||
33
README.adoc
33
README.adoc
@@ -3,7 +3,8 @@ logdiag
|
|||||||
|
|
||||||
'logdiag' is a simple multiplatform schematic editor written in GTK+.
|
'logdiag' is a simple multiplatform schematic editor written in GTK+.
|
||||||
|
|
||||||
This software has never really been finished, and is no longer being worked on.
|
This software has never really been finished, and is no longer being worked on,
|
||||||
|
although I strive to keep it building on Windows XP and elsewhere.
|
||||||
|
|
||||||
image::docs/user-guide/logdiag-en.png[align="center"]
|
image::docs/user-guide/logdiag-en.png[align="center"]
|
||||||
|
|
||||||
@@ -15,7 +16,7 @@ a package with the latest development version from Archlinux's AUR.
|
|||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
Runtime dependencies: GTK+ >= 3.8, json-glib >= 0.10.4, lua >= 5.2 +
|
Runtime dependencies: GTK+ >= 3.8, json-glib >= 0.10.4, lua >= 5.2 +
|
||||||
Build dependencies: CMake >= 3.9
|
Build dependencies: CMake >= 3.10
|
||||||
|
|
||||||
Build from source on Unix-like systems
|
Build from source on Unix-like systems
|
||||||
--------------------------------------
|
--------------------------------------
|
||||||
@@ -51,30 +52,27 @@ After _cpack_ finishes making the package, install this file.
|
|||||||
|
|
||||||
Build from source on Windows
|
Build from source on Windows
|
||||||
----------------------------
|
----------------------------
|
||||||
_Note that with the current method we're stuck with GTK+ 3.8.2._
|
_Note that using the current method we're stuck with GTK+ 3.8.2, which works
|
||||||
|
worse on Windows 10, but better on XP and under WINE._
|
||||||
|
|
||||||
First install CMake and MinGW. Add both to your system path. If you want
|
First, install CMake and MinGW. Add both to your system path. If you want
|
||||||
to build an installation package, also install NSIS. If you want to build within
|
to build an installation package, also install NSIS. If you want to build
|
||||||
a path containing spaces, fix your FindPkgConfig.cmake to say:
|
within a path containing spaces,
|
||||||
|
https://gitlab.kitware.com/cmake/cmake/-/issues/22396[fix] your CMake's
|
||||||
|
FindPkgConfig.cmake module to say:
|
||||||
|
|
||||||
separate_arguments(_pkgconfig_invoke_result UNIX_COMMAND "${_pkgconfig_invoke_result}")
|
separate_arguments(_pkgconfig_invoke_result UNIX_COMMAND "${_pkgconfig_invoke_result}")
|
||||||
|
|
||||||
Run the following command in the directory with source files to automatically
|
Run the following command in the directory with source files to automatically
|
||||||
fetch and setup all dependencies (contact me if the script becomes obsolete,
|
fetch and set up all dependencies (note that Windows XP is no longer able to
|
||||||
it's easy to fix but I usually update it only just a short while before
|
download from HTTPS sources, you'll have to run this externally):
|
||||||
releasing a new version in order to resolve compatibility issues):
|
|
||||||
|
|
||||||
> cmake -P Win32Depends.cmake
|
> cmake -P Win32Depends.cmake
|
||||||
|
|
||||||
Note that Windows XP is no longer able to reliably download from HTTPS sources.
|
Reserve a directory for an out-of-source build and let CMake prepare the build:
|
||||||
|
|
||||||
Reserve a directory for an out-of-source build:
|
|
||||||
|
|
||||||
> mkdir build
|
> mkdir build
|
||||||
> cd build
|
> cd build
|
||||||
|
|
||||||
Let CMake prepare the build:
|
|
||||||
|
|
||||||
> cmake .. -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release
|
> cmake .. -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release
|
||||||
|
|
||||||
Now you can generate a package with CPack. You may choose between:
|
Now you can generate a package with CPack. You may choose between:
|
||||||
@@ -97,9 +95,8 @@ Just install MinGW-w64 and let automation take care of the rest.
|
|||||||
$ cmake -P Win32Depends.cmake
|
$ cmake -P Win32Depends.cmake
|
||||||
$ mkdir build
|
$ mkdir build
|
||||||
$ cd build
|
$ cd build
|
||||||
$ cmake .. \
|
$ cmake -DCMAKE_TOOLCHAIN_FILE=../ToolchainCrossMinGWW64.cmake \
|
||||||
-DCMAKE_TOOLCHAIN_FILE=../ToolchainCrossMinGWW64.cmake \
|
-DCMAKE_BUILD_TYPE=Release ..
|
||||||
-DCMAKE_BUILD_TYPE=Release
|
|
||||||
$ cpack
|
$ cpack
|
||||||
|
|
||||||
Alternatively, for an unnecessarily bloated MSYS2-based 64-bit build:
|
Alternatively, for an unnecessarily bloated MSYS2-based 64-bit build:
|
||||||
|
|||||||
37
Win32Cleanup.cmake
Normal file
37
Win32Cleanup.cmake
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# To be run from cmake_install.cmake, eradicates all unreferenced libraries.
|
||||||
|
# CMake 3.9.6 has a parsing bug with ENCODING UTF-8.
|
||||||
|
cmake_minimum_required (VERSION 3.10)
|
||||||
|
|
||||||
|
# CPack runs this almost without any CMake variables at all
|
||||||
|
# (cmStateSnapshot::SetDefaultDefinitions(), CMAKE_INSTALL_PREFIX, [DESTDIR])
|
||||||
|
set (installdir "${CMAKE_INSTALL_PREFIX}")
|
||||||
|
if (NOT installdir OR installdir MATCHES "^/usr(/|$)")
|
||||||
|
return ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# The function is recursive and CMake has tragic scoping behaviour;
|
||||||
|
# environment variables are truly global there, in the absence of a cache
|
||||||
|
unset (ENV{seen})
|
||||||
|
function (expand path)
|
||||||
|
set (seen $ENV{seen})
|
||||||
|
if (path IN_LIST seen OR NOT EXISTS "${path}")
|
||||||
|
return ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
set (ENV{seen} "$ENV{seen};${path}")
|
||||||
|
file (STRINGS "${path}" strings REGEX "[.][Dd][Ll][Ll]$" ENCODING UTF-8)
|
||||||
|
foreach (string ${strings})
|
||||||
|
string (REGEX MATCH "[-.+_a-zA-Z0-9]+$" word "${string}")
|
||||||
|
expand ("${installdir}/${word}")
|
||||||
|
endforeach ()
|
||||||
|
endfunction ()
|
||||||
|
|
||||||
|
file (GLOB roots LIST_DIRECTORIES false "${installdir}/*.[Ee][Xx][Ee]"
|
||||||
|
"${installdir}/lib/gdk-pixbuf-2.0/2.10.0/loaders/*.[Dd][Ll][Ll]")
|
||||||
|
foreach (binary ${roots})
|
||||||
|
expand ("${binary}")
|
||||||
|
endforeach ()
|
||||||
|
|
||||||
|
file (GLOB libraries LIST_DIRECTORIES false "${installdir}/*.[Dd][Ll][Ll]")
|
||||||
|
list (REMOVE_ITEM libraries $ENV{seen})
|
||||||
|
file (REMOVE ${libraries})
|
||||||
@@ -6,7 +6,6 @@ cmake_minimum_required (VERSION 3.9)
|
|||||||
# Directories
|
# Directories
|
||||||
set (working_dir ${CMAKE_CURRENT_BINARY_DIR}/win32-depends)
|
set (working_dir ${CMAKE_CURRENT_BINARY_DIR}/win32-depends)
|
||||||
set (pkg_dir ${working_dir}/packages)
|
set (pkg_dir ${working_dir}/packages)
|
||||||
set (tmp_dir ${working_dir}/tmp)
|
|
||||||
file (MAKE_DIRECTORY ${working_dir})
|
file (MAKE_DIRECTORY ${working_dir})
|
||||||
file (MAKE_DIRECTORY ${pkg_dir})
|
file (MAKE_DIRECTORY ${pkg_dir})
|
||||||
|
|
||||||
@@ -93,23 +92,11 @@ foreach (pkg_set ${pkg_list})
|
|||||||
foreach (url ${pkg_${pkg_set}_urls})
|
foreach (url ${pkg_${pkg_set}_urls})
|
||||||
get_filename_component (filename ${url} NAME)
|
get_filename_component (filename ${url} NAME)
|
||||||
message (STATUS "Extracting ${filename}...")
|
message (STATUS "Extracting ${filename}...")
|
||||||
set (extract_command ${CMAKE_COMMAND} -E tar xf)
|
|
||||||
|
|
||||||
set (filename ${pkg_dir}/${filename})
|
set (filename ${pkg_dir}/${filename})
|
||||||
if (pkg_${pkg_set}_strip)
|
execute_process (COMMAND ${CMAKE_COMMAND} -E tar xf ${filename}
|
||||||
file (MAKE_DIRECTORY ${tmp_dir})
|
WORKING_DIRECTORY ${working_dir}
|
||||||
execute_process (COMMAND ${extract_command} ${filename}
|
RESULT_VARIABLE status)
|
||||||
WORKING_DIRECTORY ${tmp_dir}
|
|
||||||
RESULT_VARIABLE status)
|
|
||||||
file (COPY ${tmp_dir}/${pkg_${pkg_set}_strip}/
|
|
||||||
DESTINATION ${working_dir})
|
|
||||||
file (REMOVE_RECURSE ${tmp_dir})
|
|
||||||
else ()
|
|
||||||
execute_process (COMMAND ${extract_command} ${filename}
|
|
||||||
WORKING_DIRECTORY ${working_dir}
|
|
||||||
RESULT_VARIABLE status)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if (status)
|
if (status)
|
||||||
message (FATAL_ERROR "Extraction failed: ${status}")
|
message (FATAL_ERROR "Extraction failed: ${status}")
|
||||||
endif ()
|
endif ()
|
||||||
|
|||||||
Reference in New Issue
Block a user