Skip to content

Commit

Permalink
Build file updates for Windows, tested and works!
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Feb 16, 2012
1 parent 5898e0c commit d9e5aba
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 128 deletions.
97 changes: 9 additions & 88 deletions common.pro
Original file line number Diff line number Diff line change
Expand Up @@ -16,65 +16,19 @@ win32 {
COPY = cp
}

# Compiler settings
unix {
macx {
CONFIG += x86 x86_64
SUBDIRS += attf2lff
}
else {
SUBDIRS += attf2lff
}
}
# Boost
INCLUDEPATH += "$${BOOST_DIR}"
LIBS += -L"$${BOOST_LIBDIR}" $${BOOST_LIBS}
HEADERS += "$${BOOST_DIR}"

# Installation location
win32 {
INSTALLDIR = windows
!exists($${BOOST_DIR}) {
# error(Boost was not found, please install boost!)
}
unix {
macx {
INSTALLDIR = LibreCAD.app/Contents
}
else {
INSTALLDIR = unix
}
}

!build_pass:verbose:message(Using boost libraries in $${BOOST_DIR}.)

# Boost
# Windows compiler settings
win32 {

# Use Boost on Windows.

# Specify where boost is installed (this should have the boost
# headers in ./boost/ and libraries in ./lib/).
#
# See
# http://www.boostpro.com/download/
# and
# http://www.boost.org/doc/libs/1_47_0/more/getting_started/windows.html
# on getting and using a boost library prebuild for MSVC.
BOOST_DIR = $$(ProgramFiles)/boost/boost_1_48_0

# BOOST_LIBS may specifiy boost import libraries (this are the libraries
# without the `lib` prefix, which have a corresponding `.dll` file!).
# They are only needed when dynamically linking against boost, otherwise
# leave it empty and the autolink process will take care of linking to
# the correct (static) boost library. (Most of the boost components are
# header-only anyway.)
#
# For example: `BOOST_LIBS = -lboost_regex-vc71-mt-1_47.lib`
BOOST_LIBS =

# Make boost known to compiler and linker.
# This should also work on other platforms (but BOOST_LIBS may need
# to be set to the required boost *.sl/*.so/*.dylib/*.a).
INCLUDEPATH += "$${BOOST_DIR}"
LIBS += -L"$${BOOST_DIR}/lib" $${BOOST_LIBS}
HEADERS += "$${BOOST_DIR}"
!build_pass:verbose:message(Using boost libraries in $${BOOST_DIR}.)

# On windows, check for MSVC compilers - they need help on C99
# On windows, check for MSVC compilers - they need help on C99
# features and a hint to povide M_PI et al.
win32-msvc.net|win32-msvc2003|win32-msvc2005|win32-msvc2008|win32-msvc2010 {
!build_pass:verbose:message(Setting up support for MSVC.)
Expand All @@ -88,36 +42,3 @@ win32 {
QMAKE_CXXFLAGS += /wd4100
}
}

macx {
!exists( /opt/local/lib/libboost* ) {
error(Boost was not found, please install boost!)
}

# Use Boost on OSX
# Install boost with : sudo port install boost

# Specify where boost is installed (this should have the boost
# headers in ./boost/ and libraries in ./lib/).
BOOST_DIR = /opt/local/include/

# BOOST_LIBS may specifiy boost import libraries (this are the libraries
# without the `lib` prefix, which have a corresponding `.dll` file!).
# They are only needed when dynamically linking against boost, otherwise
# leave it empty and the autolink process will take care of linking to
# the correct (static) boost library. (Most of the boost components are
# header-only anyway.)
#
# For example: `BOOST_LIBS = -lboost_regex-vc71-mt-1_47.lib`
BOOST_LIBS =

# Make boost known to compiler and linker.
# This should also work on other platforms (but BOOST_LIBS may need
# to be set to the required boost *.sl/*.so/*.dylib/*.a).
INCLUDEPATH += $${BOOST_DIR}
# HEADERS += $${BOOST_DIR}
LIBS += -L/opt/local/lib $${BOOST_LIBS}
# !build_pass:verbose:message(Using boost libraries in $${BOOST_DIR}.)
message(Using boost libraries in $${BOOST_DIR}.)
}

9 changes: 1 addition & 8 deletions librecad.pro
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
#-------------------------------------------------
#
# Project created by QtCreator 2011-03-22T19:33:11
#
#-------------------------------------------------

TEMPLATE = subdirs
TARGET = librecad

CONFIG += ordered

SUBDIRS = \
libraries \
librecad
# plugins
# plugins

exists( custom.pro ):include( custom.pro )
21 changes: 11 additions & 10 deletions librecad/src/src.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@ DEFINES += QC_COMPANYKEY="\"LibreCAD\""
DEFINES += QC_VERSION="\"master\""4
DEFINES += QC_DELAYED_SPLASH_SCREEN=1
DEFINES += HAS_BOOST=1
DEFINES += HAS_CPP11=1

DEFINES += USE_DXFRW=1

# uncomment USEQTDIALOG=1 to use QFileDialog instead "native" FileDialog
# KDE returns the first filter that match the pattern "*.dxf" instead the selected
# DEFINES += USEQTDIALOG=1

DEFINES += USE_DXFRW=1



# Use common project definitions.
include(../../settings.pro)
include(../../common.pro)

HAS_CPP11 = 1
count(HAS_CPP11, 1) {
DEFINES += HAS_CPP11=1
QMAKE_CXXFLAGS_DEBUG += -std=c++0x
Expand All @@ -42,6 +41,8 @@ PRE_TARGETDEPS += ../../generated/lib/libdxflib.a
PRE_TARGETDEPS += ../../generated/lib/libjwwlib.a
PRE_TARGETDEPS += ../../generated/lib/libfparser.a

DESTDIR = $${INSTALLDIR}

# Make translations at the end of the process
unix {
SCMREVISION=$$system([ "$(which git)x" != "x" -a -d ../.git ] && echo "$(git describe --tags)" || echo "2.0.0alpha2")
Expand All @@ -53,16 +54,13 @@ unix {
DEFINES += QC_APPDIR="\"LibreCAD\""
DEFINES += QINITIMAGES_LIBRECAD="qInitImages_LibreCAD"
RC_FILE = ../res/main/librecad.icns
DESTDIR = ../../
QMAKE_POST_LINK = cd .. && scripts/postprocess-osx.sh
}
else {
TARGET = librecad
#fixme , need to detect whether boost is there
DEFINES += QC_APPDIR="\"librecad\""
DEFINES += QINITIMAGES_LIBRECAD="qInitImages_librecad"
RC_FILE = ../res/main/librecad.icns
DESTDIR = ../../unix
QMAKE_POST_LINK = cd .. && scripts/postprocess-unix.sh
}
}
Expand All @@ -78,14 +76,17 @@ win32 {
DEFINES += QINITIMAGES_LIBRECAD="qInitImages_LibreCAD"

RC_FILE = ../res/main/librecad.rc
DESTDIR = ../../windows
QMAKE_POST_LINK = ../scripts/postprocess-win.bat
QMAKE_POST_LINK = ..\\..\\scripts\\postprocess-win.bat
}



# Additional libraries to load
LIBS += -L../../generated/lib -ldxfrw -ldxflib -ljwwlib -lfparser
LIBS += -L../../generated/lib \
-ldxflib \
-ldxfrw \
-ljwwlib \
-lfparser

DEPENDPATH += \
../../libraries/dxflib/src \
Expand Down
8 changes: 0 additions & 8 deletions plugins/plugins.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ SUBDIRS = \

TRANSLATIONS =

# Store intermedia stuff somewhere else
OBJECTS_DIR = intermediate/obj
MOC_DIR = intermediate/moc
RCC_DIR = intermediate/rcc
TS_DIR = intermediate/ts
UI_DIR = intermediate/ui
UI_HERADERS_DIR = intermediate/ui
UI_SOURCES_DIR = intermediate/ui

# install
INSTALLDIR = ../unix/resources/plugins
Expand Down
2 changes: 0 additions & 2 deletions scripts/postprocess-osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ cp support/patterns/*.dxf $RESOURCEDIR/Resources/patterns
cp support/fonts/*.lff $RESOURCEDIR/Resources/fonts
cp support/doc/*.qhc $RESOURCEDIR/Resources/doc
cp support/doc/*.qch $RESOURCEDIR/Resources/doc
find support/library -type d -not -path "*.svn*" | sed s/support// | xargs -IFILES mkdir $RESOURCEDIR/Resources/FILES
find support/library -type f -iname *.dxf -not -path "*.svn*" | sed s/support// | xargs -IFILES cp support/FILES $RESOURCEDIR/Resources/FILES

cp -r /Developer/Applications/Qt/plugins/sqldrivers $RESOURCEDIR/PlugIns/sqldrivers

Expand Down
28 changes: 16 additions & 12 deletions scripts/postprocess-win.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
cd > PWD
set /p PWD= < PWD

set RESOURCEDIR=%PWD%\release\resources
set TSDIR=%PWD%\ts
set DOCDIR=%PWD%\support\doc

set PWD=%PWD%\..\..


set RESOURCEDIR=%PWD%\windows\resources
set TSDIR=%PWD%\librecad\ts
set DOCDIR=%PWD%\librecad\support\doc

REM Generate Help Files
cd "%DOCDIR%"
Expand All @@ -21,23 +25,23 @@ mkdir "%RESOURCEDIR%\library"
mkdir "%RESOURCEDIR%\doc"
mkdir "%RESOURCEDIR%\library\misc"
mkdir "%RESOURCEDIR%\library\templates"
copy "support\patterns\*.dxf" "%RESOURCEDIR%\patterns"
copy "support\fonts\*.cxf" "%RESOURCEDIR%\fonts"
copy "support\fonts\*.lff" "%RESOURCEDIR%\fonts"
copy "support\doc\*.qhc" "%RESOURCEDIR%\doc"
copy "support\doc\*.qch" "%RESOURCEDIR%\doc"
copy "support\library\misc\*.dxf" "%RESOURCEDIR%\library\misc"
copy "support\library\templates\*.dxf" "%RESOURCEDIR%\library\templates"

copy "librecad\support\patterns\*.dxf" "%RESOURCEDIR%\patterns"
copy "librecad\support\fonts\*.lff" "%RESOURCEDIR%\fonts"
copy "librecad\support\doc\*.qhc" "%RESOURCEDIR%\doc"
copy "librecad\support\doc\*.qch" "%RESOURCEDIR%\doc"
copy "librecad\support\library\misc\*.dxf" "%RESOURCEDIR%\library\misc"
copy "librecad\support\library\templates\*.dxf" "%RESOURCEDIR%\library\templates"


REM Generate translations
echo "Generating Translations"
lrelease src\src.pro
lrelease librecad\src\src.pro
mkdir "%RESOURCEDIR%\qm"

cd "%TSDIR%"
for /f %%F in ('dir /b *.qm') do (
copy "%%F" "%RESOURCEDIR%\qm\%%F"
)

cd "%PWD%"
cd "%PWD%"
10 changes: 10 additions & 0 deletions settings.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
win32 {
include(settings_windows.pro)
}
unix {
macx {
include(settings_macx.pro)
} else {
include(settings_linux.pro)
}
}
7 changes: 7 additions & 0 deletions settings_linux.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@


HAS_CPP11 = 1
SUBDIRS += attf2lff

INSTALLDIR = ../../unix

11 changes: 11 additions & 0 deletions settings_osx.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
HAS_CPP11 = 0

BOOST_DIR = /opt/local/include
BOOST_LIBDIR = /opt/local/lib
BOOST_LIB =

INSTALLDIR = ../../LibreCAD.app/Contents

SUBDIRS += attf2lff
CONFIG += x86 x86_64

7 changes: 7 additions & 0 deletions settings_windows.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
HAS_CPP11 = 0

BOOST_DIR = $$(ProgramFiles)/boost/boost_1_48_0
BOOST_LIBDIR = $$(ProgramFiles)/boost/boost_1_48_0/
BOOST_LIB =

INSTALLDIR = ../../windows

0 comments on commit d9e5aba

Please sign in to comment.