diff --git a/.github/workflows/ba-windows.yml b/.github/workflows/ba-windows.yml
index 645de63e521316e6a0b37163ddad9221f432feb4..87d18a94f6baa1fb7645e79f02ff43fc3707f6da 100644
--- a/.github/workflows/ba-windows.yml
+++ b/.github/workflows/ba-windows.yml
@@ -25,13 +25,13 @@ env:
 
 on:
   push:
-    branches: [ master, develop]    
-    paths-ignore: 
-      - 'Doc/**'    
+    branches: [ master, develop]
+    paths-ignore:
+      - 'Doc/**'
   pull_request:
     branches: [ master, develop ]
-    paths-ignore: 
-      - 'Doc/**'    
+    paths-ignore:
+      - 'Doc/**'
 
 jobs:
   build:
@@ -43,14 +43,14 @@ jobs:
 
     steps:
     - uses: actions/checkout@v2
-      with: 
-        submodules: true    
-    
+      with:
+        submodules: true
+
     - name: Set up Python ${{ matrix.python-version }}
       uses: actions/setup-python@v1
       with:
         python-version: ${{ matrix.python-version }}
-        
+
     - name: setup dependencies
       shell: powershell
       run: |
@@ -59,19 +59,19 @@ jobs:
         cd ${{github.workspace}}
         mkdir deps
         Get-Date -Format G
-        wget http://apps.jcns.fz-juelich.de/src/WinLibs/bornagain_deps_20200604.zip -O ${{runner.temp}}\local_x64.zip
+        wget http://apps.jcns.fz-juelich.de/src/WinLibs/bornagain_deps_20200703.zip -O ${{runner.temp}}\local_x64.zip
         Get-Date -Format G
         7z x ${{runner.temp}}\local_x64.zip -odeps
         Get-Date -Format G
         dir deps
         dir deps/local_x64
-        
+
     - name: Install Python packages
       run: |
         python -m pip install --upgrade pip
         python -m pip install wheel setuptools
         python -m pip install numpy matplotlib
-        
+
     - name: Install Qt
       uses: jurplel/install-qt-action@v2
       with:
@@ -92,7 +92,7 @@ jobs:
         set(ccache_url "https://github.com/cristianadam/ccache/releases/download/v$ENV{CCACHE_VERSION}/${{ runner.os }}.tar.xz")
         file(DOWNLOAD "${ccache_url}" ./ccache.tar.xz SHOW_PROGRESS)
         execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./ccache.tar.xz)
-        
+
         set(ninja_url "https://github.com/ninja-build/ninja/releases/download/v$ENV{NINJA_VERSION}/ninja-win.zip")
         file(DOWNLOAD "${ninja_url}" ./ninja.zip SHOW_PROGRESS)
         execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./ninja.zip)
@@ -111,7 +111,7 @@ jobs:
       run: |
         string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
         message("::set-output name=timestamp::${current_date}")
-        
+
     - name: ccache cache files for BornAgain
       uses: actions/cache@v1.1.0
       with:
@@ -119,7 +119,7 @@ jobs:
         key: ba-windows-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
         restore-keys: |
           ba-windows-ccache-
-          
+
     - name: Build BornAgain
       shell: cmd
       env:
@@ -141,7 +141,7 @@ jobs:
         ccache -z
         ccache -p
         cmake --build . --config Release -j4
-        
+
     - name: Testing
       shell: cmd
       run: |
@@ -159,7 +159,7 @@ jobs:
       if: failure()
       with:
          name: LastTest.log
-         path: ./build/Testing/Temporary/LastTest.log  
+         path: ./build/Testing/Temporary/LastTest.log
 
     - name: Build package
       if: success()
@@ -169,6 +169,13 @@ jobs:
         set PATH=${{github.workspace}}\nsis-3.04;%PATH%
         cpack -c Release
 
