From 13393a3a2c30abac42c97fd37afdbdcd9a3a111e Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 13 Jul 2013 14:51:04 +0000 Subject: Adds a windows EXE icon. --- configure.ac | 48 +++++++++++++++++++++++++++--------------------- src/Makefile.am | 23 ++++++++++++++++++----- src/icon.rc | 2 ++ 3 files changed, 47 insertions(+), 26 deletions(-) create mode 100644 src/icon.rc diff --git a/configure.ac b/configure.ac index 6a19a31..999f166 100644 --- a/configure.ac +++ b/configure.ac @@ -6,11 +6,12 @@ dnl AC_INIT([Sudoku Solver], [0.1.0], [ingar@osirion.org], [sudokusolver]) +AC_LANG_CPLUSPLUS +AC_PROG_CC +AC_PROG_CXX AC_CONFIG_HEADERS(src/config.h) AM_INIT_AUTOMAKE -AC_PROG_CC -AC_PROG_CXX dnl dnl Qt installation prefix @@ -18,7 +19,7 @@ dnl AC_MSG_CHECKING(Qt installation prefix) QTDIR=xxx AC_ARG_WITH([qt-prefix], - AC_HELP_STRING([--with-qt-prefix=], [to specify the path to the Qt-4.8.0 installation prefix.]), + AC_HELP_STRING([--with-qt-prefix=], [to specify the path to the Qt 4.8 installation prefix.]), [QTPATHS="$withval"], [QTPATHS="/usr /usr/qt4 /opt/qt4"]) @@ -28,7 +29,7 @@ for x in $QTPATHS; do fi done if test $QTDIR = xxx ; then - AC_MSG_ERROR(Could not locate QT 4.1) + AC_MSG_ERROR(Could not locate Qt 4.8) fi AC_MSG_RESULT($QTDIR) @@ -38,7 +39,7 @@ dnl AC_MSG_CHECKING(Qt includes directory) AC_ARG_WITH([qt-includes], - AC_HELP_STRING([--with-qt-includes=], [to specify the path to directory containing the the Qt-4.8.0 includes.]), + AC_HELP_STRING([--with-qt-includes=], [to specify the path to directory containing the Qt 4.8 includes.]), [QTINCLUDEDIR="$withval"], [QTINCLUDEDIR="$QTDIR/include"]) AC_MSG_RESULT($QTINCLUDEDIR) @@ -48,28 +49,33 @@ dnl libraries directory dnl AC_MSG_CHECKING(Qt libraries directory) AC_ARG_WITH([qt-libraries], - AC_HELP_STRING([--with-qt-libraries=], [to specify the path to directory containing the the Qt-4.8.0 libraries.]), + AC_HELP_STRING([--with-qt-libraries=], [to specify the path to directory containing the Qt 4.8 libraries.]), [QTLIBDIR="$withval"], [QTLIBDIR="$QTDIR/lib"]) AC_MSG_RESULT($QTLIBDIR) -host=`uname -a` # AC_CANONICAL_HOST is broken at the time of this writing. -case $host in - MINGW32*) - AC_MSG_NOTICE(win32) - QTLIBS="-L$QTLIBDIR -lgdi32 -luser32 -lmingw32 -lqtmain -lQtGui4 -lQtCore4 -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -Wl,-s -Wl,-subsystem,windows" - QTINC="-I$QTINCLUDEDIR -I$QTINCLUDEDIR/QtCore -I$QTINCLUDEDIR/QtGui -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -frtti -fexceptions" - QTBIN="$QTDIR/bin" - ;; - *) - AC_MSG_NOTICE(generic UNIX) - AC_PATH_XTRA - QTINC="-I$QTINCLUDEDIR -I$QTINCLUDEDIR/QtGui -I$QTINCLUDEDIR/QtCore $X_CFLAGS -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED" - QTLIBS="-Wl,-rpath,QTLIBDIR -L$QTLIBDIR -lQtGui -lQtCore -lpthread" - QTBIN="$QTDIR/bin" - ;; +AC_MSG_CHECKING([host type]) +host=`uname -a` +case "$host" in + MINGW32*) + AC_MSG_RESULT(win32) + QTLIBS="-L$QTLIBDIR -lgdi32 -luser32 -lmingw32 -lqtmain -lQtGui4 -lQtCore4 -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -Wl,-s -Wl,-subsystem,windows" + QTINC="-I$QTINCLUDEDIR -I$QTINCLUDEDIR/QtCore -I$QTINCLUDEDIR/QtGui -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -frtti -fexceptions" + QTBIN="$QTDIR/bin" + EXEICON="icon.o" + ;; + *) + AC_MSG_RESULT(generic unix) + AC_PATH_XTRA + QTINC="-I$QTINCLUDEDIR -I$QTINCLUDEDIR/QtGui -I$QTINCLUDEDIR/QtCore $X_CFLAGS -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED" + QTLIBS="-Wl,-rpath,QTLIBDIR -L$QTLIBDIR -lQtGui -lQtCore -lpthread" + QTBIN="$QTDIR/bin" + EXEICON="" + ;; esac +AC_SUBST(EXEICON) + LIBS="$LIBS $QTLIBS" INCLUDES="$INCLUDES $QTINC" PATH="$PATH:$QTBIN" diff --git a/src/Makefile.am b/src/Makefile.am index f5a5841..5c329b4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,12 @@ +SUFFIXES=rc +# This rule lets GNU make create any moc_*.cpp from the equivalent *.h +moc_%.cc: %.h + moc $< -o $@ + +# This rule lets GNU make compile *.rc windows resource files +.rc.o: + windres $< -o $@ + bin_PROGRAMS = sudokusolver # Project C++ source files @@ -8,14 +17,18 @@ sudokusolver_SOURCES = \ solverwindow.cc \ sudoku.cc \ sudokuwidget.cc + +EXTRA_sudokusolver_SOURCES = \ + icon.rc + +sudokusolver_DEPENDENCIES = \ + $(EXEICON) +sudokusolver_LDADD =\ + $(EXEICON) + # moc generated C++ source files nodist_sudokusolver_SOURCES = \ moc_mainwindow.cc \ moc_solverwindow.cc \ moc_sudokuwidget.cc - -# This rule lets GNU make create any moc_*.cpp from the equivalent *.h -moc_%.cc: %.h - moc $< -o $@ - diff --git a/src/icon.rc b/src/icon.rc new file mode 100644 index 0000000..fb7c0e1 --- /dev/null +++ b/src/icon.rc @@ -0,0 +1,2 @@ +101 ICON icon.ico + -- cgit v1.2.3