Skip to content

Commit

Permalink
Refactoring windows 0.8.0 cf email for modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
PatxiBERARD committed Feb 15, 2018
1 parent d4e65bc commit 227dbb5
Show file tree
Hide file tree
Showing 216 changed files with 116 additions and 701 deletions.
59 changes: 19 additions & 40 deletions builds/mastic-dev.pri
Original file line number Diff line number Diff line change
Expand Up @@ -19,53 +19,31 @@ win32:{

QMAKE_CXXFLAGS += -std=c11

# INCLUDEPATH += $$PWD/getopt \

# HEADERS += $$PWD/getopt/getopt_win32.h
# SOURCES += $$PWD/getopt/getopt_win32.c

CONFIG(debug, debug|release){
#configuration DEBUG
DESTDIR = $$OUT_PWD/debug
libzyre_path = $$PWD/zyre/bin/Win32/Debug/v140/dynamic
libyajl_path = $$PWD/yajl/lloyd-yajl-2.1.0/MSVS/VS2013/x86/DebugDLL
install_libs.path += "C:/mastic/lib/debug"
libs_path = $$PWD/../dependencies/windows/libs/win32/Debug
}else {
#configuration RELEASE
DESTDIR = $$OUT_PWD/release
libzyre_path = $$PWD/zyre/bin/Win32/Release/v140/dynamic
libyajl_path = $$PWD/yajl/lloyd-yajl-2.1.0/MSVS/VS2013/x86/ReleaseDLL
install_libs.path += "C:/mastic/lib/release"
libs_path = $$PWD/../dependencies/windows/libs/win32/Release
}

#Copy includes
# install_headers.files += $$PWD/../src/include/*.h \
# $$PWD/../src/include/uthash \
# $$PWD/getopt
install_headers.path += "C:/mastic/include"
install_headers.files += $$PWD/../src/include/mastic.h \

#UNIX functions
SOURCES += $$PWD/../dependencies/windows/unix/unixfunctions.c \

#Add the make step 'install' to copy the dll files to the output folder
install_libs.files += $$libzyre_path/* \
$$libyajl_path/* \
$$DESTDIR/*
HEADERS += $$PWD/../dependencies/windows/unix/unixfunctions.h \


#Add installation options
INSTALLS += install_libs \
install_headers
INCLUDEPATH += $$PWD/../dependencies/windows/unix \

#Add librairies
LIBS += -L$$libzyre_path -llibzmq \
-L$$libzyre_path -llibczmq \
-L$$libzyre_path -llibzyre \
-L$$libyajl_path -lyajl
LIBS += -L$$libs_path -llibzyre -llibczmq -lyajl

#to get the Ip address into the network.c
LIBS += -L$$C:/Windows/System32 -lwsock32
LIBS += -L$$C:/Windows/System32 -lIPHLPAPI
LIBS += -L$$C:/Windows/System32 -lws2_32
#To get the Ip address into the network.c
LIBS += -L$$C:/Windows/System32 -lwsock32 -lIPHLPAPI -lws2_32

#include the pri to copy files to C:\
include ("$$PWD/../dependencies/windows/common/pri/mastic-job-copy.pri")
}

macx:{
Expand Down Expand Up @@ -204,12 +182,13 @@ unix:{
#--------- COMMON ---------#

##Add headers from dependencies
INCLUDEPATH += $$PWD/czmq/include \
$$PWD/zyre/include \
$$PWD/yajl/lloyd-yajl-2.1.0/include \
zyre_include_path = $$PWD/../dependencies/windows/headers/zyre_suite
yajl_include_path = $$PWD/../dependencies/yajl/src/api

INCLUDEPATH += $$zyre_include_path \
$$yajl_include_path \

DEPENDPATH += $$PWD/czmq/include \
$$PWD/zyre/include \
$$PWD/yajl/lloyd-yajl-2.1.0/include \
DEPENDPATH += $$zyre_include_path \
$$yajl_include_path \


2 changes: 1 addition & 1 deletion builds/mastic.pro
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ win32:{
#CONFIG+=raspberry_compilation


include ('../dependencies/mastic_api_crossplateform.pri')
include ('mastic-dev.pri')

32 changes: 32 additions & 0 deletions dependencies/windows/common/pri/mastic-job-copy.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@


#Mastic.h
header_source_path = $$shell_path($$clean_path($$absolute_path($$PWD/../../../../src/include/mastic.h)))
header_dest_path = $$shell_path($$clean_path("C:/mastic/include/*"))

#Create a command, using the 'cmd' command line and Window's 'xcopy'
copyHeaders.commands = $$quote(cmd /c xcopy /S /Y /I $${header_source_path} $${header_dest_path})

#dll
win32:{
dependencies_src_path = $$shell_path($$clean_path($$absolute_path( $${libs_path}/*)))
mastic_dependencies_src_path = $$shell_path($$clean_path($$absolute_path( $$DESTDIR/mastic.*)))

CONFIG(debug, debug|release){
dependencies_dest_path = $$shell_path($$clean_path("C:/mastic/libs/debug/*"))
}else {
dependencies_dest_path = $$shell_path($$clean_path("C:/mastic/libs/release/*"))
}
}

copyDependencies.commands = $$quote(cmd /c xcopy /S /Y /I $${dependencies_src_path} $${dependencies_dest_path})
copyMasticDLL.commands = $$quote( cmd /c xcopy /S /Y /I $${mastic_dependencies_src_path} $${dependencies_dest_path} )

#Add the command to Qt.
QMAKE_EXTRA_TARGETS += copyHeaders \
copyDependencies \
copyMasticDLL \

POST_TARGETDEPS += copyHeaders \
copyDependencies \
copyMasticDLL \
Loading

0 comments on commit 227dbb5

Please sign in to comment.