win32: Add build rules for the installer to CMakeLists.txt and Makefile.am

Günther Brammer 2011-09-20 19:43:22 +02:00
parent 65f21dbf8a
commit c02354f56c
4 changed files with 69 additions and 45 deletions

View File

@ -1278,6 +1278,41 @@ ENDFOREACH()
# Install binaries # Install binaries
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/clonk ${CMAKE_CURRENT_BINARY_DIR}/c4group DESTINATION bin/) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/clonk ${CMAKE_CURRENT_BINARY_DIR}/c4group DESTINATION bin/)
############################################################################
# setup_openclonk.exe
############################################################################
set(OC_C4GROUPS
Graphics.ocg
Material.ocg
Music.ocg
Sound.ocg
System.ocg
Objects.ocd
BackToTheRocks.ocf
Tests.ocf
Tutorial.ocf
)
get_target_property(run_c4group c4group LOCATION)
foreach(group ${OC_C4GROUPS})
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${group}
COMMAND ${run_c4group} ${CMAKE_CURRENT_SOURCE_DIR}/planet/${group} -t ${CMAKE_CURRENT_BINARY_DIR}/${group}
DEPENDS c4group ${CMAKE_CURRENT_SOURCE_DIR}/planet/${group}
VERBATIM
)
endforeach()
add_custom_command(
OUTPUT setup_openclonk.exe
COMMAND makensis -NOCD -DSRCDIR=${CMAKE_CURRENT_SOURCE_DIR} -DPROGRAMFILES=$PROGRAMFILES ${CMAKE_CURRENT_SOURCE_DIR}/tools/install/oc.nsi "-XOutFile setup_openclonk.exe"
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/install/oc.nsi ${OC_C4GROUPS} clonk c4group
VERBATIM
)
add_custom_target(setup DEPENDS setup_openclonk.exe)
############################################################################ ############################################################################
# CPack support # CPack support
############################################################################ ############################################################################

View File

@ -711,6 +711,9 @@ AM_CXXFLAGS += -DOC_SYSTEM_DATA_DIR=\"${pkgdatadir}\"
%.ocf: planet/%.ocf c4group$(EXEEXT) %.ocf: planet/%.ocf c4group$(EXEEXT)
./c4group$(EXEEXT) $< -t $@ || c4group $< -t $@ ./c4group$(EXEEXT) $< -t $@ || c4group $< -t $@
setup_openclonk.exe: $(srcdir)/tools/install/oc.nsi c4group$(EXEEXT) clonk$(EXEEXT) $(c4groups)
makensis -NOCD -DSRCDIR=$(srcdir) '-DPROGRAMFILES=$$PROGRAMFILES' $< "-XOutFile $@"
## other stuff ## other stuff
EXTRA_DIST = \ EXTRA_DIST = \

View File

