Fix to work on Windows XP

This commit is contained in:
Přemysl Eric Janouch 2015-01-28 00:16:41 +01:00
parent b62b7bfa18
commit 61f7536e22
3 changed files with 26 additions and 17 deletions

View File

@ -85,6 +85,7 @@ pkg_check_modules (GTK3 REQUIRED gtk+-3.0)
if (NOT WIN32) if (NOT WIN32)
pkg_search_module (Lua52 REQUIRED lua5.2 lua-5.2 lua>=5.2) pkg_search_module (Lua52 REQUIRED lua5.2 lua-5.2 lua>=5.2)
else (NOT WIN32) else (NOT WIN32)
# XXX: this seems to require CMake 3.0 ... include it in the project?
find_package (Lua REQUIRED) find_package (Lua REQUIRED)
if (NOT LUA_FOUND OR LUA_VERSION_STRING VERSION_LESS "5.2") if (NOT LUA_FOUND OR LUA_VERSION_STRING VERSION_LESS "5.2")
message (FATAL_ERROR "Lua 5.2 not found") message (FATAL_ERROR "Lua 5.2 not found")
@ -328,17 +329,6 @@ if (OPTION_NOINSTALL)
endif (OPTION_NOINSTALL) endif (OPTION_NOINSTALL)
# Installation # Installation
install (FILES ${GSETTINGS_SCHEMAS}
DESTINATION share/glib-2.0/schemas)
install (CODE " # DESTDIR is not in use on Windows
if (WIN32 OR \"\$ENV{DESTDIR}\" STREQUAL \"\")
execute_process (COMMAND ${GLIB_COMPILE_SCHEMAS_EXECUTABLE}
\"\${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas\")
endif (WIN32 OR \"\$ENV{DESTDIR}\" STREQUAL \"\")")
install (DIRECTORY share/gui share/library
DESTINATION share/${PROJECT_NAME})
if (WIN32) if (WIN32)
install (TARGETS logdiag DESTINATION .) install (TARGETS logdiag DESTINATION .)
install (DIRECTORY install (DIRECTORY
@ -352,6 +342,10 @@ if (WIN32)
install (DIRECTORY install (DIRECTORY
${WIN32_DEPENDS_PATH}/lib/gdk-pixbuf-2.0 ${WIN32_DEPENDS_PATH}/lib/gdk-pixbuf-2.0
DESTINATION lib) DESTINATION lib)
install (DIRECTORY
${WIN32_DEPENDS_PATH}/share/glib-2.0/schemas
DESTINATION share/glib-2.0
FILES_MATCHING PATTERN "org.gtk.Settings.*")
# Avoid partial translations # Avoid partial translations
file (GLOB locales ${WIN32_DEPENDS_PATH}/share/locale/*) file (GLOB locales ${WIN32_DEPENDS_PATH}/share/locale/*)
@ -375,6 +369,17 @@ else (WIN32)
install (FILES LICENSE NEWS DESTINATION share/doc/${PROJECT_NAME}) install (FILES LICENSE NEWS DESTINATION share/doc/${PROJECT_NAME})
endif (WIN32) endif (WIN32)
install (FILES ${GSETTINGS_SCHEMAS}
DESTINATION share/glib-2.0/schemas)
install (CODE " # DESTDIR is not in use on Windows
if (WIN32 OR \"\$ENV{DESTDIR}\" STREQUAL \"\")
execute_process (COMMAND ${GLIB_COMPILE_SCHEMAS_EXECUTABLE}
\"\${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas\")
endif (WIN32 OR \"\$ENV{DESTDIR}\" STREQUAL \"\")")
install (DIRECTORY share/gui share/library
DESTINATION share/${PROJECT_NAME})
# CPack # CPack
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Schematic editor") set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Schematic editor")
set (CPACK_PACKAGE_VENDOR "Premysl Janouch") set (CPACK_PACKAGE_VENDOR "Premysl Janouch")

View File

@ -52,8 +52,8 @@ Leave out the fakeroot for CMake >= 2.8.9, it's been fixed since.
## Building from sources on Windows ## Building from sources on Windows
First install CMake 2.8 and MinGW. Add both to your system path. If you want to First install CMake >= 3.1 and MinGW. Add both to your system path. If you want
build an installation package, also install NSIS. to build an installation package, also install NSIS.
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 setup all dependencies (contact me if the script becomes obsolete,
@ -85,6 +85,7 @@ By default, that is if you specify no generator, both packages are built.
## Cross-compiling for Windows ## Cross-compiling for Windows
The procedure is almost exactly the same as before, including the requirements.
Just install MinGW-w64 and let automation take care of the rest. Just install MinGW-w64 and let automation take care of the rest.
$ cmake -P Win32Depends.cmake $ cmake -P Win32Depends.cmake
@ -93,5 +94,5 @@ Just install MinGW-w64 and let automation take care of the rest.
$ cmake .. \ $ cmake .. \
-DCMAKE_TOOLCHAIN_FILE=../ToolchainDebianMinGWW64.cmake \ -DCMAKE_TOOLCHAIN_FILE=../ToolchainDebianMinGWW64.cmake \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_TYPE=Release
$ cpack -G ZIP $ cpack

View File

@ -1,5 +1,8 @@
# Usage: cmake -P Win32Depends.cmake # Usage: cmake -P Win32Depends.cmake
# Only CMake 3.1+ supports XZ archives and 7z doesn't also untar automatically
cmake_minimum_required (VERSION 3.1)
# 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)
@ -123,13 +126,13 @@ foreach (pkg_set ${pkg_list})
get_filename_component (filename ${url} NAME) get_filename_component (filename ${url} NAME)
message (STATUS "Extracting ${filename}...") message (STATUS "Extracting ${filename}...")
if (filename MATCHES "7z$") if (filename MATCHES "\\.7z$")
set (extract_command ${sevenzip_executable} x) set (extract_command ${sevenzip_executable} x)
set (quiet OUTPUT_QUIET) set (quiet OUTPUT_QUIET)
else (filename MATCHES "7z$") else (filename MATCHES "\\.7z$")
set (extract_command ${CMAKE_COMMAND} -E tar xf) set (extract_command ${CMAKE_COMMAND} -E tar xf)
set (quiet) set (quiet)
endif (filename MATCHES "7z$") endif (filename MATCHES "\\.7z$")
set (filename ${pkg_dir}/${filename}) set (filename ${pkg_dir}/${filename})
if (pkg_${pkg_set}_strip) if (pkg_${pkg_set}_strip)