Commit c4ae6f1b authored by Dominik Charousset's avatar Dominik Charousset

Remove obsolete files

parent 889ec7ef
# Try to find CAF headers and libraries.
#
# Use this module as follows:
#
# find_package(CAF [COMPONENTS <core|io|openssl|...>*] [REQUIRED])
#
# Variables used by this module (they can change the default behaviour and need
# to be set before calling find_package):
#
# CAF_ROOT_DIR Set this variable either to an installation prefix or to wa
# CAF build directory where to look for the CAF libraries.
#
# Variables defined by this module:
#
# CAF_FOUND System has CAF headers and library
# CAF_VERSION Found CAF release number
# CAF_LIBRARIES List of library files for all components
# CAF_INCLUDE_DIRS List of include paths for all components
if(CAF_FIND_COMPONENTS STREQUAL "")
message(FATAL_ERROR "FindCAF requires at least one COMPONENT.")
endif()
# iterate over user-defined components
foreach (comp ${CAF_FIND_COMPONENTS})
# we use uppercase letters only for variable names
string(TOUPPER "${comp}" UPPERCOMP)
if ("${comp}" STREQUAL "core")
set(HDRNAME "caf/all.hpp")
elseif ("${comp}" STREQUAL "test")
set(HDRNAME "caf/test/unit_test.hpp")
else ()
set(HDRNAME "caf/${comp}/all.hpp")
endif ()
if (CAF_ROOT_DIR)
set(header_hints
"${CAF_ROOT_DIR}/include"
"${CAF_ROOT_DIR}/libcaf_${comp}"
"${CAF_ROOT_DIR}/../libcaf_${comp}"
"${CAF_ROOT_DIR}/../../libcaf_${comp}")
endif ()
find_path(CAF_INCLUDE_DIR_${UPPERCOMP}
NAMES
${HDRNAME}
HINTS
${header_hints}
/usr/include
/usr/local/include
/opt/local/include
/sw/include
${CMAKE_INSTALL_PREFIX}/include
${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
mark_as_advanced(CAF_INCLUDE_DIR_${UPPERCOMP})
if (NOT "${CAF_INCLUDE_DIR_${UPPERCOMP}}"
STREQUAL "CAF_INCLUDE_DIR_${UPPERCOMP}-NOTFOUND")
# mark as found (set back to false when missing library or build header)
set(CAF_${comp}_FOUND true)
# check for CMake-generated build header for the core component
if ("${comp}" STREQUAL "core")
find_path(caf_build_header_path
NAMES
caf/detail/build_config.hpp
HINTS
${CAF_ROOT_DIR}
${header_hints}
/usr/include
/usr/local/include
/opt/local/include
/sw/include
${CMAKE_INSTALL_PREFIX}/include
${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
if ("${caf_build_header_path}" STREQUAL "caf_build_header_path-NOTFOUND")
message(WARNING "Found all.hpp for CAF core, but not build_config.hpp")
set(CAF_${comp}_FOUND false)
else()
list(APPEND CAF_INCLUDE_DIRS "${caf_build_header_path}")
endif()
endif()
list(APPEND CAF_INCLUDE_DIRS "${CAF_INCLUDE_DIR_${UPPERCOMP}}")
# look for (.dll|.so|.dylib) file, again giving hints for non-installed CAFs
# skip probe_event as it is header only
if (NOT ${comp} STREQUAL "probe_event" AND NOT ${comp} STREQUAL "test")
if (CAF_ROOT_DIR)
set(library_hints "${CAF_ROOT_DIR}/lib")
endif ()
find_library(CAF_LIBRARY_${UPPERCOMP}
NAMES
"caf_${comp}"
HINTS
${library_hints}
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
${CMAKE_INSTALL_PREFIX}/lib
${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}
${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_BUILD_TYPE})
mark_as_advanced(CAF_LIBRARY_${UPPERCOMP})
if ("${CAF_LIBRARY_${UPPERCOMP}}"
STREQUAL "CAF_LIBRARY_${UPPERCOMP}-NOTFOUND")
set(CAF_${comp}_FOUND false)
else ()
set(CAF_LIBRARIES ${CAF_LIBRARIES} ${CAF_LIBRARY_${UPPERCOMP}})
endif ()
endif ()
endif ()
endforeach ()
if (DEFINED CAF_INCLUDE_DIRS)
list(REMOVE_DUPLICATES CAF_INCLUDE_DIRS)
endif()
if (NOT CAF_INCLUDE_DIR_CORE STREQUAL "CAF_INCLUDE_DIR_CORE-NOTFOUND")
# read content of config.hpp
file(READ "${CAF_INCLUDE_DIR_CORE}/caf/config.hpp" CONFIG_HPP)
# get line containing the version
string(REGEX MATCH "#define CAF_VERSION [0-9]+" VERSION_LINE "${CONFIG_HPP}")
# extract version number from line
string(REGEX MATCH "[0-9]+" VERSION_INT "${VERSION_LINE}")
# calculate major, minor, and patch version
math(EXPR CAF_VERSION_MAJOR "${VERSION_INT} / 10000")
math(EXPR CAF_VERSION_MINOR "( ${VERSION_INT} / 100) % 100")
math(EXPR CAF_VERSION_PATCH "${VERSION_INT} % 100")
# create full version string
set(CAF_VERSION "${CAF_VERSION_MAJOR}.${CAF_VERSION_MINOR}.${CAF_VERSION_PATCH}")
if (NOT CAF_VERSION)
unset(CAF_VERSION)
message(WARNING "Unable to determine CAF version")
endif ()
endif ()
# let CMake check whether all requested components have been found
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CAF
FOUND_VAR CAF_FOUND
REQUIRED_VARS CAF_VERSION CAF_LIBRARIES CAF_INCLUDE_DIRS
HANDLE_COMPONENTS)
# final step to tell CMake we're done
mark_as_advanced(CAF_ROOT_DIR
CAF_VERSION
CAF_LIBRARIES
CAF_INCLUDE_DIRS)
if (CAF_core_FOUND AND NOT TARGET caf::core)
add_library(caf::core UNKNOWN IMPORTED)
set_target_properties(caf::core PROPERTIES
IMPORTED_LOCATION "${CAF_LIBRARY_CORE}"
INTERFACE_INCLUDE_DIRECTORIES "${CAF_INCLUDE_DIR_CORE}")
endif ()
if (CAF_io_FOUND AND NOT TARGET caf::io)
add_library(caf::io UNKNOWN IMPORTED)
set_target_properties(caf::io PROPERTIES
IMPORTED_LOCATION "${CAF_LIBRARY_IO}"
INTERFACE_INCLUDE_DIRECTORIES "${CAF_INCLUDE_DIR_IO}"
INTERFACE_LINK_LIBRARIES "caf::core")
endif ()
if (CAF_openssl_FOUND AND NOT TARGET caf::openssl)
add_library(caf::openssl UNKNOWN IMPORTED)
set_target_properties(caf::openssl PROPERTIES
IMPORTED_LOCATION "${CAF_LIBRARY_OPENSSL}"
INTERFACE_INCLUDE_DIRECTORIES "${CAF_INCLUDE_DIR_OPENSSL}"
INTERFACE_LINK_LIBRARIES "caf::core;caf::io")
if (NOT BUILD_SHARED_LIBS)
include(CMakeFindDependencyMacro)
set(OPENSSL_USE_STATIC_LIBS TRUE)
find_dependency(OpenSSL)
set_property(TARGET caf::openssl APPEND PROPERTY
INTERFACE_LINK_LIBRARIES "OpenSSL::SSL")
endif ()
endif ()
if (CAF_test_FOUND AND NOT TARGET caf::test)
add_library(caf::test INTERFACE IMPORTED)
set_target_properties(caf::test PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CAF_INCLUDE_DIR_TEST}"
INTERFACE_LINK_LIBRARIES "caf::core")
endif ()
#!/usr/bin/env python
from __future__ import print_function
import sys
# decodes 6bit characters to ASCII
DECODING_TABLE = ' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'
def atom_read(x):
result = ''
read_chars = ((x & 0xF000000000000000) >> 60) == 0xF
mask = 0x0FC0000000000000
bitshift = 54
while bitshift >= 0:
if read_chars:
result += DECODING_TABLE[(x & mask) >> bitshift]
elif ((x & mask) >> bitshift) == 0xF:
read_chars = True
bitshift -= 6
mask = mask >> 6
return result
if __name__ == '__main__':
if len(sys.argv) != 2:
print('*** Usage: atom.py <atom_val>')
sys.exit(-1)
try:
s = sys.argv[1]
if s.startswith('0x'):
val = int(s, 16)
else:
val = int(s)
print(atom_read(val))
except ValueError:
print('Not a number:', sys.argv[1])
print('*** Usage: atom.py <atom_val>')
sys.exit(-2)
#!/usr/bin/env python
# Generates the content for an index.rst file
# from the content of a manual.tex file.
#
# Usage: make_index_rst.py <output-file> <input-file>
import re
import sys
part_rx = re.compile(r"\\part{(.+)}")
include_rx = re.compile(r"\\include{tex/(.+)}")
with open(sys.argv[1], 'w') as out_file:
out_file.write(".. include:: index_header.rst\n")
with open(sys.argv[2]) as tex_file:
for line in tex_file:
m = part_rx.match(line)
if m:
out_file.write("\n.. toctree::\n"
" :maxdepth: 2\n"
" :caption: ")
out_file.write(m.group(1))
out_file.write("\n\n")
continue
m = include_rx.match(line)
if m:
out_file.write(" ")
out_file.write(m.group(1))
out_file.write("\n")
out_file.write("\n.. include:: index_footer.rst\n")
#!/usr/bin/env python
import json
import sys
import re
from pandocfilters import toJSONFilter, Header, Str, RawBlock, RawInline, Image, Space
# This file fixes cross-references when building Sphinx documentation
# from the manual's .tex files.
# -- constants ----------------------------------------------------------------
singlefig_rx = re.compile(r"\\singlefig{(.+)}{(.+)}{(.+)}")
listing_rx = re.compile(r"\\(cppexample|iniexample|sourcefile)(?:\[(.+)\])?{(.+)}")
# -- factory functions --------------------------------------------------------
def make_rst_block(x):
return RawBlock('rst', x)
def make_rst_ref(x):
return RawInline('rst', ":ref:`" + x + "`")
def make_rst_image(img, caption, label):
return make_rst_block('.. figure:: ' + img + '.png\n' +
' :alt: ' + caption + '\n' +
' :name: ' + label + '\n' +
'\n' +
' ' + caption + '\n\n')
# -- code listing generation --------------------------------------------------
def parse_range(astr):
if not astr:
return set()
result = set()
for part in astr.split(','):
x = part.split('-')
result.update(range(int(x[0]), int(x[-1]) + 1))
return sorted(result)
def make_rst_listing(line_range, fname, language):
snippet = ''
if not line_range:
with open(fname, 'r') as fin:
for line in fin:
snippet += ' '
snippet += line
else:
with open(fname) as mfile:
for num, line in enumerate(mfile, 1):
if num in line_range:
snippet += ' '
snippet += line
return make_rst_block('.. code-block:: ' + language + '\n' +
'\n' +
snippet + '\n')
def cppexample(line_range, fname):
return make_rst_listing(line_range, '../../examples/{0}.cpp'.format(fname), 'C++')
def iniexample(line_range, fname):
return make_rst_listing(line_range, '../../examples/{0}.ini'.format(fname), 'ini')
def sourcefile(line_range, fname):
return make_rst_listing(line_range, '../../{0}'.format(fname), 'C++')
# -- Pandoc callback ----------------------------------------------------------
def behead(key, value, format, meta):
global singlefig_rx
# pandoc does not emit labels before sections -> insert
if key == 'Header':
raw_lbl = value[1][0]
if raw_lbl:
lbl = '.. _' + raw_lbl + ':\n\n'
value[1][0] = ''
return [make_rst_block(lbl), Header(value[0], value[1], value[2])]
# fix string parsing
elif key == 'Str':
if len(value) > 3:
# pandoc generates [refname] as strings for \ref{refname} -> fix
if value[0] == '[':
return make_rst_ref(value[1:-1])
elif value[1] == '[':
return make_rst_ref(value[2:-1])
# images don't have file endings in .tex -> add .png
elif key == 'Image':
return Image(value[0], value[1], [value[2][0] + ".png", value[2][1]])
elif key == 'RawBlock' and value[0] == 'latex':
# simply drop \clearpage
if value[1] == '\\clearpage':
return []
# convert \singlefig to Image node
m = singlefig_rx.match(value[1])
if m:
return make_rst_image(m.group(1), m.group(2), m.group(3))
m = listing_rx.match(value[1])
if m:
return globals()[m.group(1)](parse_range(m.group(2)), m.group(3))
sys.stderr.write("WARNING: unrecognized raw LaTeX" + str(value) + '\n')
if __name__ == "__main__":
toJSONFilter(behead)
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