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

Use bdist instead of install for creating binay distrution. During installation,

untar this to destination.
parent b09a3ba2
No related branches found
No related tags found
No related merge requests found
......@@ -60,9 +60,10 @@ set(PYMOOSE_SOURCE_DIR "${CMAKE_SOURCE_DIR}/moose-core")
set(PYMOOSE_BUILD_DIR ${CMAKE_BINARY_DIR}/__moose-core_build)
# NOTE: new setuptools does not install python module to this directory unless
# it supports .pth file or PYTHONPATH points to it. Make sure when moose-core is
# installing into user_specified path, set PYTHONPATH to this directory.
# installing into user_specified path, set PYTHONPATH to this directory. We now
# create a bdist to this directory.
set(PYMOOSE_INSTALL_DIR ${CMAKE_BINARY_DIR}/__moose-core_install)
set(PYMOOSE_BDIST_DIR ${PYMOOSE_BUILD_DIR}/)
if(WITH_GUI)
set(MOOSE_GUI_DIR ${CMAKE_SOURCE_DIR}/moose-gui)
......
......@@ -11,20 +11,18 @@ if [ -z "$MAKE" ]; then
MAKE=make
fi
echo "Building MOOSE"
(
export GSL_ROOT_DIR=@GSL_ROOT_DIR@
export HDF5_ROOT=@HDF5_ROOT@
cd @PYMOOSE_BUILD_DIR@
cmake -DCMAKE_INSTALL_PREFIX=@PYMOOSE_INSTALL_DIR@ \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_BOOST=@WITH_BOOST@ \
-DPYTHON_EXECUTABLE=@PYTHON_EXECUTABLE@ \
-DVERSION_MOOSE=@MOOSE_VERSION@ \
@CMAKE_PYMOOSE_ARGS@ \
@PYMOOSE_SOURCE_DIR@
$MAKE
ctest -output-on-failure || echo "Some tests failed"
$MAKE install
)
echo "Building pymoose and creating bdist."
export GSL_ROOT_DIR=@GSL_ROOT_DIR@
export HDF5_ROOT=@HDF5_ROOT@
cd @PYMOOSE_BUILD_DIR@
cmake -DCMAKE_INSTALL_PREFIX=@PYMOOSE_INSTALL_DIR@ \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_BOOST=@WITH_BOOST@ \
-DPYTHON_EXECUTABLE=@PYTHON_EXECUTABLE@ \
-DVERSION_MOOSE=@MOOSE_VERSION@ \
-DPYMOOSE_BDIST_DIR=@PYMOOSE_BDIST_DIR@ \
@CMAKE_PYMOOSE_ARGS@ \
@PYMOOSE_SOURCE_DIR@
$MAKE
ctest --output-on-failure || echo "Some tests failed"
$MAKE bdist
......@@ -393,6 +393,7 @@ endif()
######################### BUILD PYMOOSE ########################################
add_subdirectory( pymoose )
######################### INSTALL ##############################################
if(DEBUG)
......@@ -449,6 +450,22 @@ if(${CMAKE_BUILD_TOOL} MATCHES "make")
)
endif()
# Target for creating bdist. This is handy for creating bdist for packaging.
# Save the binary distribution (tar.gz) to PYMOOSE_BDIST_DIR. Note that this
# target is only useful when creating packages on Open Build Service i.e. if you
# use this target on distribution X, it may not work on distrbutions other than
# X. See python-wheels for making portable distributions.
if(NOT PYMOOSE_BDIST_DIR)
set(PYMOOSE_BDIST_DIR ${CMAKE_BINARY_DIR}/pymoose_bdist)
endif( )
add_custom_target( bdist
DEPENDS pymoose
COMMAND ${PYTHON_EXECUTABLE} setup.cmake.py bdist -d ${PYMOOSE_BDIST_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/python
COMMENT "Genearating bdist using setup.cmake.py."
VERBATIM
)
############################ CTEST ######################################
include( CTest )
......
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