Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
MostafaMollaali
dynamic
Commits
704adf47
Commit
704adf47
authored
6 years ago
by
Christoph Lehmann
Browse files
Options
Downloads
Patches
Plain Diff
[AppL] improved parsing and restructured CMakeLists
parent
ca86963e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Applications/ApplicationsLib/CMakeLists.txt
+4
-4
4 additions, 4 deletions
Applications/ApplicationsLib/CMakeLists.txt
Applications/ApplicationsLib/ProjectData.cpp
+6
-4
6 additions, 4 deletions
Applications/ApplicationsLib/ProjectData.cpp
with
10 additions
and
8 deletions
Applications/ApplicationsLib/CMakeLists.txt
+
4
−
4
View file @
704adf47
...
@@ -10,10 +10,6 @@ target_link_libraries(ApplicationsLib
...
@@ -10,10 +10,6 @@ target_link_libraries(ApplicationsLib
PRIVATE MathLib MeshLib MeshGeoToolsLib NumLib
PRIVATE MathLib MeshLib MeshGeoToolsLib NumLib
)
)
if
(
OGS_USE_PYTHON
)
target_include_directories
(
ApplicationsLib PRIVATE
${
PYTHON_INCLUDE_DIRS
}
)
endif
()
# Set cpp definitions if the cmake option is enabled for the given process.
# Set cpp definitions if the cmake option is enabled for the given process.
foreach
(
process
${
ProcessesList
}
)
foreach
(
process
${
ProcessesList
}
)
if
(
OGS_BUILD_PROCESS_
${
process
}
)
if
(
OGS_BUILD_PROCESS_
${
process
}
)
...
@@ -26,3 +22,7 @@ endforeach()
...
@@ -26,3 +22,7 @@ endforeach()
if
(
OGS_USE_PCH
)
if
(
OGS_USE_PCH
)
cotire
(
ApplicationsLib
)
cotire
(
ApplicationsLib
)
endif
()
endif
()
if
(
OGS_USE_PYTHON
)
target_link_libraries
(
ApplicationsLib PRIVATE pybind11::pybind11
)
endif
()
This diff is collapsed.
Click to expand it.
Applications/ApplicationsLib/ProjectData.cpp
+
6
−
4
View file @
704adf47
...
@@ -166,11 +166,11 @@ ProjectData::ProjectData(BaseLib::ConfigTree const& project_config,
...
@@ -166,11 +166,11 @@ ProjectData::ProjectData(BaseLib::ConfigTree const& project_config,
{
{
_mesh_vec
=
readMeshes
(
project_config
,
project_directory
);
_mesh_vec
=
readMeshes
(
project_config
,
project_directory
);
#ifdef OGS_USE_PYTHON
if
(
auto
const
python_script
=
if
(
auto
const
python_script
=
project_config
.
getConfigParameterOptional
<
std
::
string
>
(
//! \ogs_file_param{prj__python_script}
"python_script"
))
project_config
.
getConfigParameterOptional
<
std
::
string
>
(
"python_script"
))
{
{
#ifdef OGS_USE_PYTHON
namespace
py
=
pybind11
;
namespace
py
=
pybind11
;
auto
const
script_path
=
auto
const
script_path
=
BaseLib
::
copyPathToFileName
(
*
python_script
,
project_directory
);
BaseLib
::
copyPathToFileName
(
*
python_script
,
project_directory
);
...
@@ -178,8 +178,10 @@ ProjectData::ProjectData(BaseLib::ConfigTree const& project_config,
...
@@ -178,8 +178,10 @@ ProjectData::ProjectData(BaseLib::ConfigTree const& project_config,
// Evaluate in scope of main module
// Evaluate in scope of main module
py
::
object
scope
=
py
::
module
::
import
(
"__main__"
).
attr
(
"__dict__"
);
py
::
object
scope
=
py
::
module
::
import
(
"__main__"
).
attr
(
"__dict__"
);
py
::
eval_file
(
script_path
,
scope
);
py
::
eval_file
(
script_path
,
scope
);
}
#else
OGS_FATAL
(
"OpenGeoSys has not been built with Python support."
);
#endif // OGS_USE_PYTHON
#endif // OGS_USE_PYTHON
}
//! \ogs_file_param{prj__curves}
//! \ogs_file_param{prj__curves}
parseCurves
(
project_config
.
getConfigSubtreeOptional
(
"curves"
));
parseCurves
(
project_config
.
getConfigSubtreeOptional
(
"curves"
));
...
...
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