+    - name: Upload CPack log
+      uses: actions/upload-artifact@v2
+      if: failure()
+      with:
+         name: CPack.log
+         path: ./build/_CPack_Packages/win64/NSIS/NSISOutput.log
+
     - name: Upload package
       uses: actions/upload-artifact@v2
       if: success()
diff --git a/CHANGELOG b/CHANGELOG
index 8470bda3e07f8074f46b9185f5d4a79b2e00e03d..a7fb0b57af43b2a3deafec8db522ddb42ddf0cab 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,8 @@
 BornAgain-1.17.99, work in progress
 
+  > Internal refactoring:
+    1) Unit tests now under CTest control, no longer enforced during compilation
+
 BornAgain-1.17.0, released 2020.06.16
   > API changes:
     1) Add Nevot-Croce roughness model.
diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt
index 02d88fb23ba6de5d66504782c781ecea21d9ec3c..9886baddede99412bacd74464aaeb8586d769979 100644
--- a/Core/CMakeLists.txt
+++ b/Core/CMakeLists.txt
@@ -134,7 +134,7 @@ endif()
 
 
 # --- making library ---------
-add_library(${library_name} SHARED ${include_files} ${source_files})
+add_library(${library_name} SHARED ${source_files})
 
 set_target_properties(${library_name} PROPERTIES PREFIX ${libprefix} SUFFIX ${libsuffix})
 set(${library_name}_LIBRARY_TYPE SHARED)
diff --git a/Fit/CMakeLists.txt b/Fit/CMakeLists.txt
index bf58a603324ca4ac90d24ec20814c4ef67096771..84d9c889b9bbeaa8112f50aafaa1588b1b7d09eb 100644
--- a/Fit/CMakeLists.txt
+++ b/Fit/CMakeLists.txt
@@ -88,7 +88,6 @@ if(BORNAGAIN_PYTHON)
     endif()
 
     list(APPEND source_files "${AUTO_DIR}/libBornAgainFit_wrap.cpp")
-    #list(APPEND include_files "${AUTO_DIR}/libBornAgainFit_wrap.h")
 
 endif()
 
@@ -98,7 +97,7 @@ if(WIN32)
 endif()
 
 # --- making library ---------
-add_library(${library_name} SHARED ${include_files} ${source_files})
+add_library(${library_name} SHARED ${source_files})
 set_target_properties(${library_name} PROPERTIES PREFIX ${libprefix} SUFFIX ${libsuffix})
 set(${library_name}_LIBRARY_TYPE SHARED)
 
diff --git a/GUI/ba3d/ba3d/CMakeLists.txt b/GUI/ba3d/ba3d/CMakeLists.txt
index 271d8a613d9641ce6e54d7745d7e2256653ec58c..607c19d8981e88477a50398e072f7c916d5e7b0d 100644
--- a/GUI/ba3d/ba3d/CMakeLists.txt
+++ b/GUI/ba3d/ba3d/CMakeLists.txt
@@ -9,9 +9,8 @@ set(resource_files
     )
 qt5_add_resources(RC_SHADERS ${resource_files})
 
-add_library (${lib} STATIC ${source_files} ${include_files} ${RC_SHADERS})
+add_library (${lib} STATIC ${source_files} ${RC_SHADERS})
 
 target_link_libraries (${lib}
   Qt5::Core Qt5::Widgets Qt5::OpenGL
 )
-
diff --git a/GUI/main/CMakeLists.txt b/GUI/main/CMakeLists.txt
index 94efc3a46c2db2fb00166ed9b1170f6b7869b169..acaec2e6e2f5ff75da3866de898a2330373be1f7 100644
--- a/GUI/main/CMakeLists.txt
+++ b/GUI/main/CMakeLists.txt
@@ -37,7 +37,7 @@ endif()
 # -----------------------------------------------------------------------------
 add_executable(${executable_name}
                ${executable_options}
-               ${source_files} ${include_files}
+               ${source_files}
                ${system_addons})
 
 
