diff --git a/CMakeLists.txt b/CMakeLists.txt
index ff1dcc2e5fdc6565fa4ee8861dd28ec171545c46..3edc19ad8d20f260308c39e2b555f0aade883e89 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,6 +20,7 @@ option(BORNAGAIN_APPLE_BUNDLE "Create a Mac OS X bundle" OFF)
 option(BORNAGAIN_OPENMPI "Build with OpenMPI support" OFF)
 option(BORNAGAIN_RELEASE "Special option for making release" OFF)
 option(BORNAGAIN_CRASHHADLER "Additional machinery to send crash reports" OFF)
+option(BORNAGAIN_TIFF_SUPPORT "Tiff files read/write support" ON)
 
 #--- Including macros ---
 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
@@ -36,14 +37,9 @@ if(BORNAGAIN_MANPAGE)
     add_subdirectory(man)
 endif()
 
-if(NOT TIFF_FOUND)
-add_subdirectory(ThirdParty/libtiff)
-endif()
+add_subdirectory(ThirdParty)
 add_subdirectory(Core)
-add_subdirectory(ThirdParty/gtest)
-
 add_subdirectory(Tests/UnitTests/TestCore)
-add_subdirectory(ThirdParty/RootMinimizers)
 add_subdirectory(Fit)
 add_subdirectory(Tests/UnitTests/TestFit)
 
diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt
index c0afbd354840d6efb841196b4e5dd1d1726c8ff2..264d549066f8a18e4341d6583dc2e5a19225a1d2 100644
--- a/Core/CMakeLists.txt
+++ b/Core/CMakeLists.txt
@@ -66,6 +66,9 @@ if(BORNAGAIN_OPENMPI)
     add_definitions(-DBORNAGAIN_OPENMPI)
 endif()
 
