CMake biz: Instead of providing elusive prints of missing dependencies for required features and continuing the build configuration, fail fast instead; user can easily disable the feature or fix the paths for the dependency.

This commit is contained in:
Stinkfist0
2015-11-11 13:24:34 +02:00
parent d912e73282
commit 431e993ba3
3 changed files with 18 additions and 24 deletions
+6 -8
View File
@@ -18,8 +18,9 @@
################################################################################
FIND_PACKAGE(SWIG)
IF(SWIG_FOUND)
IF(NOT SWIG_FOUND)
MESSAGE(FATAL_ERROR "BUILD_IFCPYTHON enabled, but unable to find SWIG. Disable BUILD_IFCPYTHON or fix SWIG paths to proceed.")
ENDIF()
INCLUDE(${SWIG_USE_FILE})
@@ -33,8 +34,9 @@ IF(NOT "$ENV{PYTHON_LIBRARY}" STREQUAL "")
ENDIF()
FIND_PACKAGE(PythonLibs)
IF(PYTHONLIBS_FOUND)
IF(NOT PYTHONLIBS_FOUND)
MESSAGE(FATAL_ERROR "BUILD_IFCPYTHON enabled, but unable to find Python. Disable BUILD_IFCPYTHON or fix Python paths to proceed.")
ENDIF()
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
@@ -70,7 +72,3 @@ 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")
ENDIF(PYTHONLIBS_FOUND)
ENDIF(SWIG_FOUND)