diff --git a/Tests/Functional/Core/CoreSpecial/CMakeLists.txt b/Tests/Functional/Core/CoreSpecial/CMakeLists.txt
index caee8a2465fd03489ee53817d49aea7df23077fb..986a6cd686155024d37a82d222872ac3a40c4969 100644
--- a/Tests/Functional/Core/CoreSpecial/CMakeLists.txt
+++ b/Tests/Functional/Core/CoreSpecial/CMakeLists.txt
@@ -12,8 +12,8 @@ set(test_cases
 
 # build executables for each test case
 file(GLOB source_files "*.cpp")
-file(GLOB include_files "*.h")
-add_executable(${test} ${include_files} ${source_files})
+
+add_executable(${test} ${source_files})
 target_link_libraries(${test} BornAgainCore BornAgainTestMachinery)
 
 # create test cases
diff --git a/Tests/Functional/Core/SelfConsistenceTest/CMakeLists.txt b/Tests/Functional/Core/SelfConsistenceTest/CMakeLists.txt
index 2dd14f3e88dcf3a609ff190cf0733617a51d9f13..5f7ca44e1a762934b7da20fa041945bed8febc00 100644
--- a/Tests/Functional/Core/SelfConsistenceTest/CMakeLists.txt
+++ b/Tests/Functional/Core/SelfConsistenceTest/CMakeLists.txt
@@ -14,9 +14,8 @@ set(test_cases
     )
 
 file(GLOB source_files "*.cpp")
-file(GLOB include_files "*.h")
 
-add_executable(${test} ${include_files} ${source_files})
+add_executable(${test} ${source_files})
 target_link_libraries(${test} BornAgainCore BornAgainTestMachinery)
 foreach(test_case ${test_cases})
     add_test(${test}/${test_case}
diff --git a/Tests/Functional/Fit/FitObjective/CMakeLists.txt b/Tests/Functional/Fit/FitObjective/CMakeLists.txt
index 923e4e6045f61f964e843ba91092fe1384a860aa..b109eea4a5f10d8fe648cb41c013069589279b8b 100644
--- a/Tests/Functional/Fit/FitObjective/CMakeLists.txt
+++ b/Tests/Functional/Fit/FitObjective/CMakeLists.txt
@@ -21,9 +21,8 @@ set(test_cases
 include_directories(${RootMinimizers_INCLUDE_DIRS})
 
 file(GLOB source_files "*.cpp")
-file(GLOB include_files "*.h")
 
-add_executable(${test} ${include_files} ${source_files})
+add_executable(${test} ${source_files})
 target_link_libraries(${test} BornAgainCore BornAgainTestMachinery)
 
 foreach(test_case ${test_cases})
diff --git a/Tests/Functional/Fit/Minimizer/CMakeLists.txt b/Tests/Functional/Fit/Minimizer/CMakeLists.txt
index 0d5396ca6591422801c406b10b87bd9f1eebf0fa..c74291e5b18739c135621b4759a5c8a2976a5b9a 100644
--- a/Tests/Functional/Fit/Minimizer/CMakeLists.txt
+++ b/Tests/Functional/Fit/Minimizer/CMakeLists.txt
@@ -25,9 +25,8 @@ set(test_cases
 include_directories(${RootMinimizers_INCLUDE_DIRS})
 
 file(GLOB source_files "*.cpp")
-file(GLOB include_files "*.h")
 
-add_executable(${test} ${include_files} ${source_files})
+add_executable(${test} ${source_files})
 target_link_libraries(${test} BornAgainCore BornAgainTestMachinery)
 
 foreach(test_case ${test_cases})
diff --git a/Tests/Functional/GUI/GUISpecial/CMakeLists.txt b/Tests/Functional/GUI/GUISpecial/CMakeLists.txt
index 64ad6691539c5578d50a924673fde805f7570b70..79be50f65923e5b2e8b7ff87b42c37a6ad0aa5c5 100644
--- a/Tests/Functional/GUI/GUISpecial/CMakeLists.txt
+++ b/Tests/Functional/GUI/GUISpecial/CMakeLists.txt
@@ -25,11 +25,10 @@ set(test_cases
 )
 
 file(GLOB source_files "*.cpp")
-file(GLOB include_files "*.h")
 
 find_package(Qt5Core REQUIRED)
 
-add_executable(${test} ${include_files} ${source_files})
+add_executable(${test} ${source_files})
 target_link_libraries(${test} BornAgainCore BornAgainGUI BornAgainTestMachinery)
 target_link_libraries(${test} Qt5::Core)
 
diff --git a/Tests/Functional/Python/PyEmbedded/CMakeLists.txt b/Tests/Functional/Python/PyEmbedded/CMakeLists.txt
index ceda8dbbe79fdd0b5a13d19f6f30e8db49fe27ff..f396f183e0b6fc40a7013ebedeb8ac61c8bc0bbe 100644
--- a/Tests/Functional/Python/PyEmbedded/CMakeLists.txt
+++ b/Tests/Functional/Python/PyEmbedded/CMakeLists.txt
@@ -19,12 +19,10 @@ include_directories(
 )
 
 file(GLOB source_files "*.cpp")
-file(GLOB include_files "*.h")
 
-add_executable(${test} ${include_files} ${source_files})
+add_executable(${test} ${source_files})
 target_link_libraries(${test} BornAgainCore BornAgainTestMachinery)
 
 foreach(test_case ${test_cases})
     add_test(${test}/${test_case} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${test} ${test_case})
 endforeach()
-
diff --git a/Tests/Functional/TestMachinery/CMakeLists.txt b/Tests/Functional/TestMachinery/CMakeLists.txt
index 02744f40ed04fea426197fe64664e6ecad58cad1..0cffff6101a7446fde686bf8a021dc3e966d347d 100644
--- a/Tests/Functional/TestMachinery/CMakeLists.txt
+++ b/Tests/Functional/TestMachinery/CMakeLists.txt
@@ -5,34 +5,21 @@
 set(library_name BornAgainTestMachinery)
 
 file(GLOB source_files "*.cpp")
-file(GLOB include_files "*.h")
 
 if(WIN32)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBA_CORE_BUILD_DLL")
 endif()
 
-# --- making library ---------
-add_library(
-    ${library_name}
-    SHARED
-    ${source_files} ${include_files}
-    )
+add_library(${library_name} SHARED ${source_files})
+target_link_libraries(${library_name} ${BornAgainCore_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
 
 set_target_properties(${library_name} PROPERTIES PREFIX ${libprefix} SUFFIX ${libsuffix})
 set(${library_name}_LIBRARY_TYPE SHARED)
 
-# exposing library name and list of include directories outside
 set(${library_name}_INCLUDE_DIRS ${include_dirs} PARENT_SCOPE)
 set(${library_name}_LIBRARY ${library_name} PARENT_SCOPE)
 
 
-# --- external dependencies ---------
-
-target_link_libraries(${library_name}
-    ${BornAgainCore_LIBRARY}
-    ${CMAKE_THREAD_LIBS_INIT}
-    )
-
 if(APPLE AND BORNAGAIN_APPLE_BUNDLE)
     set(link_flags "-Wl,-rpath,@loader_path/../../Frameworks")
     set_target_properties(${library_name} PROPERTIES LINK_FLAGS ${link_flags})
diff --git a/Tests/Functional/TestMachinery/ParameterPlan.cpp b/Tests/Functional/TestMachinery/ParameterPlan.cpp
deleted file mode 100644
index a45536afe5bd8bf76291f0a29a0c2dd2eefe552e..0000000000000000000000000000000000000000
--- a/Tests/Functional/TestMachinery/ParameterPlan.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-// ************************************************************************** //
-//
-//  BornAgain: simulate and fit scattering at grazing incidence
-//
-//! @file      Tests/Functional/TestMachinery/ParameterPlan.cpp
-//! @brief     Implements class ParameterPlan
-//!
-//! @homepage  http://www.bornagainproject.org
-//! @license   GNU General Public License v3 or higher (see COPYING)
-//! @copyright Forschungszentrum Jülich GmbH 2018
-//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
-//
-// ************************************************************************** //
-
-#include "ParameterPlan.h"
-
-using namespace Fit;
-
-ParameterPlan::ParameterPlan(const Parameter& param, double expected_value, double tolerance)
-    : m_expected_value(expected_value), m_tolerance(tolerance), m_parameter(param)
-{
-}
-
-Parameter ParameterPlan::fitParameter() const
-{
-    return m_parameter;
-}
diff --git a/Tests/Functional/TestMachinery/ParameterPlan.h b/Tests/Functional/TestMachinery/ParameterPlan.h
index a8b25b28062274a0c512d9dd060c44c3dc000674..5833afd5b74092d4058f8cd60459e366618c31b5 100644
--- a/Tests/Functional/TestMachinery/ParameterPlan.h
+++ b/Tests/Functional/TestMachinery/ParameterPlan.h
@@ -24,13 +24,13 @@
 class BA_CORE_API_ ParameterPlan
 {
 public:
-    ParameterPlan(const Fit::Parameter& param, double expected_value, double tolerance = 0.01);
-
-    Fit::Parameter fitParameter() const;
+    ParameterPlan(const Fit::Parameter& param, double expected_value, double tolerance = 0.01)
+     : m_expected_value(expected_value), m_tolerance(tolerance), m_parameter(param) {}
 
+    Fit::Parameter fitParameter() const { return m_parameter; }
     double expectedValue() const { return m_expected_value; }
-
     double tolerance() const { return m_tolerance; }
+
     void setTolerance(double tolerance) { m_tolerance = tolerance; }
 
 private:
diff --git a/Tests/UnitTests/Core/CMakeLists.txt b/Tests/UnitTests/Core/CMakeLists.txt
index 070f4f29d48bf9c08acf3b81f380f20653209a20..120219c1dba7768119503cb2bb41866accf36264 100644
--- a/Tests/UnitTests/Core/CMakeLists.txt
+++ b/Tests/UnitTests/Core/CMakeLists.txt
@@ -1,15 +1,12 @@
-############################################################################
-# Core unit tests
-############################################################################
+include(GoogleTest)
+
 set(test UnitTestCore)
 
 include_directories(${CMAKE_SOURCE_DIR}/Tests/UnitTests/utilities)
 
 file(GLOB source_files "*/*.cpp" "../utilities/TestAll.cpp")
-file(GLOB include_files "*/*.h")
 
-add_executable(${test} ${source_files} ${include_files})
+add_executable(${test} ${source_files})
 target_link_libraries(${test} ${BornAgainCore_LIBRARY} gtest)
 
-# add execution of TestCore just after compilation
-add_custom_target(${test}_run ALL DEPENDS ${test} COMMAND ${test})
+gtest_discover_tests(${test} TEST_PREFIX Core:Unit:)
diff --git a/Tests/UnitTests/Fit/CMakeLists.txt b/Tests/UnitTests/Fit/CMakeLists.txt
index 2cd1c801d2a9777ece16e386986fb63e435bc140..58defbd1cf9b3c0bae9c988d19edd9a38f67e7b1 100644
--- a/Tests/UnitTests/Fit/CMakeLists.txt
+++ b/Tests/UnitTests/Fit/CMakeLists.txt
@@ -1,16 +1,12 @@
-############################################################################
-# Fit unit tests
-############################################################################
+include(GoogleTest)
 
 set(test UnitTestFit)
 
 include_directories(${CMAKE_SOURCE_DIR}/Tests/UnitTests/utilities)
 
 file(GLOB source_files "*.cpp" "../utilities/TestAll.cpp")
-file(GLOB include_files "*.h")
 
-add_executable(${test} ${source_files} ${include_files})
+add_executable(${test} ${source_files})
 target_link_libraries(${test} ${BornAgainFit_LIBRARY} gtest)
 
-# add execution of TestCore just after compilation
-add_custom_target(${test}_run ALL DEPENDS ${test} COMMAND ${test})
+gtest_discover_tests(${test} TEST_PREFIX Fit:Unit:)
diff --git a/Tests/UnitTests/GUI/CMakeLists.txt b/Tests/UnitTests/GUI/CMakeLists.txt
index a40e9e5d68c534bd8d36cbe728dae475878a2e79..59bd0c6e85dfc3bdd333b488056b24f41e88165a 100644
--- a/Tests/UnitTests/GUI/CMakeLists.txt
+++ b/Tests/UnitTests/GUI/CMakeLists.txt
@@ -1,11 +1,8 @@
-############################################################################
-# GUI unit tests
-############################################################################
+include(GoogleTest)
 
 set(test UnitTestGUI)
 
 file(GLOB source_files "*.cpp")
-file(GLOB include_files "*.h")
 
 find_package(Qt5Core REQUIRED)
 find_package(Qt5Test REQUIRED)
@@ -13,9 +10,8 @@ find_package(Qt5Test REQUIRED)
 include_directories(${CMAKE_SOURCE_DIR}/Tests/UnitTests/utilities)
 
 set(CMAKE_AUTOMOC ON)
-add_executable(${test} ${source_files} ${include_files})
+add_executable(${test} ${source_files})
 target_link_libraries(${test} ${BornAgainGUI_LIBRARY} gtest)
 target_link_libraries(${test} Qt5::Core Qt5::Test)
 
-# add execution of TestCore just after compilation
-add_custom_target(${test}_run ALL DEPENDS ${test} COMMAND ${test})
+gtest_discover_tests(${test} TEST_PREFIX GUI:Unit:)
diff --git a/Tests/UnitTests/Numeric/CMakeLists.txt b/Tests/UnitTests/Numeric/CMakeLists.txt
index d47fd29072b51a5f60fdaa10b95cd7bdcb557d7d..6d8a18ef38feebcb39bc4e8981b3b9c76092f01f 100644
--- a/Tests/UnitTests/Numeric/CMakeLists.txt
+++ b/Tests/UnitTests/Numeric/CMakeLists.txt
@@ -1,6 +1,5 @@
-############################################################################
-# Core unit tests
-############################################################################
+include(GoogleTest)
+
 set(test UnitTestNumeric)
 
 if(MSVC)
@@ -10,14 +9,11 @@ endif()
 include_directories(${CMAKE_SOURCE_DIR}/Tests/UnitTests/utilities)
 
 file(GLOB source_files "*.cpp" "../utilities/TestAll.cpp")
-file(GLOB include_files "*.h")
 
-add_executable(${test} ${source_files} ${include_files})
+add_executable(${test} ${source_files})
 target_link_libraries(${test} ${BornAgainCore_LIBRARY} gtest)
 if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
     target_compile_options(${test} PUBLIC "-Wno-deprecated-copy")
 endif()
 
-# Registering in ctest section
-add_test(${test} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${test})
-set_tests_properties(${test} PROPERTIES LABELS "Fullcheck")
+gtest_discover_tests(${test} TEST_PREFIX Numeric:)
diff --git a/ThirdParty/Fit/RootMinimizers/CMakeLists.txt b/ThirdParty/Fit/RootMinimizers/CMakeLists.txt
index db57ab1cd4c8363a5f7696db64b7a585fe9f9134..adc75d51dac811eef2c4900fd3726f396df9f6f4 100644
--- a/ThirdParty/Fit/RootMinimizers/CMakeLists.txt
+++ b/ThirdParty/Fit/RootMinimizers/CMakeLists.txt
@@ -1,9 +1,5 @@
-############################################################################
-# CMakeLists.txt file for building libRootMinimizers package
-############################################################################
 set(library_name RootMinimizers)
 
-# --- source and include files ---------
 set(include_dirs
     ${CMAKE_CURRENT_SOURCE_DIR}
     ${CMAKE_CURRENT_SOURCE_DIR}/base
@@ -19,17 +15,6 @@ file(GLOB source_files
     "base/*.cxx"
 )
 
-file(GLOB include_files
-    "base/*.h"
-    "Minuit2/*.h"
-    "Math/*.h"
-    "mathcore/Math/*.h"
-    "Fit/*.h"
-    "TMVA/*.h"
-    "base/*.h"
-)
-
-# --- definitions ---------
 add_definitions(-DWARNINGMSG)
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMATH_NO_PLUGIN_MANAGER -DHAS_MINUIT2 -DR__HAS_MATHMORE")
 if(NOT WIN32)
@@ -38,12 +23,16 @@ else()
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4244 /wd4267")
 endif()
 
-# --- making library ------------
-add_library(${library_name} STATIC ${source_files} ${include_files})
+add_library(${library_name} STATIC ${source_files})
+# For the time being, it has to be STATIC
+# because we don't have a DLL for the GSL library yet.
+#   (at least not up to date and from reliable source
+#    TODO: try https://www.nuget.org/packages/gsl-msvc14-x64)
+# The ROOT code in directory mathcore depends on GSL.
+
 set(${library_name}_INCLUDE_DIRS ${include_dirs} CACHE INTERNAL "")
 set(${library_name}_LIBRARY ${library_name} CACHE INTERNAL "")
 
-# --- external dependencies ---
 target_include_directories(${library_name} PUBLIC ${GSL_INCLUDE_DIR} ${Boost_INCLUDE_DIRS})
 target_link_libraries(${library_name} ${GSL_LIBRARIES} ${Boost_LIBRARIES})
 target_include_directories(${library_name} PUBLIC ${include_dirs})
diff --git a/cmake/bornagain/modules/SearchInstalledSoftware.cmake b/cmake/bornagain/modules/SearchInstalledSoftware.cmake
index 24295575035d8aaab37b268f5d836ba5844393bc..2681c7427818dfc4bf0c93a046342f6e4fab411b 100644
--- a/cmake/bornagain/modules/SearchInstalledSoftware.cmake
+++ b/cmake/bornagain/modules/SearchInstalledSoftware.cmake
@@ -17,16 +17,17 @@ set(Boost_USE_STATIC_LIBS OFF)
 set(Boost_USE_MULTITHREADED ON)
 set(Boost_USE_STATIC_RUNTIME OFF)
 add_definitions(-DBOOST_ALL_DYN_LINK) # line is needed for MSVC
-#add_definitions(-DBOOST_LIB_DIAGNOSTIC) # shows during compilation auto-linked libraries
-set(boost_libraries_required program_options iostreams regex system filesystem)
+
+# Boost component libraries (do not list headers here)
+set(boost_libraries_required filesystem iostreams program_options)
 if(WIN32)
-    set(boost_libraries_required ${boost_libraries_required} zlib bzip2)
+    # system seems to be indirectly required
+    list(APPEND boost_libraries_required bzip2 system zlib)
 endif()
-
-find_package(Boost 1.48.0 COMPONENTS ${boost_libraries_required} REQUIRED)
-# In spite of the "REQUIRED" flag, FindBoost will not terminate if some components are missing.
+find_package(Boost 1.65.1 COMPONENTS ${boost_libraries_required} REQUIRED)
+# In spite of the "REQUIRED" flag, FindBoost will not terminate if some components are missing
 if(NOT Boost_FOUND)
-    message(FATAL_ERROR "Not all required Boost components were found")
+    message(FATAL_ERROR "Not all required Boost component libraries were found")
 endif()
 message(STATUS "Found Boost includes at ${Boost_INCLUDE_DIRS}, libraries at ${Boost_LIBRARY_DIRS}")