build: streamline CMAKE_MODULE_PATH interaction
This commit is contained in:
parent
037b34d9e9
commit
20475c59e1
5 changed files with 37 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,6 +1,6 @@
|
|||
# lsp keeps state here
|
||||
.cache
|
||||
# typical build directory
|
||||
build
|
||||
.build*
|
||||
# lsp: symlink to file in build directory (established manually)
|
||||
compile_commands.json
|
||||
|
|
|
|||
|
|
@ -6,8 +6,7 @@ project(xo_pyreactor VERSION 1.0)
|
|||
enable_language(CXX)
|
||||
|
||||
# common XO cmake macros (see github.com:Rconybea/xo-cmake)
|
||||
include(xo_macros/xo_cxx)
|
||||
include(xo_macros/code-coverage)
|
||||
include(cmake/xo-bootstrap-macros.cmake)
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# unit test setup
|
||||
|
|
|
|||
12
EXAMPLES
Normal file
12
EXAMPLES
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
* see ../process_py/README
|
||||
|
||||
>>> import reactor_py
|
||||
>>> p=reactor_py.make_realization_printer()
|
||||
>>> p
|
||||
<reactor_py.SinkToConsole object at 0x1011853f0>
|
||||
>>>
|
||||
|
||||
>>> import inspect
|
||||
>>> inspect.getmro(reactor_py.SinkToConsole)
|
||||
|
||||
>>> dir(reactor_py)
|
||||
11
README.md
11
README.md
|
|
@ -25,6 +25,17 @@ $ make install
|
|||
```
|
||||
(also see .github/workflows/main.yml)
|
||||
|
||||
## Examples
|
||||
|
||||
Assumes `xo-pyreactor` installed to `~/local2/lib`
|
||||
```
|
||||
PYTHONPATH=~/local2/lib:$PYTHONPATH python
|
||||
>>> import xo_pyreactor
|
||||
>>> dir(xo_pyreactor)
|
||||
['AbstractEventProcessor', 'AbstractEventStore', 'AbstractSink', 'AbstractSource', 'CallbackId', 'Reactor', 'ReactorSource', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'time2str']
|
||||
>>>
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
### build for unit test coverage
|
||||
|
|
|
|||
12
cmake/xo-bootstrap-macros.cmake
Normal file
12
cmake/xo-bootstrap-macros.cmake
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
if (("${CMAKE_MODULE_PATH}" STREQUAL "") OR ("${CMAKE_MODULE_PATH}" STREQUAL "prefix"))
|
||||
# default to typical install location for xo-project-macros
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/cmake)
|
||||
endif()
|
||||
|
||||
message("-- CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
|
||||
message("-- CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}")
|
||||
|
||||
# needs to have been installed somewhere on CMAKE_MODULE_PATH,
|
||||
# (e.g. from xo-cmake with the same value for CMAKE_INSTALL_PREFIX)
|
||||
#
|
||||
include(xo_macros/xo-project-macros)
|
||||
Loading…
Add table
Add a link
Reference in a new issue