@ -3,53 +3,38 @@ Requirements
You can build on Windows using either: You can build on Windows using either:
* vc9 (Microsoft Visual C++ 2008) * vc10 (Microsoft Visual C++ 2010)
you need CMake (http://www.cmake.org/cmake/resources/software.html) to create the "solution" - you need CMake (http://www.cmake.org/cmake/resources/software.html) to
you might have to set the correct DXSDK include and library directories create the "solution"
- you might have to set the correct DXSDK include and library directories
* MinGW and MSYS * MinGW and MSYS
plus DXSDK 9 (if you want DirectX support) - plus DXSDK 9 (if you want DirectX support)
* Some other compilers and IDEs which are supported by CMake might also work * Some other compilers and IDEs which are supported by CMake might also work
Building OpenClonk requires the Boost C++ Libraries (from http://www.boost.org/). It uses the OpenClonk requires some additional libraries. Prebuilt versions of them can be
header-only parts of the library, so you don't have to build any of the binary libraries. found on http://openclonk.org.
Building the installer
======================
The installer is created with NSIS. makensis needs to be in the PATH, and
the dlls used by openclonk in the build directory. To create the installer,
build the "setup" target if using CMake, or if using autotools, run:
make setup_openclonk.exe
Get NSIS from http://nsis.sourceforge.net/.
Notes for MinGW Notes for MinGW
=============== ===============
You need gcc, g++, mingw-runtime, w32api, msys, msyscore, autoconf, automake, You need gcc, g++, mingw-runtime, w32api, msys, msyscore, autoconf, automake,
and any packages needed by these. The versions listed below are known to work, and any packages needed by these.
though newer versions are probably also good.
http://sourceforge.net/project/downloading.php?group_id=200665&filename=tdm-mingw-1.905.0-webdl.exe&a=64029035 Get the library package from openclonk.org and unpack it into the mingw
(from http://sourceforge.net/project/showfiles.php?group_id=200665&package_id=238465) directory.
(see also http://www.tdragon.net/recentgcc/)
- The default options work. Use an installation path without spaces to be on
the save side.
http://sourceforge.net/project/downloading.php?group_id=2435&filename=MSYS-1.0.11-20090120-dll.tar.gz&a=78351117
http://sourceforge.net/project/downloading.php?group_id=2435&filename=msysCORE-1.0.11-20080826.tar.gz&a=60784616
(from http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=24963)
- extract these into the same directory as installed above, merging the
directory contents
- create a shortcut to msys.bat
http://sourceforge.net/project/downloading.php?group_id=2435&filename=perl-5.6.1-MSYS-1.0.11-1.tar.bz2&a=91743036
http://sourceforge.net/project/downloading.php?group_id=2435&filename=crypt-1.1-1-MSYS-1.0.11-1.tar.bz2&a=95002722
http://sourceforge.net/project/downloading.php?group_id=2435&filename=autoconf2.5-2.61-1-bin.tar.bz2&a=93276645
http://sourceforge.net/project/downloading.php?group_id=2435&filename=automake1.10-1.10-1-bin.tar.bz2&a=66135072
http://sourceforge.net/project/downloading.php?group_id=2435&filename=autoconf-4-1-bin.tar.bz2&a=70428585
http://sourceforge.net/project/downloading.php?group_id=2435&filename=automake-3-1-bin.tar.bz2&a=12881354
(from http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=67879)
- you need to extract these from the msys shell with tar (other methods won't
work). This assumes that the archives are in C:\Path\To\Downloads\, adjust
the command as necessary:
cd /
for f in /c/Path/To/Downloads/*.bz2; do tar -xjf $f; done && echo done
Get the library package from openclonk.org and unpack it into the same
directory as the other archives.
If you want DirectX support, get a DirectX 9 SDK from Microsoft. Copy the If you want DirectX support, get a DirectX 9 SDK from Microsoft. Copy the
contents of its include dir to the include dir of your MinGW installation, contents of its include dir to the include dir of your MinGW installation,

View File

@ -16,12 +16,12 @@ SetCompressor lzma
!include "MUI.nsh" !include "MUI.nsh"
; MUI Settings ; MUI Settings
!define MUI_ICON "inst.ico" !define MUI_ICON "${SRCDIR}/tools/install/inst.ico"
!define MUI_UNICON "uninst.ico" !define MUI_UNICON "${SRCDIR}/tools/install/uninst.ico"
!define MUI_HEADERIMAGE !define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_RIGHT !define MUI_HEADERIMAGE_RIGHT
!define MUI_HEADERIMAGE_BITMAP "header.bmp" !define MUI_HEADERIMAGE_BITMAP "${SRCDIR}/tools/install/header.bmp"
; Directory page ; Directory page
!insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_DIRECTORY
@ -50,8 +50,7 @@ LangString MUI_TEXT_USERPATH ${LANG_English} "User Path"
; MUI end ------ ; MUI end ------
Name "${PRODUCT_NAME}" Name "${PRODUCT_NAME}"
OutFile "..\oc.exe" InstallDir "${PROGRAMFILES}\OpenClonk"
InstallDir "@PROGRAMFILES@\OpenClonk"
ShowInstDetails show ShowInstDetails show
ShowUnInstDetails show ShowUnInstDetails show
@ -67,10 +66,11 @@ Section "MainSection" SEC01
File "*.oc?" File "*.oc?"
File "AUTHORS" File "${SRCDIR}\planet\AUTHORS"
File "COPYING" File "${SRCDIR}\planet\COPYING"
File "LGPL.txt" File "${SRCDIR}\licenses\LGPL.txt"
File "OpenSSL.txt" File "${SRCDIR}\licenses\OpenSSL.txt"
File "${SRCDIR}\Credits.txt"
; Create user path (works for the installing user only... might also want to put an info.txt dummy in there...) ; Create user path (works for the installing user only... might also want to put an info.txt dummy in there...)
CreateDirectory "$APPDATA\OpenClonk" CreateDirectory "$APPDATA\OpenClonk"
@ -179,6 +179,7 @@ Section Uninstall
Delete "$INSTDIR\COPYING" Delete "$INSTDIR\COPYING"
Delete "$INSTDIR\LGPL.txt" Delete "$INSTDIR\LGPL.txt"
Delete "$INSTDIR\OpenSSL.txt" Delete "$INSTDIR\OpenSSL.txt"
Delete "$INSTDIR\Credits.txt"
Delete "$INSTDIR\uninst.exe" Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\${PRODUCT_WEB_SITE_NAME}.url" Delete "$INSTDIR\${PRODUCT_WEB_SITE_NAME}.url"