+if(BORNAGAIN_TIFF_SUPPORT)
+    add_definitions(-DBORNAGAIN_TIFF_SUPPORT)
+endif()
 
 # --- making library ---------
 add_library(
@@ -96,8 +99,6 @@ target_link_libraries(
     ${TIFF_LIBRARIES}
 )
 
-message(INFO "XXX lib ${TIFF_LIBRARIES} include ${TIFF_INCLUDE_DIR}")
-
 if(BORNAGAIN_OPENMPI)
     include_directories(${MPI_INCLUDE_PATH})
     target_link_libraries(${library_name} ${MPI_LIBRARIES})
diff --git a/Core/InputOutput/OutputDataReadFactory.cpp b/Core/InputOutput/OutputDataReadFactory.cpp
index 085f7c7b340e1a023fc4dd229d6b42f4a89193da..0d4e7c97d11979b8252b9c8bd8d1bd9d1cf6cd35 100644
--- a/Core/InputOutput/OutputDataReadFactory.cpp
+++ b/Core/InputOutput/OutputDataReadFactory.cpp
@@ -36,10 +36,13 @@ IOutputDataReadStrategy *OutputDataReadFactory::getReadStrategy(const std::strin
         result = new OutputDataReadINTStrategy();
     }
 
+#ifdef BORNAGAIN_TIFF_SUPPORT
     else if(OutputDataIOHelper::isTiffFile(file_name)) {
        result = new OutputDataReadTiffStrategy();
     }
 
+#endif // BORNAGAIN_TIFF_SUPPORT
+
     else {
         throw LogicErrorException("OutputDataReadFactory::getReader() -> Error. "
                 "Don't know how to read file '" + file_name+std::string("'"));
diff --git a/Core/InputOutput/OutputDataReadStrategy.cpp b/Core/InputOutput/OutputDataReadStrategy.cpp
index ce1543a6b3197bdf98259f72f1b8e7205022960a..8f318df0b3bb470f41bc15d516afbd37cb2aa044 100644
--- a/Core/InputOutput/OutputDataReadStrategy.cpp
+++ b/Core/InputOutput/OutputDataReadStrategy.cpp
@@ -47,6 +47,7 @@ OutputData<double > *OutputDataReadINTStrategy::readOutputData(std::istream &inp
 
 // ----------------------------------------------------------------------------
 
+#ifdef BORNAGAIN_TIFF_SUPPORT
 OutputDataReadTiffStrategy::OutputDataReadTiffStrategy()
     : m_d(new TiffHandler)
 {
@@ -63,3 +64,5 @@ OutputData<double> *OutputDataReadTiffStrategy::readOutputData(std::istream &inp
     m_d->read(input_stream);
     return m_d->getOutputData()->clone();
 }
+
+#endif // BORNAGAIN_TIFF_SUPPORT
diff --git a/Core/InputOutput/OutputDataReadStrategy.h b/Core/InputOutput/OutputDataReadStrategy.h
index e687a9b289436c05258844e24680aeff7a6c88fb..c8c98d42ffae2eb7fe9e6bdd865fb2417ec40da1 100644
--- a/Core/InputOutput/OutputDataReadStrategy.h
+++ b/Core/InputOutput/OutputDataReadStrategy.h
@@ -42,6 +42,7 @@ public:
     OutputData<double > *readOutputData(std::istream& input_stream);
 };
 
+#ifdef BORNAGAIN_TIFF_SUPPORT
 
 class TiffHandler;
 
@@ -58,6 +59,7 @@ public:
 private:
     TiffHandler *m_d;
 };
+#endif // BORNAGAIN_TIFF_SUPPORT
 
 #endif // OUTPUTDATAREADSTRATEGY_H
 
diff --git a/Core/InputOutput/OutputDataWriteFactory.cpp b/Core/InputOutput/OutputDataWriteFactory.cpp
index 10992c8f742a076bcbc1323be1b2ee716819c0d0..6d0145ccf2d4a870e302c0af1f39f39c86953e90 100644
--- a/Core/InputOutput/OutputDataWriteFactory.cpp
+++ b/Core/InputOutput/OutputDataWriteFactory.cpp
@@ -33,9 +33,11 @@ IOutputDataWriteStrategy *OutputDataWriteFactory::getWriteStrategy(const std::st
         result = new OutputDataWriteINTStrategy();
     }
 
+#ifdef BORNAGAIN_TIFF_SUPPORT
     else if(OutputDataIOHelper::isTiffFile(file_name)) {
         result = new OutputDataWriteTiffStrategy();
     }
+#endif // BORNAGAIN_TIFF_SUPPORT
 
     else {
         throw LogicErrorException("OutputDataWriteFactory::getWriter() -> Error. "
diff --git a/Core/InputOutput/OutputDataWriteStrategy.cpp b/Core/InputOutput/OutputDataWriteStrategy.cpp
index 7cf2c7e1b39ffe1a7b0879e8ab304374245cf49c..137e8e32d215a63d57d09ad256196c1ad566f8bf 100644
--- a/Core/InputOutput/OutputDataWriteStrategy.cpp
+++ b/Core/InputOutput/OutputDataWriteStrategy.cpp
@@ -53,7 +53,7 @@ void OutputDataWriteINTStrategy::writeOutputData(const OutputData<double> &data,
 // ----------------------------------------------------------------------------
 
 
-
+#ifdef BORNAGAIN_TIFF_SUPPORT
 
 OutputDataWriteTiffStrategy::OutputDataWriteTiffStrategy()
     : m_d(new TiffHandler)
@@ -72,5 +72,6 @@ void OutputDataWriteTiffStrategy::writeOutputData(const OutputData<double> &data
     m_d->write(data, output_stream);
 }
 
+#endif
 
 
diff --git a/Core/InputOutput/OutputDataWriteStrategy.h b/Core/InputOutput/OutputDataWriteStrategy.h
index 6f8784b9928ca7da19c1ea5c8c6905b27f6a0cdf..42ef6b2ddd368c858236109cb3ffbd7392a07a69 100644
--- a/Core/InputOutput/OutputDataWriteStrategy.h
+++ b/Core/InputOutput/OutputDataWriteStrategy.h
@@ -46,6 +46,8 @@ public:
     virtual void writeOutputData(const OutputData<double> &data, std::ostream &output_stream);
 };
 
+#ifdef BORNAGAIN_TIFF_SUPPORT
+
 class TiffHandler;
 
 //! @class OutputDataWriteTiffStrategy
@@ -61,6 +63,7 @@ private:
     TiffHandler *m_d;
 };
 
+#endif // BORNAGAIN_TIFF_SUPPORT
 
 #endif // OUTPUTDATAWRITESTRATEGY_H
 
diff --git a/Core/InputOutput/TiffHandler.cpp b/Core/InputOutput/TiffHandler.cpp
index f092c1d322aeef782d32918e8a8f8319bd5f84f6..52dcb33154735823f46da4d0bcf266c963cfc8bd 100644
--- a/Core/InputOutput/TiffHandler.cpp
+++ b/Core/InputOutput/TiffHandler.cpp
@@ -12,6 +12,7 @@
 //! @authors   C. Durniak, M. Ganeva, G. Pospelov, W. Van Herck, J. Wuttke
 //
 // ************************************************************************** //
+#ifdef BORNAGAIN_TIFF_SUPPORT
 #include "TiffHandler.h"
 #include "Exceptions.h"
 #include "Utils.h"
@@ -209,5 +210,4 @@ void TiffHandler::create_output_data()
     m_data->addAxis("y", m_height, 0.0, double(m_height));
 }
 
-
-
+#endif // BORNAGAIN_TIFF_SUPPORT
diff --git a/Core/InputOutput/TiffHandler.h b/Core/InputOutput/TiffHandler.h
index a786155c1af7721ea055689d4afaf44c734433f2..8b1b37bc7c1e8f44f78e3741dabbd41855d5da53 100644
--- a/Core/InputOutput/TiffHandler.h
+++ b/Core/InputOutput/TiffHandler.h
@@ -16,6 +16,8 @@
 #ifndef TIFFHANDLER_H
 #define TIFFHANDLER_H
 
+#ifdef BORNAGAIN_TIFF_SUPPORT
+
 #include "WinDllMacros.h"
 #include "OutputData.h"
 #include <string>
@@ -53,6 +55,7 @@ private:
     boost::scoped_ptr<OutputData<double> > m_data;
 };
 
+#endif // BORNAGAIN_TIFF_SUPPORT
 
 #endif
 
diff --git a/Tests/FunctionalTests/TestPyCore/CMakeLists.txt b/Tests/FunctionalTests/TestPyCore/CMakeLists.txt
index 62a7d0c7bb7a1c0749e8c4850c487917096b1091..6848f0fa616dfbcebbf39ab76d84168fd61adf33 100644
--- a/Tests/FunctionalTests/TestPyCore/CMakeLists.txt
+++ b/Tests/FunctionalTests/TestPyCore/CMakeLists.txt
@@ -54,6 +54,11 @@ set(list_of_python_tests
 #    "transform_BoxComposition.py" # broken, problems with absoprtion in FormFactorTruncatedSphere
 )
 
+if(BORNAGAIN_TIFF_SUPPORT)
+    list(APPEND list_of_python_tests "intensitydata_io_tiff.py")
+endif()
+
+
 foreach(_test ${list_of_python_tests})
     add_test(${_test} ${PYTHON_EXECUTABLE} "${CMAKE_BINARY_DIR}/Tests/FunctionalTests/TestPyCore/${_test}")
 endforeach()
diff --git a/Tests/FunctionalTests/TestPyCore/intensitydata_io.py b/Tests/FunctionalTests/TestPyCore/intensitydata_io.py
index 6dc323093703c88191560f287f2c5155f8b01e5f..d507f9bc6e323e3d6b74f169f91e989a9e5658ae 100644
--- a/Tests/FunctionalTests/TestPyCore/intensitydata_io.py
+++ b/Tests/FunctionalTests/TestPyCore/intensitydata_io.py
@@ -148,24 +148,5 @@ class OutputDataIOTest(unittest.TestCase):
         newdata = IntensityDataIOFactory.readOutputData("tmp.int.bz2")
         self.assertTrue(is_the_same_data(data, newdata))
 
-    def test_SaveToTiff(self):
-        data = IntensityData()
-        data.addAxis(FixedBinAxis("x", 10, 0.0, 10.0))
-        data.addAxis(FixedBinAxis("y", 5, 0.0, 5.0))
-        fill_data(data)
-
-        IntensityDataIOFactory.writeOutputData(data, "tmp.tif")
-        newdata = IntensityDataIOFactory.readOutputData("tmp.tif")
-        self.assertTrue(is_the_same_data(data, newdata))
-
-        IntensityDataIOFactory.writeOutputData(data, "tmp.tif.gz")
-        newdata = IntensityDataIOFactory.readOutputData("tmp.tif.gz")
-        self.assertTrue(is_the_same_data(data, newdata))
-
-        IntensityDataIOFactory.writeOutputData(data, "tmp.tif.bz2")
-        newdata = IntensityDataIOFactory.readOutputData("tmp.tif.bz2")
-        self.assertTrue(is_the_same_data(data, newdata))
-
-
 if __name__ == '__main__':
     unittest.main()
diff --git a/Tests/FunctionalTests/TestPyCore/intensitydata_io_tiff.py b/Tests/FunctionalTests/TestPyCore/intensitydata_io_tiff.py
new file mode 100644
index 0000000000000000000000000000000000000000..bf0069538cc5af56a48af272c3a5f4a6bfca09df
--- /dev/null
+++ b/Tests/FunctionalTests/TestPyCore/intensitydata_io_tiff.py
@@ -0,0 +1,67 @@
+# Functional test: tests of IO operations with the IntensityData object
+
+import sys
+import os
+import unittest
+import numpy
+import math
+import time
+
+sys.path.append(os.path.abspath(
+                os.path.join(os.path.split(__file__)[0],
+                '..', '..', '..', 'lib')))
+
+from libBornAgainCore import *
+
+
+def fill_data(data):
+    """
+    Fills intensity data with some numbers
+    """
+    for i in range(0, data.getAllocatedSize()):
+        data[i] = i
+
+
+def is_the_same_data(data1, data2):
+    """
+    Checks if two data are identical
+    """
+    if data1.getAllocatedSize() != data2.getAllocatedSize():
+        return False
+    if data1.getRank() != data2.getRank():
+        return False
+    for i in range(0, data1.getRank()):
+        if data1.getAxis(i) != data2.getAxis(i):
+            return False
+    for i in range(0, data1.getAllocatedSize()):
+        if data1[i] != data2[i]:
+            return False
+
+    return True
+
+
+class OutputDataIOTiffTest(unittest.TestCase):
+    """
+    Test serialization of IntensityData into TIFF format
+    """
+    def test_SaveToTiff(self):
+        data = IntensityData()
+        data.addAxis(FixedBinAxis("x", 10, 0.0, 10.0))
+        data.addAxis(FixedBinAxis("y", 5, 0.0, 5.0))
+        fill_data(data)
+
+        IntensityDataIOFactory.writeOutputData(data, "tmp.tif")
+        newdata = IntensityDataIOFactory.readOutputData("tmp.tif")
+        self.assertTrue(is_the_same_data(data, newdata))
+
+        IntensityDataIOFactory.writeOutputData(data, "tmp.tif.gz")
+        newdata = IntensityDataIOFactory.readOutputData("tmp.tif.gz")
+        self.assertTrue(is_the_same_data(data, newdata))
+
+        IntensityDataIOFactory.writeOutputData(data, "tmp.tif.bz2")
+        newdata = IntensityDataIOFactory.readOutputData("tmp.tif.bz2")
+        self.assertTrue(is_the_same_data(data, newdata))
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/ThirdParty/CMakeLists.txt b/ThirdParty/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..d572b249fa50bbfb2bc08f612676aa4283539e72
--- /dev/null
+++ b/ThirdParty/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Compilation of ThirdParty dependencies
+
+if(BORNAGAIN_TIFF_SUPPORT)
+    if(NOT TIFF_FOUND)
+        add_subdirectory(libtiff)
+    endif()
+endif()
+
+add_subdirectory(gtest)
+add_subdirectory(RootMinimizers)
diff --git a/ThirdParty/RootMinimizers/CMakeLists.txt b/ThirdParty/RootMinimizers/CMakeLists.txt
index b368636631341da6eaef302d6a04b7bb6659aa63..a7323b1df76452850cf7f8d80ef6853f0acfe9b3 100644
--- a/ThirdParty/RootMinimizers/CMakeLists.txt
+++ b/ThirdParty/RootMinimizers/CMakeLists.txt
@@ -34,8 +34,8 @@ add_library(
     STATIC
     ${source_files} ${include_files}
 )
-set(${library_name}_INCLUDE_DIRS ${include_dirs} PARENT_SCOPE)
-set(${library_name}_LIBRARY ${library_name} PARENT_SCOPE)
+set(${library_name}_INCLUDE_DIRS ${include_dirs} CACHE INTERNAL "")
+set(${library_name}_LIBRARY ${library_name} CACHE INTERNAL "")
 
 # --- external dependencies ---
 include_directories(${GSL_INCLUDE_DIR})
diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake
index e3c72cc08f77f4fd2d073e07f25fdf19811ed06b..bb290fd19c814afdf6feffad9c29b01a7de3aee9 100644
--- a/cmake/modules/SearchInstalledSoftware.cmake
+++ b/cmake/modules/SearchInstalledSoftware.cmake
@@ -39,7 +39,8 @@ find_package(GSL REQUIRED)
 # -----------------------------------------------------------------------------
 # Tiff
 # -----------------------------------------------------------------------------
-#find_package(TIFF)
+if(BORNAGAIN_TIFF_SUPPORT)
+find_package(TIFF)
 
 # check if tiff setup contains C++ version of library too
 # i.e. TIFF_LIBRARIES should be /usr/lib64/libtiff.so;/usr/lib64/libtiffxx.so
@@ -68,6 +69,8 @@ if(TIFF_FOUND)
 else()
     message(STATUS "No TIFF library found, local version will be build.")
 endif()
+endif()
+
 
 
 # --- Python ---