Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProMod3
Manage
Activity
Members
Plan
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
ProMod3
Commits
11797207
Commit
11797207
authored
11 years ago
by
Bienchen
Browse files
Options
Downloads
Patches
Plain Diff
Fixed build system: make check/ doc dependencies for Python modules
parent
920d1c35
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
cmake_support/PROMOD3.cmake
+16
-3
16 additions, 3 deletions
cmake_support/PROMOD3.cmake
core/pymod/CMakeLists.txt
+1
-1
1 addition, 1 deletion
core/pymod/CMakeLists.txt
doc/CMakeLists.txt
+2
-1
2 additions, 1 deletion
doc/CMakeLists.txt
doc/conf.py.in
+1
-1
1 addition, 1 deletion
doc/conf.py.in
with
20 additions
and
6 deletions
cmake_support/PROMOD3.cmake
+
16
−
3
View file @
11797207
...
@@ -492,12 +492,16 @@ endmacro()
...
@@ -492,12 +492,16 @@ endmacro()
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Synopsis:
# Synopsis:
# pymod(NAME name CPP source1 source2 PY source source2 [IN_DIR dir]
# pymod(NAME name CPP source1 source2 PY source source2 [IN_DIR dir]
# source3 source4 [IN_DIR dir] [LINK link] [OUTPUT_DIR dir])
# source3 source4 [IN_DIR dir] [LINK link] [OUTPUT_DIR dir]
# [IS_CORE bool])
#
#
# Description:
# Description:
# Define a python module consisting of C++ type wrappers and/or code written
# Define a python module consisting of C++ type wrappers and/or code written
# in Python.
# in Python.
# OUTPUT_DIR defines, where in the Python tree the files will be placed
# OUTPUT_DIR defines, where in the Python tree the files will be placed
# IS_CORE marks the main/ surrounding Python construct which incorporates
# all other modules; will create a certain target which is a
# dependency to modules of lower hierarchy; only allowed once
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
macro
(
pymod
)
macro
(
pymod
)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
...
@@ -505,7 +509,7 @@ macro(pymod)
...
@@ -505,7 +509,7 @@ macro(pymod)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
set
(
_ARG_PREFIX promod3
)
set
(
_ARG_PREFIX promod3
)
parse_argument_list
(
_ARG
parse_argument_list
(
_ARG
"NAME;CPP;PY;LINK;OUTPUT_DIR"
""
${
ARGN
}
)
"NAME;CPP;PY;LINK;OUTPUT_DIR
;IS_CORE
"
""
${
ARGN
}
)
if
(
NOT _ARG_NAME
)
if
(
NOT _ARG_NAME
)
message
(
FATAL_ERROR
"invalid use of pymod(): a name must be provided"
)
message
(
FATAL_ERROR
"invalid use of pymod(): a name must be provided"
)
endif
()
endif
()
...
@@ -607,6 +611,15 @@ macro(pymod)
...
@@ -607,6 +611,15 @@ macro(pymod)
copy_if_different
(
"./"
"
${
PYMOD_STAGE_DIR
}
"
"
${
_ABS_PY_FILES
}
"
"TARGETS"
copy_if_different
(
"./"
"
${
PYMOD_STAGE_DIR
}
"
"
${
_ABS_PY_FILES
}
"
"TARGETS"
"
${
_ARG_NAME
}
_pymod"
)
"
${
_ARG_NAME
}
_pymod"
)
add_dependencies
(
"_
${
_ARG_NAME
}
"
"
${
_ARG_NAME
}
_pymod"
)
add_dependencies
(
"_
${
_ARG_NAME
}
"
"
${
_ARG_NAME
}
_pymod"
)
if
(
_ARG_IS_CORE
)
if
(
TARGET _pymod_root
)
message
(
FATAL_ERROR
"invalid use of pymod() (
${
_ARG_NAME
}
): IS_CORE defined twice!"
)
else
()
add_custom_target
(
"_pymod_root"
DEPENDS
"_
${
_ARG_NAME
}
"
)
endif
()
else
()
add_dependencies
(
"_
${
_ARG_NAME
}
"
"_pymod_root"
)
endif
()
include_directories
(
${
PYTHON_INCLUDE_PATH
}
)
include_directories
(
${
PYTHON_INCLUDE_PATH
}
)
install
(
FILES
${
_PY_FILES
}
DESTINATION
"
${
LIB_DIR
}
/
${
PYMOD_DIR
}
"
)
install
(
FILES
${
_PY_FILES
}
DESTINATION
"
${
LIB_DIR
}
/
${
PYMOD_DIR
}
"
)
endif
()
endif
()
...
@@ -692,7 +705,7 @@ macro(promod3_unittest)
...
@@ -692,7 +705,7 @@ macro(promod3_unittest)
set
(
python_path
"
${
python_path
}
:"
)
set
(
python_path
"
${
python_path
}
:"
)
endif
(
python_path
)
endif
(
python_path
)
# we just add OST manually here until we find a more flexible way
# we just add OST manually here until we find a more flexible way
set
(
python_path
"
${
python_path
}${
LIB_STAGE_PATH
}
/python
${
PYTHON_VERSION
}
/site-packages:
${
OST_ROOT
}
/
lib
/python
${
PYTHON_VERSION
}
/site-packages"
)
set
(
python_path
"
${
python_path
}${
LIB_STAGE_PATH
}
/python
${
PYTHON_VERSION
}
/site-packages:
${
OST_ROOT
}
/
${
LIB_DIR
}
/python
${
PYTHON_VERSION
}
/site-packages"
)
set
(
PY_TESTS_CMD
"PYTHONPATH=
${
python_path
}
${
PYTHON_BINARY
}
"
)
set
(
PY_TESTS_CMD
"PYTHONPATH=
${
python_path
}
${
PYTHON_BINARY
}
"
)
add_custom_target
(
"
${
py_test
}
_run"
add_custom_target
(
"
${
py_test
}
_run"
sh -c
"
${
PY_TESTS_CMD
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
py_test
}
|| echo"
sh -c
"
${
PY_TESTS_CMD
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
py_test
}
|| echo"
...
...
This diff is collapsed.
Click to expand it.
core/pymod/CMakeLists.txt
+
1
−
1
View file @
11797207
set
(
PROMOD3_CORE_FILES __init__.py
)
set
(
PROMOD3_CORE_FILES __init__.py
)
pymod
(
NAME core PY
${
PROMOD3_CORE_FILES
}
OUTPUT_DIR
"promod3"
)
pymod
(
NAME core PY
${
PROMOD3_CORE_FILES
}
OUTPUT_DIR
"promod3"
IS_CORE TRUE
)
This diff is collapsed.
Click to expand it.
doc/CMakeLists.txt
+
2
−
1
View file @
11797207
...
@@ -18,7 +18,8 @@ set(_SPHINX_CONF_SUBST_DICT PROMOD3_VERSION_MAJOR="${PROMOD3_VERSION_MAJOR}"
...
@@ -18,7 +18,8 @@ set(_SPHINX_CONF_SUBST_DICT PROMOD3_VERSION_MAJOR="${PROMOD3_VERSION_MAJOR}"
LIB_STAGE_PATH=
"
${
LIB_STAGE_PATH
}
"
LIB_STAGE_PATH=
"
${
LIB_STAGE_PATH
}
"
PYTHON_VERSION=
"
${
PYTHON_VERSION
}
"
PYTHON_VERSION=
"
${
PYTHON_VERSION
}
"
OST_ROOT=
"
${
OST_ROOT
}
"
OST_ROOT=
"
${
OST_ROOT
}
"
OST_DOC_URL=
"
${
OST_DOC_URL
}
"
)
OST_DOC_URL=
"
${
OST_DOC_URL
}
"
LIB_DIR=
"
${
LIB_DIR
}
"
)
set
(
_CONF_SUBST_DICT -DINPUT_FILE=
${
CMAKE_CURRENT_SOURCE_DIR
}
/conf.py.in -DOUT_FILE=
${
_SPHINX_CONF_PY
}
)
set
(
_CONF_SUBST_DICT -DINPUT_FILE=
${
CMAKE_CURRENT_SOURCE_DIR
}
/conf.py.in -DOUT_FILE=
${
_SPHINX_CONF_PY
}
)
foreach
(
_subst
${
_SPHINX_CONF_SUBST_DICT
}
)
foreach
(
_subst
${
_SPHINX_CONF_SUBST_DICT
}
)
list
(
APPEND _CONF_SUBST_DICT -D
${
_subst
}
)
list
(
APPEND _CONF_SUBST_DICT -D
${
_subst
}
)
...
...
This diff is collapsed.
Click to expand it.
doc/conf.py.in
+
1
−
1
View file @
11797207
...
@@ -20,7 +20,7 @@ import sys, os
...
@@ -20,7 +20,7 @@ import sys, os
# add these directories to sys.path here. If the directory is relative to the
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, '@LIB_STAGE_PATH@/python@PYTHON_VERSION@/site-packages')
sys.path.insert(0, '@LIB_STAGE_PATH@/python@PYTHON_VERSION@/site-packages')
sys.path.insert(1, '@OST_ROOT@/
lib
/python@PYTHON_VERSION@/site-packages')
sys.path.insert(1, '@OST_ROOT@/
@LIB_DIR@
/python@PYTHON_VERSION@/site-packages')
# -- General configuration -----------------------------------------------------
# -- General configuration -----------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment