Install parser headers and cmake config files to support client packages
ClosedPublic

Authored by habacker on Jan 2 2018, 10:37 PM.

Details

Summary

Generated headers, which may be required by client packages, are installed
into a private and version specific include dir to indicate that they may
not be stable.

To use the parser in client packages simply add kdevphpparser with
target_link_libraries to a target. Parser related headers need to be
prefixed with <parser/...> e.g. #include <parser/tokenstream.h>.

BUG:388370

Test Plan

compiled on linux, verified with patched umbrello build

Diff Detail

Repository
R52 KDevelop: PHP Support
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
habacker created this revision.Jan 2 2018, 10:37 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptJan 2 2018, 10:37 PM
habacker requested review of this revision.Jan 2 2018, 10:37 PM
brauch added a subscriber: brauch.

I'll add some people who have recently been working on kdev-php.

pprkut added a comment.Jan 6 2018, 8:03 PM

Not really a cmake expert. Changes look sound, but can't really judge whether they are correct. Generally looks fine to me, apart from installing the php.g grammar file.

parser/CMakeLists.txt
53

Seems a bit odd to me to install the grammar file. Afaics phpparser.h is generated from it and should have everything one needs, no?

kfunk requested changes to this revision.Jan 9 2018, 1:00 PM
kfunk added inline comments.
CMakeLists.txt
1–2

project(kdev-php VERSION 5.1.2) please. And then just PROJECT_VERSION & friends below.

See: https://cmake.org/cmake/help/v3.0/command/project.html

18

We'll have a hard time updating the kdev-php version via scripts then.

52

Why that?

I guess that should be CMAKE_CURRENT_BINARY_DIR?

parser/CMakeLists.txt
29

Can be merged in one single target_include_directories(...) call.

53

+1

This revision now requires changes to proceed.Jan 9 2018, 1:00 PM
habacker updated this revision to Diff 25663.Jan 19 2018, 11:07 PM
  • use single target_include_directories
  • setup version in project command
habacker marked 3 inline comments as done.Jan 19 2018, 11:08 PM
habacker added inline comments.
CMakeLists.txt
52

no, otherwise there are compile errors:

[ 27%] Building CXX object parser/CMakeFiles/kdevphpparser.dir/phpparser.cpp.o
In file included from /home/xxx/src/kdev-php-build/parser/phpparser.h:7:0,

from /home/xxx/src/kdev-php-build/parser/phpparser.cpp:4:

/home/xxx/src/kdev-php-build/parser/phptokentype.h:13:32: fatal error: parser/tokenstream.h: Could not find file or directory

This is because headers are installed in related subdirectories e.g. files inside parser subdir are installed in <include-install-root>/parser/... and references other files from this dir with this prefix, see php.g

habacker marked 2 inline comments as done.Jan 19 2018, 11:08 PM
habacker marked 3 inline comments as done.

Just to be exact: This patch is against 5.1 branch, from which the stable version (at least on opensuse Leap 42.3) has been build https://software.opensuse.org/package/kdevelop5-plugin-php?search_term=kdevelop5-plugin-php

This revision was not accepted when it landed; it landed in state Needs Review.Mar 22 2018, 6:29 AM
This revision was automatically updated to reflect the committed changes.