Commit 14eee683 authored by Ralf Habacker's avatar Ralf Habacker

Enable building php import support if all required dependencies have been found

Building PHP import support requires development packages for
KDevPlatform and kdevelop-PG-Qt and is currently limited to KDE4.
Signed-off-by: Ralf Habacker's avatarRalf Habacker <ralf.habacker@freenet.de>

BUG:148911
FIXED-IN:2.22.80 (KDE Applications 17.07.80)
parent a54a58b6
......@@ -133,7 +133,11 @@ if(NOT BUILD_KF5)
)
set(NO_INSTALL 1)
set(BUILD_PARSER_ONLY 1)
add_definitions(-DKDEVPHPPARSER_EXPORT=)
set(BUILD_PHP_IMPORT 1)
add_definitions(
-DKDEVPHPPARSER_EXPORT=
-DENABLE_PHP_IMPORT
)
add_subdirectory(lib/kdev4-php)
endif()
......
......@@ -10,9 +10,13 @@ endif()
########### set variables #############
# php import support requires kdevplatform and kdev-php
# which does not compile without NO_CAST_XX_ASCII
if(NOT BUILD_PHP_IMPORT)
add_definitions(-DQT_NO_CAST_TO_ASCII)
add_definitions(-DQT_NO_CAST_FROM_ASCII)
endif()
# Some definitions for experimental code or debugging
#add_definitions(-DQT_NO_CAST_TO_ASCII)
#add_definitions(-DQT_NO_CAST_FROM_ASCII)
# TODO migrate debug settings to DEBUG_REGISTER macro
#add_definitions(-DXMI_FLAT_PACKAGES) # umlobject
#add_definitions(-DDEBUG_LVITEM_INSERTION_ORDER) # umllistviewitem
......@@ -292,7 +296,6 @@ ki18n_wrap_ui( libcodeimpwizard_SRCS
set(libcodeimport_SRCS
codeimport/adaimport.cpp
codeimport/classimport.cpp
codeimport/phpimport.cpp
codeimport/idlimport.cpp
codeimport/import_utils.cpp
codeimport/javaimport.cpp
......@@ -302,6 +305,11 @@ set(libcodeimport_SRCS
codeimport/sqlimport.cpp
codeimport/csharp/csharpimport.cpp
)
if(BUILD_PHP_IMPORT)
list(APPEND libcodeimport_SRCS
codeimport/phpimport.cpp
)
endif()
list(APPEND libcodeimport_SRCS
codeimport/cppimport.cpp
......@@ -543,7 +551,7 @@ if(NOT BUILD_KF5)
${KDE4_KFILE_LIBS}
)
if(KDEVPLATFORM_FOUND)
if(BUILD_PHP_IMPORT)
target_link_libraries(libumbrello
${KDEVPLATFORM_INTERFACES_LIBRARIES}
${KDEVPLATFORM_LANGUAGE_LIBRARIES}
......
......@@ -25,7 +25,9 @@
#include "cppimport.h"
#include "csharpimport.h"
#include "codeimpthread.h"
#ifdef ENABLE_PHP_IMPORT
#include "phpimport.h"
#endif
// kde includes
#include <KLocalizedString>
......@@ -55,8 +57,10 @@ ClassImport *ClassImport::createImporterByFileExt(const QString &fileName, CodeI
classImporter = new CSharpImport(thread);
else if (fileName.endsWith(QLatin1String(".sql")))
classImporter = new SQLImport(thread);
#ifdef ENABLE_PHP_IMPORT
else if (fileName.endsWith(QLatin1String(".php")))
classImporter = new PHPImport(thread);
#endif
else
classImporter = new CppImport(thread); // the default.
return classImporter;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment