-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmake.py.in
More file actions
27 lines (24 loc) · 1.13 KB
/
cmake.py.in
File metadata and controls
27 lines (24 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Define some variables that all code generators are likely to need.
# The @FOO@ elements in this file are interpolated by cmake's configure()
# command so that they contain the correct values. (Note: the names of cmake's
# config vars is retained, including the inconsistencies. :-})
#
__all__ = ['CMAKE_SOURCE_DIR', 'GCCXML_COMPILER', 'GCCXML_DEFINES',
'GCCXML_PATH', 'OSG_INCLUDE_DIR', 'abspath', 'create_gccxml_cache']
CMAKE_BINARY_DIR = "@CMAKE_BINARY_DIR@"
CMAKE_SOURCE_DIR = "@CMAKE_SOURCE_DIR@"
GCCXML_COMPILER = "@GCCXML_COMPILER@"
GCCXML_DEFINES = "@GCCXML_DEFINES@".split()
GCCXML = "@GCCXML@"
OSG_INCLUDE_DIR = "@OSG_INCLUDE_DIR@"
Boost_INCLUDE_DIR = "@Boost_INCLUDE_DIR@"
def abspath(path):
""" Given a path (which may be relative), return its absolute path"""
import os
return os.path.abspath(os.path.dirname(path))
def create_gccxml_cache(cache_header):
from os.path import basename, splitext
from pygccxml import parser
cache_file = basename(splitext(cache_header)[0] + '.xml')
gccxml_cache = parser.create_cached_source_fc(cache_header, cache_file)
return gccxml_cache