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) CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(moose) PROJECT(moose-all)
## 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()
## intialize paths ## intialize paths
set(MOOSE_CORE_DIR "${CMAKE_SOURCE_DIR}/moose-core") set(MOOSE_CORE_DIR "${CMAKE_SOURCE_DIR}/moose-core")
set(MOOSE_CORE_BUILD_DIR ${CMAKE_BINARY_DIR}/_build_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) set(DATA_DIR ${CMAKE_SOURCE_DIR}/data)
include(ExternalProject) add_custom_command(OUTPUT __moose_core_built__
message("[INFO] Installtion directory is ${CMAKE_INSTALL_PREFIX}") COMMAND ${CMAKE_COMMAND}
ExternalProject_Add( moose-core -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/__moose-core -DDEBUG=OFF
SOURCE_DIR ${MOOSE_CORE_DIR} ${MOOSE_CORE_DIR}
# Extremely useful in packaging COMMAND $(MAKE)
#BINARY_DIR ${MOOSE_CORE_INSTALL_DIR} WORKING_DIRECTORY ${MOOSE_CORE_BUILD_DIR}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} VERBATIM
TEST_COMMAND ctest --output-on-failure )
TEST_BEFORE_INSTALL 1
BUILD_IN_SOURCE 0 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 ## moose-gui
## TODO: moose-gui should be a python module. ## TODO: moose-gui should be a python module.
set(MOOSE_GUI_DIR ${CMAKE_SOURCE_DIR}/moose-gui) 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) install(DIRECTORY ${MOOSE_GUI_DIR}
add_custom_command(TARGET moose-gui PATTERN ".git" EXCLUDE
POST_BUILD DESTINATION lib/moose/gui
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(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. ...@@ -5,11 +5,17 @@ python scripting interface and its GUI.
For more details about these projects, read respective README files. For more details about these projects, read respective README files.
# Install # Installation using cmake
~~~~ First, run the `bootstrap` script. It will fetch the submodules and/or update
./boostrap them. You should have `cmake` installed on your system to build and install
cmake . moose from this repository.
make
sudo make install 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 #!/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