Skip to content
Snippets Groups Projects
Commit 684f5183 authored by Dilawar Singh's avatar Dilawar Singh
Browse files

make uninstall still not workinng.

parent f7fc67dc
No related branches found
No related tags found
No related merge requests found
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(moose)
## Default install prefix. When building packages, such as on launchpad, we need
## to modify installation prefix.
if(DEVELOPER)
option(CMAKE_INSTALL_PREFIX "Install prefix" ${CMAKE_BINARY_DIR}/_install)
else()
option(CMAKE_INSTALL_PREFIX "Install prefix" /usr)
endif()
PROJECT(moose-all)
## intialize paths
set(MOOSE_CORE_DIR "${CMAKE_SOURCE_DIR}/moose-core")
set(MOOSE_CORE_BUILD_DIR ${CMAKE_BINARY_DIR}/_build_moose_core)
set(MOOSE_CORE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}")
FILE(MAKE_DIRECTORY ${MOOSE_CORE_BUILD_DIR})
set(DATA_DIR ${CMAKE_SOURCE_DIR}/data)
include(ExternalProject)
message("[INFO] Installtion directory is ${CMAKE_INSTALL_PREFIX}")
ExternalProject_Add( moose-core
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/__moose-core
SOURCE_DIR ${MOOSE_CORE_DIR}
# Extremely useful in packaging
#BINARY_DIR ${MOOSE_CORE_INSTALL_DIR}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
TEST_COMMAND ctest --output-on-failure
TEST_BEFORE_INSTALL 1
BUILD_IN_SOURCE 0
)
add_custom_command(OUTPUT __moose_core_built__
COMMAND ${CMAKE_COMMAND}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DDEBUG=OFF
${MOOSE_CORE_DIR}
COMMAND $(MAKE)
WORKING_DIRECTORY ${MOOSE_CORE_BUILD_DIR}
VERBATIM
)
add_custom_target(moose-all ALL
DEPENDS __moose_core_built__
)
install(CODE
"
execute_process(COMMAND ctest --output-on-failure
WORKING_DIRECTORY ${MOOSE_CORE_BUILD_DIR})
execute_process(COMMAND ${CMAKE_COMMAND} install
WORKING_DIRECTORY ${MOOSE_CORE_BUILD_DIR})
"
)
## moose-gui
## TODO: moose-gui should be a python module.
set(MOOSE_GUI_DIR ${CMAKE_SOURCE_DIR}/moose-gui)
set(MOOSE_GUI_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/moose/gui)
add_custom_target(moose-gui ALL)
add_custom_command(TARGET moose-gui
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${MOOSE_GUI_DIR} ${MOOSE_GUI_INSTALL_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${DATA_DIR}/moosegui ${CMAKE_INSTALL_PREFIX}/bin/
install(DIRECTORY ${MOOSE_GUI_DIR}
PATTERN ".git" EXCLUDE
DESTINATION lib/moose/gui
)
install(PROGRAMS ${DATA_DIR}/moosegui
DESTINATION bin
)
## UNINSTALL
add_custom_target(uninstall
DEPENDS __uninstall_moose-core__ __uninstall_moose-gui__
)
add_custom_command(OUTPUT __uninstall_moose-core__
COMMAND make uninstall
WORKING_DIRECTORY ${MOOSE_CORE_BUILD_DIR}
)
add_custom_command(OUTPUT __uninstall_moose-gui__
COMMAND ${CMAKE_COMMAND} -E remove_directory
${CMAKE_INSTALL_PREFIX}/usr/lib/moose
COMMAND ${CMAKE_COMMAND} -R remove ${CMAKE_INSTALL_PREFIX}/bin/moosegui
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
......@@ -5,11 +5,17 @@ python scripting interface and its GUI.
For more details about these projects, read respective README files.
# Install
~~~~
./boostrap
cmake .
make
sudo make install
~~~~
# Installation using cmake
First, run the `bootstrap` script. It will fetch the submodules and/or update
them. You should have `cmake` installed on your system to build and install
moose from this repository.
cmake .
make
sudo make install
To uninstall moose, do the following in the same directory where you ran
previous `make install` command.
sudo make uninstall
#!/bin/bash
( cd /usr/share/moose/gui && python mgui.py )
( cd /usr/lib/moose/gui && python mgui.py )
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment