Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moose
Manage
Activity
Members
Labels
Plan
Issues
9
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sahil Moza
moose
Commits
7f1a95fd
Commit
7f1a95fd
authored
7 years ago
by
Dilawar Singh
Browse files
Options
Downloads
Patches
Plain Diff
GUI is optional.
parent
fb3b567a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMakeLists.txt
+63
-43
63 additions, 43 deletions
CMakeLists.txt
with
63 additions
and
43 deletions
CMakeLists.txt
+
63
−
43
View file @
7f1a95fd
...
...
@@ -26,10 +26,14 @@ option(WITH_DOC "Build documentation" OFF)
option
(
DEBUG
"Build with DEBUG support"
OFF
)
option
(
WITH_BOOST
"Use Boost libraries instead of GSL"
OFF
)
option
(
WITH_CUDA
"Use CUDA/GPU"
OFF
)
option
(
WITH_MPI
"Use MPI"
OFF
)
option
(
WITH_MPI
"Use MPI (experimental)"
OFF
)
option
(
WITH_GUI
"Install moose-gui. Works only with python2."
ON
)
# Required packages.
find_package
(
PythonInterp REQUIRED
)
if
(
PYTHON_VERSION_MAJOR VERSION_EQUAL 3
)
set
(
WITH_GUI OFF
)
endif
(
)
add_custom_target
(
moose ALL
)
...
...
@@ -38,8 +42,10 @@ set(PYMOOSE_SOURCE_DIR "${CMAKE_SOURCE_DIR}/moose-core")
set
(
PYMOOSE_BUILD_DIR
${
CMAKE_BINARY_DIR
}
/__moose-core_build
)
set
(
PYMOOSE_INSTALL_DIR
${
CMAKE_BINARY_DIR
}
/__moose-core_install
)
set
(
MOOSE_GUI_DIR
${
CMAKE_SOURCE_DIR
}
/moose-gui
)
set
(
MOOSE_GUI_INSTALL_DIR
${
CMAKE_BINARY_DIR
}
/__moose-gui_install
)
if
(
WITH_GUI
)
set
(
MOOSE_GUI_DIR
${
CMAKE_SOURCE_DIR
}
/moose-gui
)
set
(
MOOSE_GUI_INSTALL_DIR
${
CMAKE_BINARY_DIR
}
/__moose-gui_install
)
endif
()
set
(
MOOSE_EXAMPLE_DIR
${
CMAKE_SOURCE_DIR
}
/moose-examples
)
set
(
MOOSE_EXAMPLE_INSTALL_DIR
${
CMAKE_BINARY_DIR
}
/__moose-examples_install
)
...
...
@@ -60,23 +66,29 @@ add_custom_command( OUTPUT ${OUTPUT_MOOSEBIN}
VERBATIM
)
# Now build moose-gui and moose-examples.
# Make sure each script is compilable. Else report an error.
add_custom_target
(
gui ALL
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
MOOSE_GUI_DIR
}
${
MOOSE_GUI_INSTALL_DIR
}
COMMAND
${
PYTHON_EXECUTABLE
}
-m compileall -q
${
MOOSE_GUI_INSTALL_DIR
}
COMMENT
"Building moose-gui"
VERBATIM
)
if
(
WITH_GUI
)
# Now build moose-gui and moose-examples.
# Make sure each script is compilable. Else report an error.
add_custom_target
(
gui ALL
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
MOOSE_GUI_DIR
}
${
MOOSE_GUI_INSTALL_DIR
}
COMMAND
${
PYTHON_EXECUTABLE
}
-m compileall -q
${
MOOSE_GUI_INSTALL_DIR
}
COMMENT
"Building moose-gui"
VERBATIM
)
add_custom_target
(
examples ALL
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
MOOSE_EXAMPLE_DIR
}
${
MOOSE_EXAMPLE_INSTALL_DIR
}
COMMAND
${
PYTHON_EXECUTABLE
}
-m compileall -q
${
MOOSE_EXAMPLE_INSTALL_DIR
}
VERBATIM
)
add_custom_target
(
examples ALL
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
MOOSE_EXAMPLE_DIR
}
${
MOOSE_EXAMPLE_INSTALL_DIR
}
COMMAND
${
PYTHON_EXECUTABLE
}
-m compileall -q
${
MOOSE_EXAMPLE_INSTALL_DIR
}
VERBATIM
)
endif
()
add_dependencies
(
moose moose-core
)
add_dependencies
(
moose moose-core gui examples
)
add_dependencies
(
examples gui
)
if
(
WITH_GUI
)
add_dependencies
(
moose gui examples
)
add_dependencies
(
examples gui
)
endif
()
## moose-gui
...
...
@@ -89,27 +101,30 @@ install(DIRECTORY ${PYMOOSE_INSTALL_DIR}/
PATTERN
"*.pyc"
EXCLUDE
)
install
(
DIRECTORY
${
MOOSE_GUI_INSTALL_DIR
}
/
DESTINATION lib/moose/gui
PATTERN
".git*"
EXCLUDE
PATTERN
"*.pyc"
EXCLUDE
)
install
(
DIRECTORY
${
MOOSE_EXAMPLE_DIR
}
/
DESTINATION lib/moose/moose-examples
PATTERN
".git*"
EXCLUDE
PATTERN
"_travis*"
EXCLUDE
PATTERN
".travis*"
EXCLUDE
PATTERN
"*.pyc"
EXCLUDE
)
if
(
WITH_GUI
)
install
(
DIRECTORY
${
MOOSE_GUI_INSTALL_DIR
}
/
DESTINATION lib/moose/gui
PATTERN
".git*"
EXCLUDE
PATTERN
"*.pyc"
EXCLUDE
)
install
(
DIRECTORY
${
MOOSE_EXAMPLE_DIR
}
/
DESTINATION lib/moose/moose-examples
PATTERN
".git*"
EXCLUDE
PATTERN
"_travis*"
EXCLUDE
PATTERN
".travis*"
EXCLUDE
PATTERN
"*.pyc"
EXCLUDE
)
endif
()
configure_file
(
${
CMAKE_SOURCE_DIR
}
/cmake/moose.in
${
CMAKE_BINARY_DIR
}
/moose
)
install
(
PROGRAMS
${
CMAKE_BINARY_DIR
}
/moose DESTINATION bin
)
## UNINSTALL
add_custom_target
(
uninstall
DEPENDS __uninstall_moose-core__ __uninstall_moose-gui__
)
add_custom_target
(
uninstall DEPENDS __uninstall_moose-core__
)
if
(
WITH_GUI
)
add_dependencies
(
uninstall __uninstall_moose-gui__
)
endif
(
)
add_custom_command
(
OUTPUT __uninstall_moose-core__
COMMAND xargs rm -rf < install_manifest.txt
...
...
@@ -117,11 +132,13 @@ add_custom_command(OUTPUT __uninstall_moose-core__
COMMAND
${
CMAKE_COMMAND
}
-E remove
${
CMAKE_INSTALL_PREFIX
}
/bin/moose.bin
)
add_custom_command
(
OUTPUT __uninstall_moose-gui__
COMMAND
${
CMAKE_COMMAND
}
-E remove_directory
${
CMAKE_INSTALL_PREFIX
}
/lib/moose/gui
COMMAND
${
CMAKE_COMMAND
}
-E remove
${
CMAKE_INSTALL_PREFIX
}
/bin/moose
)
if
(
WITH_GUI
)
add_custom_command
(
OUTPUT __uninstall_moose-gui__
COMMAND
${
CMAKE_COMMAND
}
-E remove_directory
${
CMAKE_INSTALL_PREFIX
}
/lib/moose/gui
COMMAND
${
CMAKE_COMMAND
}
-E remove
${
CMAKE_INSTALL_PREFIX
}
/bin/moose
)
endif
()
################################################################################
# CTEST
...
...
@@ -130,10 +147,13 @@ enable_testing( )
add_test
(
NAME test_pymoose_sanity
COMMAND
${
PYTHON_EXECUTABLE
}
-c
"import moose"
)
add_test
(
NAME test_gui_sanity
COMMAND
${
PYTHON_EXECUTABLE
}
${
MOOSE_GUI_INSTALL_DIR
}
/mgui.py
WORKING_DIRECTORY
${
MOOSE_GUI_INSTALL_DIR
}
)
if
(
WITH_GUI
)
add_test
(
NAME test_gui_sanity
COMMAND
${
PYTHON_EXECUTABLE
}
${
MOOSE_GUI_INSTALL_DIR
}
/mgui.py
WORKING_DIRECTORY
${
MOOSE_GUI_INSTALL_DIR
}
)
endif
()
set_tests_properties
(
test_pymoose_sanity
PROPERTIES ENVIRONMENT
"PYTHONPATH=
${
PYMOOSE_BUILD_DIR
}
/python"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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