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)
...
@@ -26,10 +26,14 @@ option(WITH_DOC "Build documentation" OFF)
option
(
DEBUG
"Build with DEBUG support"
OFF
)
option
(
DEBUG
"Build with DEBUG support"
OFF
)
option
(
WITH_BOOST
"Use Boost libraries instead of GSL"
OFF
)
option
(
WITH_BOOST
"Use Boost libraries instead of GSL"
OFF
)
option
(
WITH_CUDA
"Use CUDA/GPU"
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.
# Required packages.
find_package
(
PythonInterp REQUIRED
)
find_package
(
PythonInterp REQUIRED
)
if
(
PYTHON_VERSION_MAJOR VERSION_EQUAL 3
)
set
(
WITH_GUI OFF
)
endif
(
)
add_custom_target
(
moose ALL
)
add_custom_target
(
moose ALL
)
...
@@ -38,8 +42,10 @@ set(PYMOOSE_SOURCE_DIR "${CMAKE_SOURCE_DIR}/moose-core")
...
@@ -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_BUILD_DIR
${
CMAKE_BINARY_DIR
}
/__moose-core_build
)
set
(
PYMOOSE_INSTALL_DIR
${
CMAKE_BINARY_DIR
}
/__moose-core_install
)
set
(
PYMOOSE_INSTALL_DIR
${
CMAKE_BINARY_DIR
}
/__moose-core_install
)
set
(
MOOSE_GUI_DIR
${
CMAKE_SOURCE_DIR
}
/moose-gui
)
if
(
WITH_GUI
)
set
(
MOOSE_GUI_INSTALL_DIR
${
CMAKE_BINARY_DIR
}
/__moose-gui_install
)
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_DIR
${
CMAKE_SOURCE_DIR
}
/moose-examples
)
set
(
MOOSE_EXAMPLE_INSTALL_DIR
${
CMAKE_BINARY_DIR
}
/__moose-examples_install
)
set
(
MOOSE_EXAMPLE_INSTALL_DIR
${
CMAKE_BINARY_DIR
}
/__moose-examples_install
)
...
@@ -60,23 +66,29 @@ add_custom_command( OUTPUT ${OUTPUT_MOOSEBIN}
...
@@ -60,23 +66,29 @@ add_custom_command( OUTPUT ${OUTPUT_MOOSEBIN}
VERBATIM
VERBATIM
)
)
# Now build moose-gui and moose-examples.
if
(
WITH_GUI
)
# Make sure each script is compilable. Else report an error.
# Now build moose-gui and moose-examples.
add_custom_target
(
gui ALL
# Make sure each script is compilable. Else report an error.
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
MOOSE_GUI_DIR
}
${
MOOSE_GUI_INSTALL_DIR
}
add_custom_target
(
gui ALL
COMMAND
${
PYTHON_EXECUTABLE
}
-m compileall -q
${
MOOSE_GUI_INSTALL_DIR
}
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
MOOSE_GUI_DIR
}
${
MOOSE_GUI_INSTALL_DIR
}
COMMENT
"Building moose-gui"
COMMAND
${
PYTHON_EXECUTABLE
}
-m compileall -q
${
MOOSE_GUI_INSTALL_DIR
}
VERBATIM
COMMENT
"Building moose-gui"
)
VERBATIM
)
add_custom_target
(
examples ALL
add_custom_target
(
examples ALL
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
MOOSE_EXAMPLE_DIR
}
${
MOOSE_EXAMPLE_INSTALL_DIR
}
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
MOOSE_EXAMPLE_DIR
}
${
MOOSE_EXAMPLE_INSTALL_DIR
}
COMMAND
${
PYTHON_EXECUTABLE
}
-m compileall -q
${
MOOSE_EXAMPLE_INSTALL_DIR
}
COMMAND
${
PYTHON_EXECUTABLE
}
-m compileall -q
${
MOOSE_EXAMPLE_INSTALL_DIR
}
VERBATIM
VERBATIM
)
)
endif
()
add_dependencies
(
moose moose-core
)
add_dependencies
(
moose moose-core gui examples
)
if
(
WITH_GUI
)
add_dependencies
(
examples gui
)
add_dependencies
(
moose gui examples
)
add_dependencies
(
examples gui
)
endif
()
## moose-gui
## moose-gui
...
@@ -89,27 +101,30 @@ install(DIRECTORY ${PYMOOSE_INSTALL_DIR}/
...
@@ -89,27 +101,30 @@ install(DIRECTORY ${PYMOOSE_INSTALL_DIR}/
PATTERN
"*.pyc"
EXCLUDE
PATTERN
"*.pyc"
EXCLUDE
)
)
install
(
DIRECTORY
${
MOOSE_GUI_INSTALL_DIR
}
/
if
(
WITH_GUI
)
DESTINATION lib/moose/gui
install
(
DIRECTORY
${
MOOSE_GUI_INSTALL_DIR
}
/
PATTERN
".git*"
EXCLUDE
DESTINATION lib/moose/gui
PATTERN
"*.pyc"
EXCLUDE
PATTERN
".git*"
EXCLUDE
)
PATTERN
"*.pyc"
EXCLUDE
)
install
(
DIRECTORY
${
MOOSE_EXAMPLE_DIR
}
/
DESTINATION lib/moose/moose-examples
install
(
DIRECTORY
${
MOOSE_EXAMPLE_DIR
}
/
PATTERN
".git*"
EXCLUDE
DESTINATION lib/moose/moose-examples
PATTERN
"_travis*"
EXCLUDE
PATTERN
".git*"
EXCLUDE
PATTERN
".travis*"
EXCLUDE
PATTERN
"_travis*"
EXCLUDE
PATTERN
"*.pyc"
EXCLUDE
PATTERN
".travis*"
EXCLUDE
)
PATTERN
"*.pyc"
EXCLUDE
)
endif
()
configure_file
(
${
CMAKE_SOURCE_DIR
}
/cmake/moose.in
${
CMAKE_BINARY_DIR
}
/moose
)
configure_file
(
${
CMAKE_SOURCE_DIR
}
/cmake/moose.in
${
CMAKE_BINARY_DIR
}
/moose
)
install
(
PROGRAMS
${
CMAKE_BINARY_DIR
}
/moose DESTINATION bin
)
install
(
PROGRAMS
${
CMAKE_BINARY_DIR
}
/moose DESTINATION bin
)
## UNINSTALL
## UNINSTALL
add_custom_target
(
uninstall
add_custom_target
(
uninstall DEPENDS __uninstall_moose-core__
)
DEPENDS __uninstall_moose-core__ __uninstall_moose-gui__
if
(
WITH_GUI
)
)
add_dependencies
(
uninstall __uninstall_moose-gui__
)
endif
(
)
add_custom_command
(
OUTPUT __uninstall_moose-core__
add_custom_command
(
OUTPUT __uninstall_moose-core__
COMMAND xargs rm -rf < install_manifest.txt
COMMAND xargs rm -rf < install_manifest.txt
...
@@ -117,11 +132,13 @@ add_custom_command(OUTPUT __uninstall_moose-core__
...
@@ -117,11 +132,13 @@ add_custom_command(OUTPUT __uninstall_moose-core__
COMMAND
${
CMAKE_COMMAND
}
-E remove
${
CMAKE_INSTALL_PREFIX
}
/bin/moose.bin
COMMAND
${
CMAKE_COMMAND
}
-E remove
${
CMAKE_INSTALL_PREFIX
}
/bin/moose.bin
)
)
add_custom_command
(
OUTPUT __uninstall_moose-gui__
if
(
WITH_GUI
)
COMMAND
${
CMAKE_COMMAND
}
-E remove_directory
add_custom_command
(
OUTPUT __uninstall_moose-gui__
${
CMAKE_INSTALL_PREFIX
}
/lib/moose/gui
COMMAND
${
CMAKE_COMMAND
}
-E remove_directory
COMMAND
${
CMAKE_COMMAND
}
-E remove
${
CMAKE_INSTALL_PREFIX
}
/bin/moose
${
CMAKE_INSTALL_PREFIX
}
/lib/moose/gui
)
COMMAND
${
CMAKE_COMMAND
}
-E remove
${
CMAKE_INSTALL_PREFIX
}
/bin/moose
)
endif
()
################################################################################
################################################################################
# CTEST
# CTEST
...
@@ -130,10 +147,13 @@ enable_testing( )
...
@@ -130,10 +147,13 @@ enable_testing( )
add_test
(
NAME test_pymoose_sanity
add_test
(
NAME test_pymoose_sanity
COMMAND
${
PYTHON_EXECUTABLE
}
-c
"import moose"
COMMAND
${
PYTHON_EXECUTABLE
}
-c
"import moose"
)
)
add_test
(
NAME test_gui_sanity
COMMAND
${
PYTHON_EXECUTABLE
}
${
MOOSE_GUI_INSTALL_DIR
}
/mgui.py
if
(
WITH_GUI
)
WORKING_DIRECTORY
${
MOOSE_GUI_INSTALL_DIR
}
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
set_tests_properties
(
test_pymoose_sanity
PROPERTIES ENVIRONMENT
"PYTHONPATH=
${
PYMOOSE_BUILD_DIR
}
/python"
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