Install python module files using glob

This commit is contained in:
Thomas Krijnen
2019-04-05 11:18:22 +02:00
parent 8a197a6305
commit f0fa9ca736
+11 -22
View File
@@ -78,28 +78,17 @@ IF(PYTHONINTERP_FOUND AND NOT "${PYTHON_EXECUTABLE}" STREQUAL "")
IF("${python_package_dir}" STREQUAL "") IF("${python_package_dir}" STREQUAL "")
MESSAGE(WARNING "Unable to locate Python site-package directory, unable to install the Python wrapper") MESSAGE(WARNING "Unable to locate Python site-package directory, unable to install the Python wrapper")
ELSE() ELSE()
INSTALL(FILES FILE(GLOB_RECURSE sourcefiles "${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/*.py")
"${CMAKE_BINARY_DIR}/ifcwrap/ifcopenshell_wrapper.py" FOREACH(file ${sourcefiles})
"${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/__init__.py" FILE(RELATIVE_PATH relative "${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/" "${file}")
"${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/entity_instance.py" GET_FILENAME_COMPONENT(dir "${relative}" DIRECTORY)
"${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/file.py" INSTALL(FILES "${file}"
"${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/guid.py" DESTINATION "${python_package_dir}/ifcopenshell/${dir}")
"${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/main.py" ENDFOREACH()
"${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/template.py" INSTALL(FILES "${CMAKE_BINARY_DIR}/ifcwrap/ifcopenshell_wrapper.py"
DESTINATION "${python_package_dir}/ifcopenshell") DESTINATION "${python_package_dir}/ifcopenshell")
INSTALL(FILES INSTALL(TARGETS _ifcopenshell_wrapper
"${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/geom/__init__.py" DESTINATION "${python_package_dir}/ifcopenshell")
"${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/geom/app.py"
"${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/geom/code_editor_pane.py"
"${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/geom/main.py"
"${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/geom/occ_utils.py"
DESTINATION "${python_package_dir}/ifcopenshell/geom")
INSTALL(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/mvd/__init__.py"
"${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/mvd/sparql.py"
"${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/mvd/mvdxml_expression.py"
DESTINATION "${python_package_dir}/ifcopenshell/mvd")
INSTALL(TARGETS _ifcopenshell_wrapper DESTINATION "${python_package_dir}/ifcopenshell")
ENDIF() ENDIF()
ELSE() ELSE()
MESSAGE(WARNING "No Python interpreter found, unable to install the Python wrapper") MESSAGE(WARNING "No Python interpreter found, unable to install the Python wrapper")