compilation of python extension

This commit is contained in:
Christophe Alexandre 2008-04-23 13:47:52 +00:00
parent 3c29aeb489
commit ebe8b9bb13
2 changed files with 50 additions and 13 deletions

View File

@ -24,20 +24,14 @@ SET(includes ProxyProperty.h PyBox.h PyCell.h PyCellLocator.h
)
ADD_LIBRARY(isobar SHARED ${sources})
TARGET_LINK_LIBRARIES(isobar hurricane ${PYTHON_LIBRARIES})
SET(source_dir ${HURRICANE_SOURCE_DIR}/src/pyext)
SET(binary_dir ${HURRICANE_BINARY_DIR}/src/pyext)
SET(include_dirs ${HURRICANE_SOURCE_DIR}/src/hurricane)
SET(library_dirs ${HURRICANE_BINARY_DIR}/src/hurricane:${binary_dir})
CONFIGURE_FILE(PyExtensionBuild.conf.in ${binary_dir}/PyExtensionBuild.conf)
ADD_CUSTOM_COMMAND(TARGET isobar POST_BUILD
COMMAND cp ${source_dir}/setup.py ${binary_dir}/setup.py
COMMAND ${PYTHON_EXECUTABLE} ${binary_dir}/setup.py build
--build-base=${binary_dir}
DEPENDS ${binary_dir}/PyExtensionBuild.conf)
ADD_LIBRARY(Hurricane MODULE ${sources})
SET_TARGET_PROPERTIES(Hurricane
PROPERTIES
COMPILE_FLAGS "${COMPILE_FLAGS} -D__PYTHON_MODULE__=1"
PREFIX ""
)
TARGET_LINK_LIBRARIES(Hurricane isobar hurricane ${PYTHON_LIBRARIES})
INSTALL(TARGETS isobar DESTINATION /lib)

View File

@ -0,0 +1,43 @@
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH} ${HURRICANE_SOURCE_DIR}/src/hurricane)
SET(sources ProxyProperty.cpp PyBox.cpp PyCell.cpp PyCellLocator.cpp
PyComponent.cpp PyComponentLocator.cpp PyContact.cpp
PyDataBase.cpp PyEntity.cpp PyHorizontal.cpp
PyHurricane.cpp PyHyperNet.cpp PyInstance.cpp PyInstanceLocator.cpp
PyLayer.cpp PyLibrary.cpp PyName.cpp PyNet.cpp PyNetLocator.cpp
PyOccurrence.cpp PyOccurrenceLocator.cpp PyPath.cpp PyPin.cpp PyPinLocator.cpp
PyPlug.cpp PyPlugLocator.cpp PyPoint.cpp PyReference.cpp PyReferenceLocator.cpp
PySegment.cpp PySegmentLocator.cpp PyTechnology.cpp PyTransformation.cpp
PyUnit.cpp PyUpdateSession.cpp PyVertical.cpp
)
SET(includes ProxyProperty.h PyBox.h PyCell.h PyCellLocator.h
PyComponent.h PyComponentLocator.h PyContact.h
PyDataBase.h PyEntity.h PyHorizontal.h
PyHurricane.h PyHyperNet.h PyInstance.h PyInstanceLocator.h
PyLayer.h PyLibrary.h PyName.h PyNet.h PyNetLocator.h
PyOccurrence.h PyOccurrenceLocator.h PyPath.h PyPin.h PyPinLocator.h
PyPlug.h PyPlugLocator.h PyPoint.h PyReference.h PyReferenceLocator.h
PySegment.h PySegmentLocator.h PyTechnology.h PyTransformation.h
PyUnit.h PyUpdateSession.h PyVertical.h
)
ADD_LIBRARY(isobar SHARED ${sources})
TARGET_LINK_LIBRARIES(isobar hurricane ${PYTHON_LIBRARIES})
SET(source_dir ${HURRICANE_SOURCE_DIR}/src/pyext)
SET(binary_dir ${HURRICANE_BINARY_DIR}/src/pyext)
SET(include_dirs ${HURRICANE_SOURCE_DIR}/src/hurricane)
SET(library_dirs ${HURRICANE_BINARY_DIR}/src/hurricane:${binary_dir})
CONFIGURE_FILE(PyExtensionBuild.conf.in ${binary_dir}/PyExtensionBuild.conf)
ADD_CUSTOM_COMMAND(TARGET isobar POST_BUILD
COMMAND cp ${source_dir}/setup.py ${binary_dir}/setup.py
COMMAND ${PYTHON_EXECUTABLE} ${binary_dir}/setup.py build
--build-base=${binary_dir}
DEPENDS ${binary_dir}/PyExtensionBuild.conf)
INSTALL(TARGETS isobar DESTINATION /lib)