2012-01-11 13:57:00 +00:00
|
|
|
FIND_PACKAGE(SWIG)
|
|
|
|
|
|
|
|
|
|
IF(SWIG_FOUND)
|
|
|
|
|
|
2011-05-08 11:04:32 +00:00
|
|
|
INCLUDE(${SWIG_USE_FILE})
|
|
|
|
|
|
2012-01-11 13:57:00 +00:00
|
|
|
FIND_PACKAGE(PythonLibs)
|
|
|
|
|
|
|
|
|
|
IF(PYTHONLIBS_FOUND)
|
|
|
|
|
|
2011-05-08 11:04:32 +00:00
|
|
|
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
|
|
|
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
|
|
|
|
|
SET(CMAKE_SWIG_FLAGS "")
|
|
|
|
|
|
|
|
|
|
SET_SOURCE_FILES_PROPERTIES(IfcPython.i PROPERTIES CPLUSPLUS ON)
|
2015-01-05 14:11:42 +00:00
|
|
|
SWIG_ADD_MODULE(ifcopenshell_wrapper python IfcPython.i)
|
2015-09-13 14:43:42 +02:00
|
|
|
SWIG_LINK_LIBRARIES(ifcopenshell_wrapper ${PYTHON_LIBRARIES} IfcParse IfcGeom TKernel TKMath TKBRep TKGeomBase TKGeomAlgo TKG3d TKG2d TKShHealing TKTopAlgo TKMesh TKPrim TKBool TKBO TKFillet TKOffset ${ICU_LIBRARIES})
|
2012-01-11 13:57:00 +00:00
|
|
|
|
2015-01-05 14:11:42 +00:00
|
|
|
# To install IfcPython let's get the site-packages dir from python
|
|
|
|
|
EXECUTE_PROCESS(COMMAND python -c "import sys; from distutils.sysconfig import get_python_lib; sys.stdout.write(get_python_lib())"
|
2012-01-11 13:57:00 +00:00
|
|
|
OUTPUT_VARIABLE python_package_dir)
|
|
|
|
|
|
|
|
|
|
INSTALL(FILES
|
2015-01-05 14:11:42 +00:00
|
|
|
"${CMAKE_BINARY_DIR}/ifcwrap/ifcopenshell_wrapper.py"
|
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/__init__.py"
|
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/guid.py"
|
|
|
|
|
DESTINATION "${python_package_dir}/ifcopenshell")
|
|
|
|
|
INSTALL(FILES
|
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/geom/__init__.py"
|
|
|
|
|
DESTINATION "${python_package_dir}/ifcopenshell/geom")
|
|
|
|
|
INSTALL(TARGETS _ifcopenshell_wrapper DESTINATION "${python_package_dir}/ifcopenshell")
|
2012-01-11 13:57:00 +00:00
|
|
|
|
|
|
|
|
ENDIF(PYTHONLIBS_FOUND)
|
|
|
|
|
|
|
|
|
|
ENDIF(SWIG_FOUND)
|