Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux: added project part for QtCreator. #2703

Merged
merged 2 commits into from Jun 26, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions CocosDenshion/proj.linux/CocosDenshion.prf
@@ -0,0 +1,20 @@
################################################################################
# Do not include this file in your project: see cocos2dx.pri.
################################################################################

linux {
# We will compile extensions on demand using Makefile.
build_CocosDension.name = Build extension static library
build_CocosDension.input = $$PWD/Makefile
build_CocosDension.output = $$CC_LIBRARY_DIR/libcocosdenshion.so
build_CocosDension.target = $$CC_LIBRARY_DIR/libcocosdenshion.so
build_CocosDension.CONFIG = no_link target_predeps
build_CocosDension.commands = cd $$PWD && make $$CC_MAKE_FLAGS

QMAKE_EXTRA_COMPILERS += build_CocosDension
QMAKE_EXTRA_TARGETS += build_CocosDension

PRE_TARGETDEPS += $$CC_LIBRARY_DIR/libcocosdenshion.so
LIBS += -lcocosdenshion
}

37 changes: 37 additions & 0 deletions cocos2dx/proj.linux/cocos2dx.prf
@@ -0,0 +1,37 @@
################################################################################
# Do not include this file in your project: see cocos2dx.pri.
################################################################################

linux {
# Use OpenAL in default QtCreator project.
isEmpty(COCOS2D_USE_FMOD):COCOS2D_USE_FMOD=0

# Variables used when building libraries.
CC_LIBRARY_DIR = $$PWD/../../lib/linux/release
CC_MAKE_FLAGS = -s
CONFIG(debug, debug|release) {
# Override in debug build.
CC_MAKE_FLAGS += DEBUG=1
CC_LIBRARY_DIR = $$PWD/../../lib/linux/debug
}
contains(COCOS2D_MODULES,box2d) {
CC_MAKE_FLAGS += USE_BOX2D=1
}
!equals(COCOS2D_USE_FMOD, 1) {
CC_MAKE_FLAGS += OPENAL=1
}

# We will compile cocos2d shared library on demand using Makefile.
build_cocos2d.name = Build cocos2d shared library
build_cocos2d.input = $$PWD/Makefile
build_cocos2d.output = $$CC_LIBRARY_DIR/libcocos2d.so
build_cocos2d.target = $$CC_LIBRARY_DIR/libcocos2d.so
build_cocos2d.CONFIG = no_link target_predeps
build_cocos2d.commands = cd $$PWD && make $$CC_MAKE_FLAGS ${QMAKE_FILE_IN}

QMAKE_EXTRA_COMPILERS += build_cocos2d
QMAKE_EXTRA_TARGETS += build_cocos2d

PRE_TARGETDEPS += $$CC_LIBRARY_DIR/libcocos2d.so
LIBS += -L$$CC_LIBRARY_DIR -lcocos2d -Wl,-rpath,\'$$CC_LIBRARY_DIR\'
}
70 changes: 70 additions & 0 deletions cocos2dx/proj.linux/cocos2dx.pri
@@ -0,0 +1,70 @@

################################################################################
#
# If you want enable extra modules, set COCOS2D_MODULES variable before include
# this file, example:
# COCOS2D_MODULES += CocosDenshion
# COCOS2D_MODULES += extensions
# COCOS2D_MODULES += box2d
# or
# COCOS2D_MODULES += chipmunk
# note: you cannot include both box2d and chipmunk.
#
# By default, QtCreator project will use OpenAL audio backend (because FMOD is
# free only for non-commercial use). If you are legal FMOD user, set variable
# COCOS2D_USE_FMOD to use FMOD audio backend:
# COCOS2D_USE_FMOD = 1
#
################################################################################

INCLUDEPATH += $$PWD/../
INCLUDEPATH += $$PWD/../cocoa/
INCLUDEPATH += $$PWD/../include/
INCLUDEPATH += $$PWD/../platform/
INCLUDEPATH += $$PWD/../kazmath/include

*-msvc* {
# Use equivalents of -Wno-overloaded-virtual -Wno-unused-parameter.
QMAKE_CXXFLAGS_WARN_ON += /wd4263 /wd4100
} else {
QMAKE_CXXFLAGS_WARN_ON += -Wno-ignored-qualifiers -Wno-overloaded-virtual -Wno-unused-parameter -Wno-unused-function
QMAKE_CXXFLAGS += -std=c++0x
}

