diff --git a/Tests/Functional/PyExamples/CMakeLists.txt b/Tests/Functional/PyExamples/CMakeLists.txt
index 47adecd1063cbbf54fc3844bf67c80c4f2a758b8..544621328461e4d4a5408b838292ceca532929a0 100644
--- a/Tests/Functional/PyExamples/CMakeLists.txt
+++ b/Tests/Functional/PyExamples/CMakeLists.txt
@@ -6,12 +6,13 @@
 #
 ###############################################################################
 
-add_custom_target(TempQtCreatorTarget SOURCES check_functionality.py)
-
+# add_custom_target(TempQtCreatorTarget SOURCES check_functionality.py)
 
 file(GLOB examples "${PY_EXAMPLES_DIR}/simulation/ex*/*.py")
 
-set(test_script ${CMAKE_SOURCE_DIR}/Tests/Functional/PyExamples/check_functionality.py)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/check_functionality.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/check_functionality.py @ONLY)
+
+set(test_script ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/check_functionality.py)
 foreach(example ${examples})
     set(script_path ${example})
 
@@ -21,4 +22,3 @@ foreach(example ${examples})
     add_test(${test_name} ${PYTHON_EXECUTABLE} ${test_script} ${script_path})
     set_tests_properties(${test_name} PROPERTIES LABELS "Examples")
 endforeach()
-
diff --git a/Tests/Functional/PyExamples/check_functionality.py b/Tests/Functional/PyExamples/check_functionality.py
index 7098ecbbb708d28b0826ab2f75c4c4209580cf03..dc7e6460d584477f0ca736d53f419f85a87b465a 100644
--- a/Tests/Functional/PyExamples/check_functionality.py
+++ b/Tests/Functional/PyExamples/check_functionality.py
@@ -13,6 +13,7 @@ import matplotlib
 matplotlib.use('Agg')
 from matplotlib import pyplot as plt
 
+sys.path.append("@CMAKE_LIBRARY_OUTPUT_DIRECTORY@")
 
 def get_figure(filename):
     """