diff --git a/common.pro b/common.pro index 6a0d7c7117..4c2e9db962 100644 --- a/common.pro +++ b/common.pro @@ -1,11 +1,49 @@ -# Common project definitions for LibreCAD. This file gets -# included from the various *.pro files. +# Store intermedia stuff somewhere else +OBJECTS_DIR = generated/obj +MOC_DIR = generated/moc +RCC_DIR = generated/rcc +TS_DIR = generated/ts +UI_DIR = generated/ui +UI_HEADERS_DIR = generated/ui +UI_SOURCES_DIR = generated/ui +# Copy command +win32 { + COPY = copy /y +} else { + COPY = cp +} + +# Compiler settings +unix { + macx { + CONFIG += x86 x86_64 + SUBDIRS += attf2lff + } + else { + SUBDIRS += attf2lff + } +} + +# Installation location +win32 { + INSTALLDIR = windows +} +unix { + macx { + INSTALLDIR = LibreCAD.app/Contents + } + else { + INSTALLDIR = unix + } +} + + +# Boost win32 { - boost { # Use Boost on Windows. # Specify where boost is installed (this should have the boost @@ -31,12 +69,10 @@ win32 { # 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). - DEFINES += HAS_BOOST 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 # features and a hint to povide M_PI et al. @@ -54,7 +90,10 @@ win32 { } macx { - boost { + !exists( /opt/local/lib/libboost* ) { + error(Boost was not found, please install boost!) + } + # Use Boost on OSX # Install boost with : sudo port install boost @@ -75,10 +114,10 @@ macx { # 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). - DEFINES += HAS_BOOST INCLUDEPATH += $${BOOST_DIR} + # HEADERS += $${BOOST_DIR} LIBS += -L/opt/local/lib $${BOOST_LIBS} - !build_pass:verbose:message(Using boost libraries in $${BOOST_DIR}.) - } + # !build_pass:verbose:message(Using boost libraries in $${BOOST_DIR}.) + message(Using boost libraries in $${BOOST_DIR}.) } diff --git a/libraries/dxflib/dxflib.pro b/libraries/dxflib/dxflib.pro index e5a707b430..cc40d5414e 100644 --- a/libraries/dxflib/dxflib.pro +++ b/libraries/dxflib/dxflib.pro @@ -7,9 +7,9 @@ QT -= core gui TEMPLATE = lib -#CONFIG += dll \ -CONFIG += static \ - warn_on +CONFIG += static warn_on + +DESTDIR = ../../generated/lib VERSION = 2.2.0.0 @@ -17,18 +17,9 @@ DLL_NAME = dxflib TARGET = $$DLL_NAME # Use common project definitions. -include(../common.pro) - -# DEFINES += - -win32 { - COPY = copy /y -} else { - COPY = cp -} -macx { - CONFIG += x86 x86_64 -} +include(../../settings.pro) +include(../../common.pro) + SOURCES += \ src/dl_dxf.cpp \ src/dl_writer_ascii.cpp @@ -46,14 +37,3 @@ HEADERS += \ src/dl_writer_ascii.h -DESTDIR = ../intermediate - -# 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 - diff --git a/libraries/fparser/fparser.pro b/libraries/fparser/fparser.pro index cccc8b36ee..d9643e3dce 100644 --- a/libraries/fparser/fparser.pro +++ b/libraries/fparser/fparser.pro @@ -7,43 +7,22 @@ QT -= core gui TEMPLATE = lib -#CONFIG += dll \ -CONFIG += static \ - warn_on +CONFIG += static warn_on -VERSION = 4.3 +DESTDIR = ../../generated/lib -# Use common project definitions. -include(../common.pro) +VERSION = 4.3 DLL_NAME = fparser TARGET = $$DLL_NAME -# DEFINES += +# Use common project definitions. +include(../../settings.pro) +include(../../common.pro) -win32 { - COPY = copy /y -} else { - COPY = cp -} -macx { - CONFIG += x86 x86_64 -} SOURCES += \ fparser.cc HEADERS += \ fparser.hh - -DESTDIR = ../intermediate - -# 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 - diff --git a/libraries/jwwlib/jwwlib.pro b/libraries/jwwlib/jwwlib.pro index 1892a6abc9..83707943a1 100644 --- a/libraries/jwwlib/jwwlib.pro +++ b/libraries/jwwlib/jwwlib.pro @@ -7,28 +7,19 @@ QT -= core gui TEMPLATE = lib -#CONFIG += dll \ -CONFIG += static \ - warn_on +CONFIG += static warn_on -VERSION = 0.0.1 +DESTDIR = ../../generated/lib -# Use common project definitions. -include(../common.pro) +VERSION = 0.0.1 DLL_NAME = jwwlib TARGET = $$DLL_NAME -# DEFINES += +# Use common project definitions. +include(../../settings.pro) +include(../../common.pro) -win32 { - COPY = copy /y -} else { - COPY = cp -} -macx { - CONFIG += x86 x86_64 -} INCLUDEPATH += \ ../dxflib/src @@ -42,14 +33,3 @@ HEADERS += \ ../jwwlib/src/jwwdoc.h -DESTDIR = ../intermediate - -# 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 - diff --git a/libraries/libdxfrw/libdxfrw.pro b/libraries/libdxfrw/libdxfrw.pro index 6550cf68cb..b86ea52bb2 100644 --- a/libraries/libdxfrw/libdxfrw.pro +++ b/libraries/libdxfrw/libdxfrw.pro @@ -7,29 +7,20 @@ QT -= core gui TEMPLATE = lib -#CONFIG += dll \ -CONFIG += static \ - warn_on +CONFIG += static warn_on -VERSION = 0.0.1 +DESTDIR = ../../generated/lib -# Use common project definitions. -include(../common.pro) +VERSION = 0.0.1 DLL_NAME = dxfrw TARGET = $$DLL_NAME -DEFINES += DRW_DBG - -win32 { - COPY = copy /y -} else { - COPY = cp -} +# Use common project definitions. +include(../../settings.pro) +include(../../common.pro) -macx { - CONFIG += x86 x86_64 -} +DEFINES += DRW_DBG SOURCES += \ src/libdxfrw.cpp \ @@ -47,14 +38,3 @@ HEADERS += \ src/dxfwriter.h \ src/drw_interface.h -DESTDIR = ../intermediate - -# 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 - diff --git a/libraries/libraries.pro b/libraries/libraries.pro new file mode 100644 index 0000000000..8789e1ea56 --- /dev/null +++ b/libraries/libraries.pro @@ -0,0 +1,17 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2011-03-22T19:33:11 +# +#------------------------------------------------- + +TEMPLATE = subdirs + +TARGET = libraries + +SUBDIRS = \ + libdxfrw \ + dxflib \ + jwwlib \ + fparser + + diff --git a/librecad.pro b/librecad.pro index f754f86fa3..269242f05f 100644 --- a/librecad.pro +++ b/librecad.pro @@ -8,39 +8,10 @@ TEMPLATE = subdirs TARGET = librecad CONFIG += ordered -#QT += gui SUBDIRS = \ - libdxfrw \ - dxflib \ - jwwlib \ - fparser \ - src \ - plugins - -unix { - macx { - CONFIG += x86 x86_64 - } - else { - SUBDIRS += attf2lff - } -} - -TRANSLATIONS = - -# install -win32 { - INSTALLDIR = release -} -unix { - macx { - INSTALLDIR = LibreCAD.app/Contents - } - else { -# INSTALLDIR = unix - } -} - + libraries \ + librecad +# plugins exists( custom.pro ):include( custom.pro ) diff --git a/librecad/librecad.pro b/librecad/librecad.pro new file mode 100644 index 0000000000..dd31906ae9 --- /dev/null +++ b/librecad/librecad.pro @@ -0,0 +1,11 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2011-03-22T19:33:11 +# +#------------------------------------------------- + +TEMPLATE = subdirs + +TARGET = librecad + +SUBDIRS = src diff --git a/librecad/src/src.pro b/librecad/src/src.pro index 086afc3a6f..bcc239e504 100755 --- a/librecad/src/src.pro +++ b/librecad/src/src.pro @@ -6,122 +6,92 @@ DEFINES += QC_APPKEY="\"/LibreCAD\"" DEFINES += QC_APPNAME="\"LibreCAD\"" DEFINES += QC_COMPANYNAME="\"LibreCAD\"" DEFINES += QC_COMPANYKEY="\"LibreCAD\"" -DEFINES += QC_VERSION="\"master\"" +DEFINES += QC_VERSION="\"master\""4 DEFINES += QC_DELAYED_SPLASH_SCREEN=1 -#uncomment to use 2D rs_vector instead of 3D -#DEFINES += RS_VECTOR2D=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 -# C++11 is the default now for versions > 2.0.0alpha2 -# HAS_CPP11 = -#HAS_CPP11 += 1 -#count(HAS_CPP11, 1) { + +# Use common project definitions. +include(../../settings.pro) +include(../../common.pro) + +HAS_CPP11 = +count(HAS_CPP11, 1) { DEFINES += HAS_CPP11=1 QMAKE_CXXFLAGS_DEBUG += -std=c++0x QMAKE_CXXFLAGS += -std=c++0x -#} +} +#uncomment to use 2D rs_vector instead of 3D +#DEFINES += RS_VECTOR2D=1 CONFIG += qt \ warn_on \ link_prl \ help verbose -PRE_TARGETDEPS += ../intermediate/libdxfrw.a -PRE_TARGETDEPS += ../intermediate/libdxflib.a -PRE_TARGETDEPS += ../intermediate/libjwwlib.a -PRE_TARGETDEPS += ../intermediate/libfparser.a +PRE_TARGETDEPS += ../../generated/lib/libdxfrw.a +PRE_TARGETDEPS += ../../generated/lib/libdxflib.a +PRE_TARGETDEPS += ../../generated/lib/libjwwlib.a +PRE_TARGETDEPS += ../../generated/lib/libfparser.a # Make translations at the end of the process unix { - # Get SVN revision number - # SVNREVISION = $$system(svn info -R | grep -o \"Revision: [0-9]*\" | sed -e \"s/Revision: //\" | head -n1) - # Temporary disabled getting SCM version - #SCMREVISION=$$system(git describe --tags) SCMREVISION=$$system([ "$(which git)x" != "x" -a -d ../.git ] && echo "$(git describe --tags)" || echo "2.0.0alpha2") DEFINES += QC_SCMREVISION=\"$$SCMREVISION\" macx { - # test of boost exists - !exists( /opt/local/lib/libboost* ) { - error(Boost was not found, please install boost!) - } - DEFINES += HAS_BOOST=1 - CONFIG += boost CONFIG += x86 x86_64 TARGET = LibreCAD DEFINES += QC_APPDIR="\"LibreCAD\"" DEFINES += QINITIMAGES_LIBRECAD="qInitImages_LibreCAD" RC_FILE = ../res/main/librecad.icns - DESTDIR = .. - + DESTDIR = ../../ QMAKE_POST_LINK = cd .. && scripts/postprocess-osx.sh } else { TARGET = librecad #fixme , need to detect whether boost is there - DEFINES += HAS_BOOST=1 DEFINES += QC_APPDIR="\"librecad\"" DEFINES += QINITIMAGES_LIBRECAD="qInitImages_librecad" RC_FILE = ../res/main/librecad.icns - DESTDIR = ../unix - -#fixme , boost, how to handle boost properly for win32 and unix -# tin-pot 2012-01-06: See the boost stuff below and in `../common.pro` :-) -# CONFIG += link_pkgconfig -# PKGCONFIG += boost -# + DESTDIR = ../../unix QMAKE_POST_LINK = cd .. && scripts/postprocess-unix.sh } } win32 { QMAKE_CXXFLAGS += -U__STRICT_ANSI__ - CONFIG += boost - DEFINES += HAS_BOOST=1 - # TODO tin-pot 2012-01-06: I think this should be `QMAKE_CXXFLAGS_THREAD`? QMAKE_CFLAGS_THREAD -= -mthreads QMAKE_LFLAGS_THREAD -= -mthreads QMAKE_C++FLAGS_THREAD -= -mthreads QMAKE_L++FLAGS_THREAD -= -mthreads + TARGET = LibreCAD DEFINES += QC_APPDIR="\"LibreCAD\"" DEFINES += QINITIMAGES_LIBRECAD="qInitImages_LibreCAD" - RC_FILE = ..\\res\\main\\librecad.rc - DESTDIR = ..\\windows - QMAKE_POST_LINK = ..\\scripts\\postprocess-win.bat + RC_FILE = ../res/main/librecad.rc + DESTDIR = ../../windows + QMAKE_POST_LINK = ../scripts/postprocess-win.bat } -# Use common project definitions. -include(../common.pro) + # Additional libraries to load -# LIBS += \ -# -Ldxflib/lib -ldxf \ -# Store intermedia stuff somewhere else -#LIBS += -lboost -LIBS += \ - -L../intermediate -ldxfrw -ldxflib -ljwwlib -lfparser - - -OBJECTS_DIR = ../intermediate/obj -MOC_DIR = ../intermediate/moc -RCC_DIR = ../intermediate/rcc -TS_DIR = ../intermediate/ts -UI_DIR = ../intermediate/ui -UI_HEADERS_DIR = ../intermediate/ui -UI_SOURCES_DIR = ../intermediate/ui -RESOURCES += ../res/extui/extui.qrc +LIBS += -L../generated -ldxfrw -ldxflib -ljwwlib -lfparser DEPENDPATH += \ - ../dxflib/src \ - ../libdxfrw/src \ - ../jwwlib/src \ - ../fparser \ + ../../libraries/dxflib/src \ + ../../libraries/libdxfrw/src \ + ../../libraries/jwwlib/src \ + ../../libraries/fparser \ cmd \ lib/actions \ lib/creation \ @@ -142,7 +112,8 @@ DEPENDPATH += \ res #depends check, bug#3411161 -INCLUDEPATH = $$DEPENDPATH +INCLUDEPATH += $$DEPENDPATH + # ################################################################################ # Library HEADERS += \ @@ -951,6 +922,3 @@ TRANSLATIONS = ../ts/librecad_cs.ts \ ../ts/librecad_zh_cn.ts \ ../ts/librecad_zh_tw.ts -# Include any custom.pro files for personal/special builds -exists( custom.pro ):include( custom.pro ) - diff --git a/settings.pro b/settings.pro new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tools/tools.pro b/tools/tools.pro new file mode 100644 index 0000000000..e69de29bb2