include($$PWD/cocos2dx.prf)

linux {
DEFINES += LINUX
INCLUDEPATH += $$PWD/../platform/linux
LIBS += -lpthread
}

contains(COCOS2D_MODULES,CocosDenshion) {
INCLUDEPATH += $$PWD/../../CocosDenshion/include
include($$PWD/../../CocosDenshion/proj.linux/CocosDenshion.prf)
}

contains(COCOS2D_MODULES,extensions) {
INCLUDEPATH += $$PWD/../../extensions
LIBS += -lcurl
include($$PWD/../../extensions/proj.linux/extensions.prf)
}

contains(COCOS2D_MODULES,box2d) {
INCLUDEPATH += $$PWD/../../external
include($$PWD/../../external/Box2D/proj.linux/box2d.prf)
}

contains(COCOS2D_MODULES,chipmunk) {
contains(COCOS2D_MODULES,box2d):error("COCOS2D_MODULES cannot contain both box2d and chipmunk: choose one and remove another.")

INCLUDEPATH += $$PWD/../../external/chipmunk/include/chipmunk
include($$PWD/../../external/chipmunk/proj.linux/chipmunk.prf)
}

CONFIG(debug, debug|release) {
DEFINES += COCOS2D_DEBUG=1
}
else {
DEFINES += COCOS2D_DEBUG=0
}
20 changes: 20 additions & 0 deletions extensions/proj.linux/extensions.prf
@@ -0,0 +1,20 @@
################################################################################
# Do not include this file in your project: see cocos2dx.pri.
################################################################################

linux {
# We will compile extensions on demand using Makefile.
build_extension.name = Build extension static library
build_extension.input = $$PWD/Makefile
build_extension.output = $$CC_LIBRARY_DIR/libextension.a
build_extension.target = $$CC_LIBRARY_DIR/libextension.a
build_extension.CONFIG = no_link target_predeps
build_extension.commands = cd $$PWD && make $$CC_MAKE_FLAGS

QMAKE_EXTRA_COMPILERS += build_extension
QMAKE_EXTRA_TARGETS += build_extension

PRE_TARGETDEPS += $$CC_LIBRARY_DIR/libextension.a
LIBS += -Wl,-Bstatic -lextension -Wl,-Bdynamic
}

19 changes: 19 additions & 0 deletions external/Box2D/proj.linux/box2d.prf
@@ -0,0 +1,19 @@
################################################################################
# Do not include this file in your project: see cocos2dx.pri.
################################################################################

linux {
# We will compile box2d on demand using Makefile.
build_box2d.name = Build box2d static library
build_box2d.input = $$PWD/Makefile
build_box2d.output = $$CC_LIBRARY_DIR/libbox2d.a
build_box2d.target = $$CC_LIBRARY_DIR/libbox2d.a
build_box2d.CONFIG = no_link target_predeps
build_box2d.commands = cd $$PWD && make $$CC_MAKE_FLAGS

QMAKE_EXTRA_COMPILERS += build_box2d
QMAKE_EXTRA_TARGETS += build_box2d

PRE_TARGETDEPS += $$CC_LIBRARY_DIR/libbox2d.a
LIBS += -Wl,-Bstatic -lbox2d -Wl,-Bdynamic
}
19 changes: 19 additions & 0 deletions external/chipmunk/proj.linux/chipmunk.prf
@@ -0,0 +1,19 @@
################################################################################
# Do not include this file in your project: see cocos2dx.pri.
################################################################################

linux {
# We will compile chipmunk on demand using Makefile.
build_chipmunk.name = Build chipmunk static library
build_chipmunk.input = $$PWD/Makefile
build_chipmunk.output = $$CC_LIBRARY_DIR/libchipmunk.a
build_chipmunk.target = $$CC_LIBRARY_DIR/libchipmunk.a
build_chipmunk.CONFIG = no_link target_predeps
build_chipmunk.commands = cd $$PWD && make $$CC_MAKE_FLAGS

QMAKE_EXTRA_COMPILERS += build_chipmunk
QMAKE_EXTRA_TARGETS += build_chipmunk

PRE_TARGETDEPS += $$CC_LIBRARY_DIR/libchipmunk.a
LIBS += -Wl,-Bstatic -lchipmunk -Wl,-Bdynamic
}