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

Tweaks to setup.cmake.py file.

parent 168cec89
No related branches found
No related tags found
No related merge requests found
......@@ -58,6 +58,10 @@ add_custom_target(moose ALL)
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.
set(PYMOOSE_INSTALL_DIR ${CMAKE_BINARY_DIR}/__moose-core_install)
if(WITH_GUI)
......@@ -105,8 +109,8 @@ if(WITH_GUI)
endif()
## moose-gui
## TODO: moose-gui should be a python module.
# moose-gui
# TODO: moose-gui should be a python module.
set(MOOSE_GUI_DIR ${CMAKE_SOURCE_DIR}/moose-gui)
install(DIRECTORY ${PYMOOSE_INSTALL_DIR}/
......
......@@ -434,7 +434,7 @@ endif( )
# --user to install in user home.
install(CODE
"execute_process(
COMMAND ${PYTHON_EXECUTABLE} setup.cmake.py install ${EXTRA_ARGS} ${PYMOOSE_EXTRA_INSTALL_ARGS}
COMMAND ${PYTHON_EXECUTABLE} setup.cmake.py install -f ${EXTRA_ARGS} ${PYMOOSE_EXTRA_INSTALL_ARGS}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/python
)"
)
......
# -*- coding: utf-8 -*-
"""setup.py:
Script to install python targets.
"""
setup.cmake.py:
NOTE: This script is to be called by CMake. Not intended to be used standalone.
Script to install python targets by cmake.
DO NOT USE IT DIRECTLY. Only `cmake` build system should use it directly.
"""
__author__ = "Dilawar Singh"
......@@ -20,33 +21,32 @@ import os
import sys
try:
from setuptools import setup
from setuptools import setup
except Exception as e:
from distutils.core import setup
from distutils.core import setup
script_dir = os.path.dirname( os.path.abspath( __file__ ) )
version = '3.2pre1'
version = '3.2.0-git'
try:
with open( os.path.join( script_dir, 'VERSION'), 'r' ) as f:
version = f.read( )
except Exception as e:
print( 'Failed to read VERSION %s' % e )
print( 'Failed to read VERSION from file due to: %s' % e )
print( 'Using default %s' % version )
try:
import importlib.machinery
suffix = importlib.machinery.EXTENSION_SUFFIXES[0]
except Exception as e:
print( '[WARN] Failed to determine importlib suffix' )
print( '[WARN] Failed to determine importlib suffix due to %s' % e )
suffix = '.so'
setup(
name='pymoose',
version=version,
description='Python scripting interface of MOOSE Simulator (https://moose.ncbs.res.in)',
author='MOOSERes',
author='See AUTHORS.md at https://github.com/BhallaLab/moose',
author_email='bhalla@ncbs.res.in',
maintainer='Dilawar Singh',
maintainer_email='dilawars@ncbs.res.in',
......@@ -61,9 +61,11 @@ setup(
, 'moose.chemUtil'
, 'moose.chemMerge'
],
install_requires = [ 'python-libsbml', 'numpy' ],
install_requires = [ 'python-libsbml', 'numpy' ],
package_dir = {
'moose' : 'moose', 'rdesigneur' : 'rdesigneur'
},
package_data = { 'moose' : ['_moose' + suffix, 'neuroml2/schema/NeuroMLCoreDimensions.xml'] },
)
package_data = {
'moose' : ['_moose' + suffix, 'neuroml2/schema/NeuroMLCoreDimensions.xml']
},
)
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