forked from IfcOpenShell/IfcOpenShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
39 lines (25 loc) · 1.24 KB
/
CMakeLists.txt
File metadata and controls
39 lines (25 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FIND_PACKAGE(SWIG)
IF(SWIG_FOUND)
INCLUDE(${SWIG_USE_FILE})
FIND_PACKAGE(PythonLibs)
IF(PYTHONLIBS_FOUND)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
SET(CMAKE_SWIG_FLAGS "")
SET_SOURCE_FILES_PROPERTIES(IfcPython.i PROPERTIES CPLUSPLUS ON)
SWIG_ADD_MODULE(ifc_wrapper python IfcPython.i)
SWIG_LINK_LIBRARIES(ifc_wrapper ${PYTHON_LIBRARIES} IfcParse IfcGeom TKernel TKMath TKBRep TKGeomBase TKGeomAlgo TKG3d TKG2d TKShHealing TKTopAlgo TKMesh TKPrim TKBool TKBO TKFillet TKOffset)
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/ifcopenshell.py" DESTINATION "${CMAKE_BINARY_DIR}/ifcwrap")
# To install IfcPython let's get the site-packackes dir from python
EXECUTE_PROCESS(COMMAND python -c "from distutils.sysconfig import get_python_lib as x; print (x())"
OUTPUT_VARIABLE python_package_dir)
# Strip trailing whitespace from python print
STRING(REPLACE "\r" "" python_package_dir "${python_package_dir}")
STRING(REPLACE "\n" "" python_package_dir "${python_package_dir}")
INSTALL(FILES
"${CMAKE_BINARY_DIR}/ifcwrap/ifcopenshell.py"
"${CMAKE_BINARY_DIR}/ifcwrap/ifc_wrapper.py"
"${CMAKE_BINARY_DIR}/ifcwrap/_ifc_wrapper.so"
DESTINATION "${python_package_dir}")
ENDIF(PYTHONLIBS_FOUND)
ENDIF(SWIG_FOUND)