Repository: brainflow-dev/brainflow (language: python)

Issue:
Improve compatibility with CMake FetchContent
**Use case:**
Projects may want to include BrainFlow as a dependency in C++. CMake provides the FetchContent module to support downloading and optionally building dependencies. As a CMake project, BrainFlow is well suited to this build chain method, but the FetchContent module fails because of the use of CMAKE_HOME_DIRECTORY in BrainFlow. 

When FetchContent_MakeAvailable is invoked, CMake will download the project from a URL or Git repository. If the Git repository is downloaded, CMake finds the BrainFlow CMakeLists and attempts to build them, but this fails because CMAKE_HOME_DIRECTORY resolves to the root project (not BrainFlow).

**Describe the solution you'd like:**
Remove CMake logic that is dependent on BrainFlow being the root project and ensure BrainFlow builds correctly when included with the FetchContent module.

**Describe alternatives you've considered:**
Another option may be to download the compiled binaries provided at each release. However, the "compiled_libs" artifact does not include the include files provided when the install target is built. An alternative would be to bundle required C++ header files in with the compiled_libs release artifact.



Discussion / hints:
Makes sense

CompiledLibs tar is for julia mostly and there is no need for headers
There is a special job to build all possible versions of cpp code like debug/release static/dynamic msvc runtime, etc 

https://github.com/brainflow-dev/brainflow/actions/runs/4744386915

And there are all of them in job artifacts 

Fix patch:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7d4d918b1..233bdf7b0 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,9 +9,9 @@ SET (VERSION ${BRAINFLOW_VERSION})
 SET (CMAKE_CXX_VISIBILITY_PRESET hidden)
 SET (CMAKE_C_VISIBILITY_PRESET hidden)
 SET (CMAKE_POSITION_INDEPENDENT_CODE ON)
-SET (VERSION_CONFIG ${CMAKE_HOME_DIRECTORY}/compiled/brainflowConfigVersion.cmake)
+SET (VERSION_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/compiled/brainflowConfigVersion.cmake)
 SET (CONFIG_INSTALL_DIR lib/cmake/brainflow)
-SET (PROJECT_CONFIG ${CMAKE_HOME_DIRECTORY}/compiled/brainflowConfig.cmake)
+SET (PROJECT_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/compiled/brainflowConfig.cmake)
 SET (TARGETS_EXPORT_NAME brainflowTargets)
 SET (PACKAGE_LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib)
 SET (PACKAGE_INC_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/inc)
@@ -24,9 +24,8 @@ option (BUILD_BLUETOOTH "BUILD_BLUETOOTH" OFF)
 option (BUILD_BLE "BUILD_BLE" OFF)
 option (BUILD_ONNX "BUILD_ONNX" OFF)
 option (BUILD_TESTS "BUILD_TESTS" OFF)
-option (USE_PERIPHERY "USE_PERIPHERY" OFF)
 
-include (${CMAKE_HOME_DIRECTORY}/cmake/macros.cmake)
+include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/macros.cmake)
 configure_msvc_runtime ()
 
 if (WARNINGS_AS_ERRORS)
@@ -40,12 +39,12 @@ if (WARNINGS_AS_ERRORS)
     endif ()
 endif (WARNINGS_AS_ERRORS)
 
-include (${CMAKE_HOME_DIRECTORY}/src/board_controller/build.cmake)
-include (${CMAKE_HOME_DIRECTORY}/src/data_handler/build.cmake)
-include (${CMAKE_HOME_DIRECTORY}/src/ml/build.cmake)
-include (${CMAKE_HOME_DIRECTORY}/cpp_package/build.cmake)
+include (${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/build.cmake)
+include (${CMAKE_CURRENT_SOURCE_DIR}/src/data_handler/build.cmake)
+include (${CMAKE_CURRENT_SOURCE_DIR}/src/ml/build.cmake)
+include (${CMAKE_CURRENT_SOURCE_DIR}/cpp_package/build.cmake)
 if (BUILD_TESTS) 
-    include (${CMAKE_HOME_DIRECTORY}/src/tests/build.cmake)
+    include (${CMAKE_CURRENT_SOURCE_DIR}/src/tests/build.cmake)
 endif (BUILD_TESTS)
 
 include (CMakePackageConfigHelpers)
diff --git a/cpp_package/build.cmake b/cpp_package/build.cmake
index 7428a8a47..f3dce11ad 100644
--- a/cpp_package/build.cmake
+++ b/cpp_package/build.cmake
@@ -11,9 +11,9 @@ else (CMAKE_SIZEOF_VOID_P EQUAL 8)
 endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
 
 SET (CPP_BINDING_SRC
-    ${CMAKE_HOME_DIRECTORY}/cpp_package/src/board_shim.cpp
-    ${CMAKE_HOME_DIRECTORY}/cpp_package/src/ml_model.cpp
-    ${CMAKE_HOME_DIRECTORY}/cpp_package/src/data_filter.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/cpp_package/src/board_shim.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/cpp_package/src/ml_model.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/cpp_package/src/data_filter.cpp
 )
 
 add_library (
@@ -22,23 +22,23 @@ add_library (
 
 target_include_directories (
     ${BRAINFLOW_CPP_BINDING_NAME} PRIVATE
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/inc
-    ${CMAKE_HOME_DIRECTORY}/src/utils/inc
-    ${CMAKE_HOME_DIRECTORY}/src/data_handler/inc
-    ${CMAKE_HOME_DIRECTORY}/cpp_package/src/inc
-    ${CMAKE_HOME_DIRECTORY}/third_party/json
-    ${CMAKE_HOME_DIRECTORY}/src/ml/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/data_handler/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/cpp_package/src/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/json
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/ml/inc
 )
 
 target_link_libraries (${BRAINFLOW_CPP_BINDING_NAME} PRIVATE ${BOARD_CONTROLLER_NAME} ${DATA_HANDLER_NAME} ${ML_MODULE_NAME})
 
 install (
     FILES
-    ${CMAKE_HOME_DIRECTORY}/cpp_package/src/inc/data_filter.h
-    ${CMAKE_HOME_DIRECTORY}/cpp_package/src/inc/board_shim.h
-    ${CMAKE_HOME_DIRECTORY}/cpp_package/src/inc/ml_model.h
-    ${CMAKE_HOME_DIRECTORY}/src/utils/inc/brainflow_array.h
-    ${CMAKE_HOME_DIRECTORY}/src/utils/inc/brainflow_exception.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/cpp_package/src/inc/data_filter.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/cpp_package/src/inc/board_shim.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/cpp_package/src/inc/ml_model.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc/brainflow_array.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc/brainflow_exception.h
     DESTINATION inc
 )
 
diff --git a/src/board_controller/ant_neuro/build.cmake b/src/board_controller/ant_neuro/build.cmake
index 688ae019c..57f656eea 100644
--- a/src/board_controller/ant_neuro/build.cmake
+++ b/src/board_controller/ant_neuro/build.cmake
@@ -16,35 +16,35 @@ endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
 
 if (MSVC OR UNIX AND NOT APPLE AND NOT ANDROID)
     SET (BOARD_CONTROLLER_SRC ${BOARD_CONTROLLER_SRC}
-        ${CMAKE_HOME_DIRECTORY}/third_party/ant_neuro/eemagine/sdk/wrapper.cc)
+        ${CMAKE_CURRENT_SOURCE_DIR}/third_party/ant_neuro/eemagine/sdk/wrapper.cc)
 endif (MSVC OR UNIX AND NOT APPLE AND NOT ANDROID)
 
 if (MSVC)
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/ant_neuro/windows/${ANT_LIB_NAME}" DESTINATION "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/ant_neuro/windows/${ANT_LIB_NAME}" DESTINATION "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/ant_neuro/windows/${ANT_LIB_NAME}" DESTINATION "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/ant_neuro/windows/${ANT_LIB_NAME}" DESTINATION "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/ant_neuro/windows/${ANT_LIB_NAME}" DESTINATION "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/ant_neuro/windows/${ANT_LIB_NAME}" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/ant_neuro/windows/${ANT_LIB_NAME}" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/ant_neuro/windows/${ANT_LIB_NAME}" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/ant_neuro/windows/${ANT_LIB_NAME}" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/ant_neuro/windows/${ANT_LIB_NAME}" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/")
 endif (MSVC)
 if (UNIX AND NOT APPLE AND NOT ANDROID)
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/ant_neuro/linux/${ANT_LIB_NAME}" DESTINATION "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/ant_neuro/linux/${ANT_LIB_NAME}" DESTINATION "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/ant_neuro/linux/${ANT_LIB_NAME}" DESTINATION "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/ant_neuro/linux/${ANT_LIB_NAME}" DESTINATION "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/ant_neuro/linux/${ANT_LIB_NAME}" DESTINATION "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/ant_neuro/linux/${ANT_LIB_NAME}" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/ant_neuro/linux/${ANT_LIB_NAME}" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/ant_neuro/linux/${ANT_LIB_NAME}" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/ant_neuro/linux/${ANT_LIB_NAME}" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/ant_neuro/linux/${ANT_LIB_NAME}" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/")
 endif (UNIX AND NOT APPLE AND NOT ANDROID)
 
 if (MSVC)
     install (
         FILES
-        ${CMAKE_HOME_DIRECTORY}/third_party/ant_neuro/windows/${ANT_LIB_NAME}
+        ${CMAKE_CURRENT_SOURCE_DIR}/third_party/ant_neuro/windows/${ANT_LIB_NAME}
         DESTINATION lib
     )
 endif (MSVC)
 if (UNIX AND NOT APPLE AND NOT ANDROID)
     install (
         FILES
-        ${CMAKE_HOME_DIRECTORY}/third_party/ant_neuro/linux/${ANT_LIB_NAME}
+        ${CMAKE_CURRENT_SOURCE_DIR}/third_party/ant_neuro/linux/${ANT_LIB_NAME}
         DESTINATION lib
     )
 endif (UNIX AND NOT APPLE AND NOT ANDROID)
diff --git a/src/board_controller/build.cmake b/src/board_controller/build.cmake
index 6061901ae..c07ec59dc 100644
--- a/src/board_controller/build.cmake
+++ b/src/board_controller/build.cmake
@@ -23,80 +23,80 @@ else (CMAKE_SIZEOF_VOID_P EQUAL 8)
 endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
 
 SET (BOARD_CONTROLLER_SRC
-    ${CMAKE_HOME_DIRECTORY}/src/utils/timestamp.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/utils/data_buffer.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/utils/os_serial.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/utils/os_serial_ioctl.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/utils/serial.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/utils/libftdi_serial.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/utils/socket_client_tcp.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/utils/socket_client_udp.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/utils/socket_server_tcp.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/utils/socket_server_udp.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/utils/multicast_client.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/utils/multicast_server.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/utils/broadcast_client.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/utils/broadcast_server.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/openbci/galea_serial.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/openbci/openbci_serial_board.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/openbci/openbci_wifi_shield_board.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/openbci/ganglion_wifi.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/openbci/cyton_wifi.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/openbci/cyton_daisy_wifi.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/openbci/ganglion.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/openbci/ganglion_native.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/openbci/cyton.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/openbci/cyton_daisy.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/board_controller.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/board_info_getter.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/board.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/brainflow_boards.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/streaming_board.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/synthetic_board.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/dyn_lib_board.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/bt_lib_board.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/playback_file_board.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/openbci/galea.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/file_streamer.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/multicast_streamer.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/gtec/unicorn_board.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/neuromd/neuromd_board.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/neuromd/brainbit.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/neuromd/callibri.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/neuromd/callibri_eeg.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/neuromd/callibri_ecg.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/neuromd/callibri_emg.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/neurosity/notion_osc.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/mentalab/explore.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/oymotion/gforce_pro.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/oymotion/gforce_dual.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/freeeeg32/freeeeg32.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/neuromd/brainbit_bled.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/muse/muse_bled.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/ant_neuro/ant_neuro.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/enophone/enophone.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/ble_lib_board.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/muse/muse.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/brainalive/brainalive.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/emotibit/emotibit.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/timestamp.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/data_buffer.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/os_serial.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/os_serial_ioctl.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/serial.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/libftdi_serial.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/socket_client_tcp.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/socket_client_udp.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/socket_server_tcp.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/socket_server_udp.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/multicast_client.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/multicast_server.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/broadcast_client.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/broadcast_server.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/openbci/galea_serial.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/openbci/openbci_serial_board.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/openbci/openbci_wifi_shield_board.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/openbci/ganglion_wifi.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/openbci/cyton_wifi.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/openbci/cyton_daisy_wifi.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/openbci/ganglion.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/openbci/ganglion_native.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/openbci/cyton.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/openbci/cyton_daisy.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/board_controller.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/board_info_getter.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/board.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/brainflow_boards.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/streaming_board.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/synthetic_board.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/dyn_lib_board.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/bt_lib_board.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/playback_file_board.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/openbci/galea.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/file_streamer.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/multicast_streamer.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/gtec/unicorn_board.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/neuromd/neuromd_board.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/neuromd/brainbit.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/neuromd/callibri.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/neuromd/callibri_eeg.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/neuromd/callibri_ecg.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/neuromd/callibri_emg.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/neurosity/notion_osc.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/mentalab/explore.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/oymotion/gforce_pro.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/oymotion/gforce_dual.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/freeeeg32/freeeeg32.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/neuromd/brainbit_bled.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/muse/muse_bled.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/ant_neuro/ant_neuro.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/enophone/enophone.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/ble_lib_board.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/muse/muse.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/brainalive/brainalive.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/emotibit/emotibit.cpp
 )
 
-include (${CMAKE_HOME_DIRECTORY}/src/board_controller/ant_neuro/build.cmake)
-include (${CMAKE_HOME_DIRECTORY}/src/board_controller/openbci/ganglion_bglib/build.cmake)
-include (${CMAKE_HOME_DIRECTORY}/src/board_controller/gtec/build.cmake)
-include (${CMAKE_HOME_DIRECTORY}/src/board_controller/muse/muse_bglib/build.cmake)
-include (${CMAKE_HOME_DIRECTORY}/src/board_controller/neuromd/build.cmake)
+include (${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/ant_neuro/build.cmake)
+include (${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/openbci/ganglion_bglib/build.cmake)
+include (${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/gtec/build.cmake)
+include (${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/muse/muse_bglib/build.cmake)
+include (${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/neuromd/build.cmake)
 
 if (BUILD_OYMOTION_SDK)
-    include (${CMAKE_HOME_DIRECTORY}/third_party/gForceSDKCXX/build.cmake)
+    include (${CMAKE_CURRENT_SOURCE_DIR}/third_party/gForceSDKCXX/build.cmake)
 endif (BUILD_OYMOTION_SDK)
 
 if (BUILD_BLUETOOTH)
-    include (${CMAKE_HOME_DIRECTORY}/src/utils/bluetooth/build.cmake)
+    include (${CMAKE_CURRENT_SOURCE_DIR}/src/utils/bluetooth/build.cmake)
 endif (BUILD_BLUETOOTH)
 
 if (BUILD_BLE)
-    add_subdirectory (${CMAKE_HOME_DIRECTORY}/third_party/SimpleBLE/simpleble)
+    add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR}/third_party/SimpleBLE/simpleble)
 endif (BUILD_BLE)
 
 add_library (
@@ -106,42 +106,42 @@ add_library (
 
 target_include_directories (
     ${BOARD_CONTROLLER_NAME} PRIVATE
-    ${CMAKE_HOME_DIRECTORY}/third_party/
-    ${CMAKE_HOME_DIRECTORY}/third_party/json
-    ${CMAKE_HOME_DIRECTORY}/third_party/http
-    ${CMAKE_HOME_DIRECTORY}/third_party/unicorn/inc
-    ${CMAKE_HOME_DIRECTORY}/third_party/oscpp/include
-    ${CMAKE_HOME_DIRECTORY}/src/utils/inc
-    ${CMAKE_HOME_DIRECTORY}/src/utils/bluetooth/inc
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/inc
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/openbci/inc
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/oymotion/inc
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/gtec/inc
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/neuromd/inc
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/openbci/ganglion_bglib/inc
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/neuromd/brainbit_bglib/inc
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/muse/inc
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/muse/muse_bglib/inc
-    ${CMAKE_HOME_DIRECTORY}/third_party/neurosdk/inc/types
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/neurosity/inc
-    ${CMAKE_HOME_DIRECTORY}/third_party/gForceSDKCXX/src/inc
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/freeeeg32/inc
-    ${CMAKE_HOME_DIRECTORY}/third_party/ant_neuro
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/ant_neuro/inc
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/enophone/inc
-    ${CMAKE_HOME_DIRECTORY}/third_party/SimpleBLE/simpleble/include
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/brainalive/inc
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/mentalab/inc
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/emotibit/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/json
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/http
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/oscpp/include
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/bluetooth/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/openbci/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/oymotion/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/gtec/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/neuromd/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/openbci/ganglion_bglib/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/neuromd/brainbit_bglib/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/muse/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/muse/muse_bglib/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/neurosdk/inc/types
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/neurosity/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gForceSDKCXX/src/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/freeeeg32/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/ant_neuro
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/ant_neuro/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/enophone/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/SimpleBLE/simpleble/include
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/brainalive/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/mentalab/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/emotibit/inc
 )
 
 target_compile_definitions(${BOARD_CONTROLLER_NAME} PRIVATE NOMINMAX BRAINFLOW_VERSION=${BRAINFLOW_VERSION})
 
 set_target_properties (${BOARD_CONTROLLER_NAME}
     PROPERTIES
-    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
-    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
-    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
+    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
+    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
+    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
 )
 
 if (USE_LIBFTDI)
@@ -163,46 +163,46 @@ endif (USE_LIBFTDI)
 
 if (MSVC)
     add_custom_command (TARGET ${BOARD_CONTROLLER_NAME} POST_BUILD
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/${BOARD_CONTROLLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/board_controller/inc/board_controller.h" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/inc/board_controller.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/board_controller/inc/board_info_getter.h" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/inc/board_info_getter.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/utils/inc/shared_export_matlab.h" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/inc/shared_export.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${BOARD_CONTROLLER_COMPILED_NAME_DOT_LIB}" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME_DOT_LIB}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/board_controller/inc/board_controller.h" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/inc/board_controller.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/board_controller/inc/board_info_getter.h" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/inc/board_info_getter.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/utils/inc/brainflow_constants.h" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/inc/brainflow_constants.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/${BOARD_CONTROLLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/inc/board_controller.h" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/inc/board_controller.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/inc/board_info_getter.h" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/inc/board_info_getter.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc/shared_export_matlab.h" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/inc/shared_export.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${BOARD_CONTROLLER_COMPILED_NAME_DOT_LIB}" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME_DOT_LIB}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/inc/board_controller.h" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/inc/board_controller.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/inc/board_info_getter.h" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/inc/board_info_getter.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc/brainflow_constants.h" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/inc/brainflow_constants.h"
     )
 endif (MSVC)
 if (UNIX AND NOT ANDROID)
     add_custom_command (TARGET ${BOARD_CONTROLLER_NAME} POST_BUILD
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/${BOARD_CONTROLLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/${BOARD_CONTROLLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/board_controller/inc/board_controller.h" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/inc/board_controller.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/board_controller/inc/board_info_getter.h" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/inc/board_info_getter.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/utils/inc/shared_export_matlab.h" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/inc/shared_export.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/utils/inc/brainflow_constants.h" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/inc/brainflow_constants.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/board_controller/inc/board_controller.h" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/inc/board_controller.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/board_controller/inc/board_info_getter.h" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/inc/board_info_getter.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/utils/inc/brainflow_constants.h" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/inc/brainflow_constants.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/${BOARD_CONTROLLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/${BOARD_CONTROLLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/inc/board_controller.h" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/inc/board_controller.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/inc/board_info_getter.h" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/inc/board_info_getter.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc/shared_export_matlab.h" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/inc/shared_export.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc/brainflow_constants.h" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/inc/brainflow_constants.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/inc/board_controller.h" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/inc/board_controller.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/inc/board_info_getter.h" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/inc/board_info_getter.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc/brainflow_constants.h" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/inc/brainflow_constants.h"
     )
 endif (UNIX AND NOT ANDROID)
 
 if (ANDROID)
     add_custom_command (TARGET ${BOARD_CONTROLLER_NAME} POST_BUILD
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/tools/jniLibs/${ANDROID_ABI}/${BOARD_CONTROLLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/tools/jniLibs/${ANDROID_ABI}/${BOARD_CONTROLLER_COMPILED_NAME}"
     )
     if (LibFTDI1_FOUND)
         add_custom_command (TARGET ${BOARD_CONTROLLER_NAME} POST_BUILD
-            COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_HOME_DIRECTORY}/java_package/android/src/main/libs/${ANDROID_ABI}/"
+            COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_SOURCE_DIR}/java_package/android/src/main/libs/${ANDROID_ABI}/"
         )
         foreach (DEPENDENCY_LIBRARY ${LIBFTDI_LIBRARIES})
             string (REGEX REPLACE "^-l" "" DEPENDENCY_LIBRARY ${DEPENDENCY_LIBRARY})
@@ -211,8 +211,8 @@ if (ANDROID)
             endif (DEPENDENCY_LIBRARY STREQUAL "log")
             find_library (DEPENDENCY_LIBRARY_LOCATION NAMES ${DEPENDENCY_LIBRARY} HINTS ${LIBFTDI_LIBRARY_DIRS} / NO_CMAKE_PATH NO_CMAKE_FIND_ROOT_PATH)
             add_custom_command (TARGET ${BOARD_CONTROLLER_NAME} POST_BUILD
-                COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${DEPENDENCY_LIBRARY_LOCATION}" "${CMAKE_HOME_DIRECTORY}/tools/jniLibs/${ANDROID_ABI}/"
-                COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${DEPENDENCY_LIBRARY_LOCATION}" "${CMAKE_HOME_DIRECTORY}/java_package/android/src/main/libs/${ANDROID_ABI}/"
+                COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${DEPENDENCY_LIBRARY_LOCATION}" "${CMAKE_CURRENT_SOURCE_DIR}/tools/jniLibs/${ANDROID_ABI}/"
+                COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${DEPENDENCY_LIBRARY_LOCATION}" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/android/src/main/libs/${ANDROID_ABI}/"
             )
             unset (DEPENDENCY_LIBRARY_LOCATION CACHE)
         endforeach (DEPENDENCY_LIBRARY)
@@ -229,14 +229,14 @@ endif (ANDROID)
 
 install (
     FILES
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/inc/board_controller.h
-    ${CMAKE_HOME_DIRECTORY}/src/utils/inc/brainflow_constants.h
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/inc/board_info_getter.h
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/inc/brainflow_input_params.h
-    ${CMAKE_HOME_DIRECTORY}/src/utils/inc/shared_export.h
-    ${CMAKE_HOME_DIRECTORY}/src/utils/inc/brainflow_array.h
-    ${CMAKE_HOME_DIRECTORY}/src/utils/inc/brainflow_exception.h
-    ${CMAKE_HOME_DIRECTORY}/third_party/json/json.hpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/inc/board_controller.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc/brainflow_constants.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/inc/board_info_getter.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/inc/brainflow_input_params.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc/shared_export.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc/brainflow_array.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc/brainflow_exception.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/json/json.hpp
     DESTINATION inc
 )
 
diff --git a/src/board_controller/gtec/build.cmake b/src/board_controller/gtec/build.cmake
index fcf91aa40..98a480ef3 100644
--- a/src/board_controller/gtec/build.cmake
+++ b/src/board_controller/gtec/build.cmake
@@ -1,36 +1,36 @@
 if (MSVC)
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/unicorn/lib/Unicorn.dll" DESTINATION "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/unicorn/lib/Unicorn.dll" DESTINATION "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/unicorn/lib/Unicorn.dll" DESTINATION "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/unicorn/lib/Unicorn.dll" DESTINATION "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/unicorn/lib/Unicorn.dll" DESTINATION "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/unicorn/lib/Unicorn.dll" DESTINATION "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/lib/Unicorn.dll" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/lib/Unicorn.dll" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/lib/Unicorn.dll" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/lib/Unicorn.dll" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/lib/Unicorn.dll" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/lib/Unicorn.dll" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/lib/")
 endif (MSVC)
 if (UNIX AND NOT APPLE AND NOT ANDROID)
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/unicorn/lib/libunicorn.so" DESTINATION "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/unicorn/lib/libunicorn.so" DESTINATION "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/unicorn/lib/libunicorn.so" DESTINATION "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/unicorn/lib/libunicorn.so" DESTINATION "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/unicorn/lib/libunicorn.so" DESTINATION "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/unicorn/lib/libunicorn_raspberry.so" DESTINATION "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/unicorn/lib/libunicorn_raspberry.so" DESTINATION "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/unicorn/lib/libunicorn_raspberry.so" DESTINATION "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/unicorn/lib/libunicorn_raspberry.so" DESTINATION "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/unicorn/lib/libunicorn_raspberry.so" DESTINATION "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/lib/libunicorn.so" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/lib/libunicorn.so" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/lib/libunicorn.so" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/lib/libunicorn.so" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/lib/libunicorn.so" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/lib/libunicorn_raspberry.so" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/lib/libunicorn_raspberry.so" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/lib/libunicorn_raspberry.so" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/lib/libunicorn_raspberry.so" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/lib/libunicorn_raspberry.so" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/")
 endif (UNIX AND NOT APPLE AND NOT ANDROID)
 
 if (MSVC)
     install (
         FILES
-        ${CMAKE_HOME_DIRECTORY}/third_party/unicorn/lib/Unicorn.dll
+        ${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/lib/Unicorn.dll
         DESTINATION lib
     )
 endif (MSVC)
 if (UNIX AND NOT APPLE AND NOT ANDROID)
     install (
         FILES
-        ${CMAKE_HOME_DIRECTORY}/third_party/unicorn/lib/libunicorn.so
-        ${CMAKE_HOME_DIRECTORY}/third_party/unicorn/lib/libunicorn_raspberry.so
+        ${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/lib/libunicorn.so
+        ${CMAKE_CURRENT_SOURCE_DIR}/third_party/unicorn/lib/libunicorn_raspberry.so
         DESTINATION lib
     )
 endif (UNIX AND NOT APPLE AND NOT ANDROID)
diff --git a/src/board_controller/muse/muse_bglib/build.cmake b/src/board_controller/muse/muse_bglib/build.cmake
index f44d3baa6..d04a3c0cb 100644
--- a/src/board_controller/muse/muse_bglib/build.cmake
+++ b/src/board_controller/muse/muse_bglib/build.cmake
@@ -29,43 +29,43 @@ SET (MUSE_BLED_SOURCE_LIB
     ${CMAKE_CURRENT_LIST_DIR}/main.cpp
     ${CMAKE_CURRENT_LIST_DIR}/stubs.cpp
     ${CMAKE_CURRENT_LIST_DIR}/uart.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/utils/timestamp.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/utils/data_buffer.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/timestamp.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/data_buffer.cpp
 )
 
 add_library (${MUSE_BLED_LIB} SHARED ${MUSE_BLED_SOURCE_LIB})
 target_include_directories (${MUSE_BLED_LIB} PUBLIC
-    $<BUILD_INTERFACE:${CMAKE_HOME_DIRECTORY}/src/utils/inc>
-    $<BUILD_INTERFACE:${CMAKE_HOME_DIRECTORY}/src/board_controller/muse/muse_bglib/inc>
-    $<BUILD_INTERFACE:${CMAKE_HOME_DIRECTORY}/src/board_controller/muse/inc>
-    $<BUILD_INTERFACE:${CMAKE_HOME_DIRECTORY}/src/board_controller/inc>
-    $<BUILD_INTERFACE:${CMAKE_HOME_DIRECTORY}/third_party/json>
+    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc>
+    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/muse/muse_bglib/inc>
+    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/muse/inc>
+    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/inc>
+    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/third_party/json>
 )
 set_property (TARGET ${MUSE_BLED_LIB} PROPERTY POSITION_INDEPENDENT_CODE ON)
 
 set_target_properties (${MUSE_BLED_LIB}
     PROPERTIES
-    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
-    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
-    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
+    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
+    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
+    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
 )
 
 if (MSVC)
     add_custom_command (TARGET ${MUSE_BLED_LIB} POST_BUILD
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${MUSE_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/${MUSE_BLED_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${MUSE_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/${MUSE_BLED_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${MUSE_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/lib/${MUSE_BLED_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${MUSE_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/${MUSE_BLED_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${MUSE_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/${MUSE_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${MUSE_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/${MUSE_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${MUSE_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/${MUSE_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${MUSE_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/${MUSE_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${MUSE_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/${MUSE_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${MUSE_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/${MUSE_BLED_LIB_NAME}"
     )
 endif (MSVC)
 if (UNIX AND NOT ANDROID)
     add_custom_command (TARGET ${MUSE_BLED_LIB} POST_BUILD
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${MUSE_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/${MUSE_BLED_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${MUSE_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/${MUSE_BLED_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${MUSE_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/${MUSE_BLED_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${MUSE_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/${MUSE_BLED_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${MUSE_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/${MUSE_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${MUSE_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/${MUSE_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${MUSE_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/${MUSE_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${MUSE_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/${MUSE_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${MUSE_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/${MUSE_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${MUSE_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/${MUSE_BLED_LIB_NAME}"
     )
 endif (UNIX AND NOT ANDROID)
 
diff --git a/src/board_controller/neuromd/brainbit_bglib/build.cmake b/src/board_controller/neuromd/brainbit_bglib/build.cmake
index 983dbebe0..8b3f01d41 100644
--- a/src/board_controller/neuromd/brainbit_bglib/build.cmake
+++ b/src/board_controller/neuromd/brainbit_bglib/build.cmake
@@ -27,41 +27,41 @@ SET (BRAINBIT_BLED_SOURCE_LIB
     ${CMAKE_CURRENT_LIST_DIR}/main.cpp
     ${CMAKE_CURRENT_LIST_DIR}/stubs.cpp
     ${CMAKE_CURRENT_LIST_DIR}/uart.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/utils/timestamp.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/timestamp.cpp
 )
 
 add_library (${BRAINBIT_BLED_LIB} SHARED ${BRAINBIT_BLED_SOURCE_LIB})
 target_include_directories (${BRAINBIT_BLED_LIB} PUBLIC
-    $<BUILD_INTERFACE:${CMAKE_HOME_DIRECTORY}/src/utils/inc>
+    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc>
     $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/inc>
-    $<BUILD_INTERFACE:${CMAKE_HOME_DIRECTORY}/src/board_controller/inc>
-    $<BUILD_INTERFACE:${CMAKE_HOME_DIRECTORY}/third_party/json>
+    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/inc>
+    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/third_party/json>
 )
 set_property (TARGET ${BRAINBIT_BLED_LIB} PROPERTY POSITION_INDEPENDENT_CODE ON)
 
 set_target_properties (${BRAINBIT_BLED_LIB}
     PROPERTIES
-    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
-    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
-    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
+    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
+    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
+    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
 )
 
 if (MSVC)
     add_custom_command (TARGET ${BRAINBIT_BLED_LIB} POST_BUILD
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/${BRAINBIT_BLED_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/${BRAINBIT_BLED_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/lib/${BRAINBIT_BLED_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/${BRAINBIT_BLED_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/${BRAINBIT_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/${BRAINBIT_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/${BRAINBIT_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/${BRAINBIT_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/${BRAINBIT_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/${BRAINBIT_BLED_LIB_NAME}"
     )
 endif (MSVC)
 if (UNIX AND NOT ANDROID)
     add_custom_command (TARGET ${BRAINBIT_BLED_LIB} POST_BUILD
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/${BRAINBIT_BLED_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/${BRAINBIT_BLED_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/${BRAINBIT_BLED_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/${BRAINBIT_BLED_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/${BRAINBIT_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/${BRAINBIT_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/${BRAINBIT_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/${BRAINBIT_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/${BRAINBIT_BLED_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${BRAINBIT_BLED_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/${BRAINBIT_BLED_LIB_NAME}"
     )
 endif (UNIX AND NOT ANDROID)
 
diff --git a/src/board_controller/neuromd/build.cmake b/src/board_controller/neuromd/build.cmake
index 145af24a5..604adc530 100644
--- a/src/board_controller/neuromd/build.cmake
+++ b/src/board_controller/neuromd/build.cmake
@@ -1,4 +1,4 @@
-include (${CMAKE_HOME_DIRECTORY}/src/board_controller/neuromd/brainbit_bglib/build.cmake)
+include (${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/neuromd/brainbit_bglib/build.cmake)
 
 if (CMAKE_SIZEOF_VOID_P EQUAL 8)
     if (APPLE)
@@ -14,24 +14,24 @@ else (CMAKE_SIZEOF_VOID_P EQUAL 8)
 endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
 
 if (MSVC)
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/neurosdk/lib/${NEUROSDK_LIB_NAME}.dll" DESTINATION "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/neurosdk/lib/${NEUROSDK_LIB_NAME}.dll" DESTINATION "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/neurosdk/lib/${NEUROSDK_LIB_NAME}.dll" DESTINATION "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/neurosdk/lib/${NEUROSDK_LIB_NAME}.dll" DESTINATION "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/neurosdk/lib/${NEUROSDK_LIB_NAME}.dll" DESTINATION "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/neurosdk/lib/${NEUROSDK_LIB_NAME}.dll" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/neurosdk/lib/${NEUROSDK_LIB_NAME}.dll" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/neurosdk/lib/${NEUROSDK_LIB_NAME}.dll" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/neurosdk/lib/${NEUROSDK_LIB_NAME}.dll" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/neurosdk/lib/${NEUROSDK_LIB_NAME}.dll" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/")
 endif (MSVC)
 if (APPLE)
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/neurosdk/lib/lib${NEUROSDK_LIB_NAME}.dylib" DESTINATION "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/neurosdk/lib/lib${NEUROSDK_LIB_NAME}.dylib" DESTINATION "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/neurosdk/lib/lib${NEUROSDK_LIB_NAME}.dylib" DESTINATION "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/neurosdk/lib/lib${NEUROSDK_LIB_NAME}.dylib" DESTINATION "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/")
-    file (COPY "${CMAKE_HOME_DIRECTORY}/third_party/neurosdk/lib/lib${NEUROSDK_LIB_NAME}.dylib" DESTINATION "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/neurosdk/lib/lib${NEUROSDK_LIB_NAME}.dylib" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/neurosdk/lib/lib${NEUROSDK_LIB_NAME}.dylib" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/neurosdk/lib/lib${NEUROSDK_LIB_NAME}.dylib" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/neurosdk/lib/lib${NEUROSDK_LIB_NAME}.dylib" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/")
+    file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/third_party/neurosdk/lib/lib${NEUROSDK_LIB_NAME}.dylib" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/")
 endif (APPLE)
 
 if (MSVC)
     install (
         FILES
-        ${CMAKE_HOME_DIRECTORY}/third_party/neurosdk/lib/${NEUROSDK_LIB_NAME}.dll
+        ${CMAKE_CURRENT_SOURCE_DIR}/third_party/neurosdk/lib/${NEUROSDK_LIB_NAME}.dll
         DESTINATION lib
     )
 endif (MSVC)
@@ -39,7 +39,7 @@ endif (MSVC)
 if (APPLE)
     install (
         FILES
-        ${CMAKE_HOME_DIRECTORY}/third_party/neurosdk/lib/lib${NEUROSDK_LIB_NAME}.dylib
+        ${CMAKE_CURRENT_SOURCE_DIR}/third_party/neurosdk/lib/lib${NEUROSDK_LIB_NAME}.dylib
         DESTINATION lib
     )
 endif (APPLE)
\ No newline at end of file
diff --git a/src/board_controller/openbci/ganglion_bglib/build.cmake b/src/board_controller/openbci/ganglion_bglib/build.cmake
index ce2f901ea..9384aba40 100644
--- a/src/board_controller/openbci/ganglion_bglib/build.cmake
+++ b/src/board_controller/openbci/ganglion_bglib/build.cmake
@@ -27,39 +27,39 @@ SET (GANGLION_SOURCE_LIB
     ${CMAKE_CURRENT_LIST_DIR}/main.cpp
     ${CMAKE_CURRENT_LIST_DIR}/stubs.cpp
     ${CMAKE_CURRENT_LIST_DIR}/uart.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/utils/timestamp.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/timestamp.cpp
 )
 
 add_library (${GANGLION_LIB} SHARED ${GANGLION_SOURCE_LIB})
 target_include_directories (${GANGLION_LIB} PUBLIC
-    $<BUILD_INTERFACE:${CMAKE_HOME_DIRECTORY}/src/utils/inc>
+    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc>
     $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/inc>
 )
 set_property (TARGET ${GANGLION_LIB} PROPERTY POSITION_INDEPENDENT_CODE ON)
 
 set_target_properties (${GANGLION_LIB}
     PROPERTIES
-    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
-    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
-    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
+    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
+    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
+    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
 )
 
 if (MSVC)
     add_custom_command (TARGET ${GANGLION_LIB} POST_BUILD
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${GANGLION_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/${GANGLION_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${GANGLION_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/${GANGLION_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${GANGLION_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/lib/${GANGLION_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${GANGLION_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/${GANGLION_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${GANGLION_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/${GANGLION_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${GANGLION_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/${GANGLION_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${GANGLION_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/${GANGLION_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${GANGLION_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/${GANGLION_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${GANGLION_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/${GANGLION_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${GANGLION_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/${GANGLION_LIB_NAME}"
     )
 endif (MSVC)
 if (UNIX AND NOT ANDROID)
     add_custom_command (TARGET ${GANGLION_LIB} POST_BUILD
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${GANGLION_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/${GANGLION_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${GANGLION_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/${GANGLION_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${GANGLION_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/${GANGLION_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${GANGLION_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/${GANGLION_LIB_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${GANGLION_LIB_NAME}" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/${GANGLION_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${GANGLION_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/${GANGLION_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${GANGLION_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/${GANGLION_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${GANGLION_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/${GANGLION_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${GANGLION_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/${GANGLION_LIB_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${GANGLION_LIB_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/${GANGLION_LIB_NAME}"
     )
 endif (UNIX AND NOT ANDROID)
 
diff --git a/src/data_handler/build.cmake b/src/data_handler/build.cmake
index b3e3d09fe..f53030aae 100644
--- a/src/data_handler/build.cmake
+++ b/src/data_handler/build.cmake
@@ -1,6 +1,6 @@
-include (${CMAKE_HOME_DIRECTORY}/third_party/DSPFilters/build.cmake)
-include (${CMAKE_HOME_DIRECTORY}/third_party/wavelib/build.cmake)
-include (${CMAKE_HOME_DIRECTORY}/third_party/kissfft/build.cmake)
+include (${CMAKE_CURRENT_SOURCE_DIR}/third_party/DSPFilters/build.cmake)
+include (${CMAKE_CURRENT_SOURCE_DIR}/third_party/wavelib/build.cmake)
+include (${CMAKE_CURRENT_SOURCE_DIR}/third_party/kissfft/build.cmake)
 
 if (CMAKE_SIZEOF_VOID_P EQUAL 8)
     SET (DATA_HANDLER_NAME "DataHandler")
@@ -27,8 +27,8 @@ else (CMAKE_SIZEOF_VOID_P EQUAL 8)
 endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
 
 SET (DATA_HANDLER_SRC
-    ${CMAKE_HOME_DIRECTORY}/src/data_handler/data_handler.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/data_handler/fastica.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/data_handler/data_handler.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/data_handler/fastica.cpp
 )
 
 add_library (
@@ -38,22 +38,22 @@ add_library (
 
 target_include_directories (
     ${DATA_HANDLER_NAME} PRIVATE
-    ${CMAKE_HOME_DIRECTORY}/third_party/
-    ${CMAKE_HOME_DIRECTORY}/src/utils/inc
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/inc
-    ${CMAKE_HOME_DIRECTORY}/src/data_handler/inc
-    ${CMAKE_HOME_DIRECTORY}/third_party/DSPFilters/include
-    ${CMAKE_HOME_DIRECTORY}/third_party/wavelib/header
-    ${CMAKE_HOME_DIRECTORY}/third_party/kissfft
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/data_handler/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/DSPFilters/include
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/wavelib/header
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/kissfft
 )
 
 target_compile_definitions(${DATA_HANDLER_NAME} PRIVATE BRAINFLOW_VERSION=${BRAINFLOW_VERSION})
 
 set_target_properties (${DATA_HANDLER_NAME}
     PROPERTIES
-    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
-    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
-    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
+    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
+    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
+    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
 )
 
 if (USE_OPENMP)
@@ -77,40 +77,40 @@ endif (ANDROID)
 
 if (MSVC)
     add_custom_command (TARGET ${DATA_HANDLER_NAME} POST_BUILD
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/${DATA_HANDLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/data_handler/inc/data_handler.h" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/inc/data_handler.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/utils/inc/shared_export_matlab.h" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/inc/shared_export.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${DATA_HANDLER_COMPILED_NAME_DOT_LIB}" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/lib/${DATA_HANDLER_COMPILED_NAME_DOT_LIB}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/data_handler/inc/data_handler.h" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/inc/data_handler.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/${DATA_HANDLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/data_handler/inc/data_handler.h" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/inc/data_handler.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc/shared_export_matlab.h" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/inc/shared_export.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${DATA_HANDLER_COMPILED_NAME_DOT_LIB}" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/lib/${DATA_HANDLER_COMPILED_NAME_DOT_LIB}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/data_handler/inc/data_handler.h" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/inc/data_handler.h"
     )
 endif (MSVC)
 if (UNIX AND NOT ANDROID)
     add_custom_command (TARGET ${DATA_HANDLER_NAME} POST_BUILD
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/${DATA_HANDLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/data_handler/inc/data_handler.h" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/inc/data_handler.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/utils/inc/shared_export_matlab.h" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/inc/shared_export.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/data_handler/inc/data_handler.h" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/inc/data_handler.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/${DATA_HANDLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/data_handler/inc/data_handler.h" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/inc/data_handler.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc/shared_export_matlab.h" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/inc/shared_export.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/lib/${DATA_HANDLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/data_handler/inc/data_handler.h" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/inc/data_handler.h"
     )
 endif (UNIX AND NOT ANDROID)
 if (ANDROID)
     add_custom_command (TARGET ${DATA_HANDLER_NAME} POST_BUILD
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/tools/jniLibs/${ANDROID_ABI}/${DATA_HANDLER_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${DATA_HANDLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/tools/jniLibs/${ANDROID_ABI}/${DATA_HANDLER_COMPILED_NAME}"
     )
 endif (ANDROID)
 
 install (
     FILES
-    ${CMAKE_HOME_DIRECTORY}/src/data_handler/inc/data_handler.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/data_handler/inc/data_handler.h
     DESTINATION inc
 )
 
diff --git a/src/ml/build.cmake b/src/ml/build.cmake
index 9e69f321e..f6c9ba5da 100644
--- a/src/ml/build.cmake
+++ b/src/ml/build.cmake
@@ -38,21 +38,21 @@ add_library (
 
 target_include_directories (
     ${ML_MODULE_NAME} PRIVATE
-    ${CMAKE_HOME_DIRECTORY}/third_party/
-    ${CMAKE_HOME_DIRECTORY}/src/utils/inc
-    ${CMAKE_HOME_DIRECTORY}/src/ml/inc
-    ${CMAKE_HOME_DIRECTORY}/src/ml/onnx/inc
-    ${CMAKE_HOME_DIRECTORY}/third_party/json
-    ${CMAKE_HOME_DIRECTORY}/third_party/onnxruntime/build/native/include
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/ml/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/ml/onnx/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/json
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/onnxruntime/build/native/include
 )
 
 target_compile_definitions(${ML_MODULE_NAME} PRIVATE BRAINFLOW_VERSION=${BRAINFLOW_VERSION})
 
 set_target_properties (${ML_MODULE_NAME}
     PROPERTIES
-    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
-    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
-    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
+    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
+    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
+    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
 )
 
 if (BUILD_ONNX)
@@ -78,43 +78,43 @@ endif (ANDROID)
 
 if (MSVC)
     add_custom_command (TARGET ${ML_MODULE_NAME} POST_BUILD
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${ML_MODULE_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${ML_MODULE_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${ML_MODULE_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/${ML_MODULE_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${ML_MODULE_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${ML_MODULE_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/ml/inc/ml_module.h" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/inc/ml_module.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/utils/inc/shared_export_matlab.h" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/inc/shared_export.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${ML_MODULE_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${ML_MODULE_COMPILED_NAME_DOT_LIB}" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/lib/${ML_MODULE_COMPILED_NAME_DOT_LIB}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/ml/inc/ml_module.h" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/inc/ml_module.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/utils/inc/shared_export_matlab.h" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/inc/shared_export.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${ML_MODULE_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${ML_MODULE_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${ML_MODULE_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/${ML_MODULE_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${ML_MODULE_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${ML_MODULE_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/ml/inc/ml_module.h" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/inc/ml_module.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc/shared_export_matlab.h" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/inc/shared_export.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${ML_MODULE_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${ML_MODULE_COMPILED_NAME_DOT_LIB}" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/lib/${ML_MODULE_COMPILED_NAME_DOT_LIB}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/ml/inc/ml_module.h" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/inc/ml_module.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc/shared_export_matlab.h" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/inc/shared_export.h"
     )
 endif (MSVC)
 if (UNIX AND NOT ANDROID)
     add_custom_command (TARGET ${ML_MODULE_NAME} POST_BUILD
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${ML_MODULE_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${ML_MODULE_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${ML_MODULE_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/${ML_MODULE_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${ML_MODULE_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/ml/inc/ml_module.h" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/inc/ml_module.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/utils/inc/shared_export_matlab.h" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/inc/shared_export.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${ML_MODULE_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${ML_MODULE_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/ml/inc/ml_module.h" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/inc/ml_module.h"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/src/utils/inc/shared_export_matlab.h" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/inc/shared_export.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${ML_MODULE_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${ML_MODULE_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${ML_MODULE_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/${ML_MODULE_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${ML_MODULE_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/ml/inc/ml_module.h" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/inc/ml_module.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc/shared_export_matlab.h" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/inc/shared_export.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${ML_MODULE_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${ML_MODULE_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/lib/${ML_MODULE_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/ml/inc/ml_module.h" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/inc/ml_module.h"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc/shared_export_matlab.h" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/inc/shared_export.h"
     )
 endif (UNIX AND NOT ANDROID)
 if (ANDROID)
     add_custom_command (TARGET ${ML_MODULE_NAME} POST_BUILD
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${ML_MODULE_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/tools/jniLibs/${ANDROID_ABI}/${ML_MODULE_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${ML_MODULE_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/tools/jniLibs/${ANDROID_ABI}/${ML_MODULE_COMPILED_NAME}"
     )
 endif (ANDROID)
 
 install (
     FILES
-    ${CMAKE_HOME_DIRECTORY}/src/ml/inc/ml_module.h
-    ${CMAKE_HOME_DIRECTORY}/src/ml/inc/brainflow_model_params.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/ml/inc/ml_module.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/ml/inc/brainflow_model_params.h
     DESTINATION inc
 )
 
diff --git a/src/ml/onnx/build.cmake b/src/ml/onnx/build.cmake
index da9a8f8e1..19cb534b3 100644
--- a/src/ml/onnx/build.cmake
+++ b/src/ml/onnx/build.cmake
@@ -1,38 +1,38 @@
 if (APPLE)
     if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
-        SET (ONNXRUNTIME_PATH ${CMAKE_HOME_DIRECTORY}/third_party/onnxruntime/runtimes/osx.10.14-arm64/native/libonnxruntime_arm64.dylib)
+        SET (ONNXRUNTIME_PATH ${CMAKE_CURRENT_SOURCE_DIR}/third_party/onnxruntime/runtimes/osx.10.14-arm64/native/libonnxruntime_arm64.dylib)
     else (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
-        SET (ONNXRUNTIME_PATH ${CMAKE_HOME_DIRECTORY}/third_party/onnxruntime/runtimes/osx.10.14-x64/native/libonnxruntime_x64.dylib)
+        SET (ONNXRUNTIME_PATH ${CMAKE_CURRENT_SOURCE_DIR}/third_party/onnxruntime/runtimes/osx.10.14-x64/native/libonnxruntime_x64.dylib)
     endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
 elseif (MSVC)
     if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
         if (CMAKE_SIZEOF_VOID_P EQUAL 8)
-            SET (ONNXRUNTIME_PATH ${CMAKE_HOME_DIRECTORY}/third_party/onnxruntime/runtimes/win-arm64/native/onnxruntime_arm64.dll)
+            SET (ONNXRUNTIME_PATH ${CMAKE_CURRENT_SOURCE_DIR}/third_party/onnxruntime/runtimes/win-arm64/native/onnxruntime_arm64.dll)
         else (CMAKE_SIZEOF_VOID_P EQUAL 8)
-            SET (ONNXRUNTIME_PATH ${CMAKE_HOME_DIRECTORY}/third_party/onnxruntime/runtimes/win-arm/native/onnxruntime_arm.dll)
+            SET (ONNXRUNTIME_PATH ${CMAKE_CURRENT_SOURCE_DIR}/third_party/onnxruntime/runtimes/win-arm/native/onnxruntime_arm.dll)
         endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
     else (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
         if (CMAKE_SIZEOF_VOID_P EQUAL 8)
-            SET (ONNXRUNTIME_PATH ${CMAKE_HOME_DIRECTORY}/third_party/onnxruntime/runtimes/win-x64/native/onnxruntime_x64.dll)
+            SET (ONNXRUNTIME_PATH ${CMAKE_CURRENT_SOURCE_DIR}/third_party/onnxruntime/runtimes/win-x64/native/onnxruntime_x64.dll)
         else (CMAKE_SIZEOF_VOID_P EQUAL 8)
-            SET (ONNXRUNTIME_PATH ${CMAKE_HOME_DIRECTORY}/third_party/onnxruntime/runtimes/win-x86/native/onnxruntime_x86.dll)
+            SET (ONNXRUNTIME_PATH ${CMAKE_CURRENT_SOURCE_DIR}/third_party/onnxruntime/runtimes/win-x86/native/onnxruntime_x86.dll)
         endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
     endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
 elseif (UNIX AND NOT ANDROID)
     if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
-        SET (ONNXRUNTIME_PATH ${CMAKE_HOME_DIRECTORY}/third_party/onnxruntime/runtimes/linux-arm64/native/libonnxruntime_arm64.so)
+        SET (ONNXRUNTIME_PATH ${CMAKE_CURRENT_SOURCE_DIR}/third_party/onnxruntime/runtimes/linux-arm64/native/libonnxruntime_arm64.so)
     else (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
-        SET (ONNXRUNTIME_PATH ${CMAKE_HOME_DIRECTORY}/third_party/onnxruntime/runtimes/linux-x64/native/libonnxruntime_x64.so)
+        SET (ONNXRUNTIME_PATH ${CMAKE_CURRENT_SOURCE_DIR}/third_party/onnxruntime/runtimes/linux-x64/native/libonnxruntime_x64.so)
     endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
 endif (APPLE)
 
 if (NOT ANDROID)
-    file (COPY ${ONNXRUNTIME_PATH} DESTINATION ${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/lib/)
-    file (COPY ${ONNXRUNTIME_PATH} DESTINATION ${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/)
-    file (COPY ${ONNXRUNTIME_PATH} DESTINATION ${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/)
-    file (COPY ${ONNXRUNTIME_PATH} DESTINATION ${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/)
-    file (COPY ${ONNXRUNTIME_PATH} DESTINATION ${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/)
-    file (COPY ${ONNXRUNTIME_PATH} DESTINATION ${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/lib/)
+    file (COPY ${ONNXRUNTIME_PATH} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/)
+    file (COPY ${ONNXRUNTIME_PATH} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/)
+    file (COPY ${ONNXRUNTIME_PATH} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/)
+    file (COPY ${ONNXRUNTIME_PATH} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/)
+    file (COPY ${ONNXRUNTIME_PATH} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/)
+    file (COPY ${ONNXRUNTIME_PATH} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/lib/)
 endif (NOT ANDROID)
 
 install (
diff --git a/src/utils/bluetooth/build.cmake b/src/utils/bluetooth/build.cmake
index 87eb526a2..724103015 100644
--- a/src/utils/bluetooth/build.cmake
+++ b/src/utils/bluetooth/build.cmake
@@ -22,24 +22,24 @@ endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
 
 if (MSVC)
     SET (BLUETOOTH_SRC
-        ${CMAKE_HOME_DIRECTORY}/src/utils/bluetooth/socket_bluetooth_win.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/bluetooth/socket_bluetooth_win.cpp
     )
 elseif (APPLE)
     SET (BLUETOOTH_SRC
-        ${CMAKE_HOME_DIRECTORY}/src/utils/bluetooth/socket_bluetooth_macos.mm
-        ${CMAKE_HOME_DIRECTORY}/src/utils/bluetooth/macos_third_party/BluetoothDeviceResources.mm
-        ${CMAKE_HOME_DIRECTORY}/src/utils/bluetooth/macos_third_party/BluetoothWorker.mm
-        ${CMAKE_HOME_DIRECTORY}/src/utils/bluetooth/macos_third_party/pipe.c
+        ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/bluetooth/socket_bluetooth_macos.mm
+        ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/bluetooth/macos_third_party/BluetoothDeviceResources.mm
+        ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/bluetooth/macos_third_party/BluetoothWorker.mm
+        ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/bluetooth/macos_third_party/pipe.c
     )
 else ()
     SET (BLUETOOTH_SRC
-        ${CMAKE_HOME_DIRECTORY}/src/utils/bluetooth/socket_bluetooth_linux.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/bluetooth/socket_bluetooth_linux.cpp
     )
 endif (MSVC)
 
 SET (BLUETOOTH_SRC
     ${BLUETOOTH_SRC}
-    ${CMAKE_HOME_DIRECTORY}/src/utils/bluetooth/bluetooth_functions.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/bluetooth/bluetooth_functions.cpp
 )
 
 add_library (
@@ -49,36 +49,36 @@ add_library (
 
 target_include_directories (
     ${BLUETOOTH_LIB_NAME} PRIVATE
-    ${CMAKE_HOME_DIRECTORY}/src/utils/inc
-    ${CMAKE_HOME_DIRECTORY}/src/utils/bluetooth/inc
-    ${CMAKE_HOME_DIRECTORY}/src/utils/bluetooth/macos_third_party
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/bluetooth/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/bluetooth/macos_third_party
 )
 
 set_target_properties (${BLUETOOTH_LIB_NAME}
     PROPERTIES
-    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
-    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
-    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
+    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
+    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
+    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
 )
 
 if (MSVC)
     add_custom_command (TARGET ${BLUETOOTH_LIB_NAME} POST_BUILD
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/${BLUETOOTH_LIB_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/${BLUETOOTH_LIB_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/${BLUETOOTH_LIB_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/lib/${BLUETOOTH_LIB_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/${BLUETOOTH_LIB_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/lib/${BLUETOOTH_LIB_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/${BLUETOOTH_LIB_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/${BLUETOOTH_LIB_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/${BLUETOOTH_LIB_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/${BLUETOOTH_LIB_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/${BLUETOOTH_LIB_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/lib/${BLUETOOTH_LIB_COMPILED_NAME}"
     )
 endif (MSVC)
 if (UNIX AND NOT ANDROID)
     add_custom_command (TARGET ${BLUETOOTH_LIB_NAME} POST_BUILD
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/${BLUETOOTH_LIB_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/${BLUETOOTH_LIB_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/${BLUETOOTH_LIB_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/${BLUETOOTH_LIB_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/${BLUETOOTH_LIB_COMPILED_NAME}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_HOME_DIRECTORY}/rust_package/brainflow/lib/${BLUETOOTH_LIB_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/${BLUETOOTH_LIB_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/${BLUETOOTH_LIB_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/${BLUETOOTH_LIB_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/${BLUETOOTH_LIB_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/${BLUETOOTH_LIB_COMPILED_NAME}"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${BLUETOOTH_LIB_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/lib/${BLUETOOTH_LIB_COMPILED_NAME}"
     )
 endif (UNIX AND NOT ANDROID)
 
diff --git a/third_party/DSPFilters/build.cmake b/third_party/DSPFilters/build.cmake
index 38d48d989..4d6f547e8 100644
--- a/third_party/DSPFilters/build.cmake
+++ b/third_party/DSPFilters/build.cmake
@@ -1,6 +1,6 @@
 SET (DSPFILTERS "DSPFilters")
-aux_source_directory (${CMAKE_HOME_DIRECTORY}/third_party/DSPFilters/source DSPFILTERS_SOURCE_LIB)
+aux_source_directory (${CMAKE_CURRENT_SOURCE_DIR}/third_party/DSPFilters/source DSPFILTERS_SOURCE_LIB)
 add_library (${DSPFILTERS} STATIC ${DSPFILTERS_SOURCE_LIB})
-target_include_directories (${DSPFILTERS} PUBLIC $<BUILD_INTERFACE:${CMAKE_HOME_DIRECTORY}/third_party/DSPFilters/include>)
+target_include_directories (${DSPFILTERS} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/third_party/DSPFilters/include>)
 set_property (TARGET ${DSPFILTERS} PROPERTY POSITION_INDEPENDENT_CODE ON)
 target_compile_definitions(${DSPFILTERS} PRIVATE -DNDEBUG)
\ No newline at end of file
diff --git a/third_party/gForceSDKCXX/build.cmake b/third_party/gForceSDKCXX/build.cmake
index 67bd8b1d0..b4e783298 100644
--- a/third_party/gForceSDKCXX/build.cmake
+++ b/third_party/gForceSDKCXX/build.cmake
@@ -8,7 +8,7 @@ endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
 
 SET (GFORCE_WRAPPER_SRC
     ${CMAKE_CURRENT_LIST_DIR}/src/wrapper.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/utils/timestamp.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/timestamp.cpp
 )
 
 add_library (
@@ -23,9 +23,9 @@ target_include_directories (
     ${CMAKE_CURRENT_LIST_DIR}/src/inc
     ${CMAKE_CURRENT_LIST_DIR}/inc
     ${CMAKE_CURRENT_LIST_DIR}/..
-    ${CMAKE_HOME_DIRECTORY}/src/utils/inc
-    ${CMAKE_HOME_DIRECTORY}/src/board_controller/inc
-    ${CMAKE_HOME_DIRECTORY}/third_party/json
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/third_party/json
 )
 
 find_library (GFORCE_SDK NAMES ${GFORCE_SDK_NAME} PATHS ${CMAKE_CURRENT_LIST_DIR}/lib)
@@ -33,23 +33,23 @@ target_link_libraries (${GFORCE_SDK_WRAPPER_NAME} PRIVATE ${GFORCE_SDK})
 
 set_target_properties (${GFORCE_SDK_WRAPPER_NAME}
     PROPERTIES
-    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
-    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
-    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/compiled
+    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
+    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
+    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
 )
 
 if (MSVC)
     add_custom_command (TARGET ${GFORCE_SDK_WRAPPER_NAME} POST_BUILD
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${GFORCE_SDK_WRAPPER_NAME}.dll" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/${GFORCE_SDK_WRAPPER_NAME}.dll"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${GFORCE_SDK_WRAPPER_NAME}.dll" "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/${GFORCE_SDK_WRAPPER_NAME}.dll"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${GFORCE_SDK_WRAPPER_NAME}.dll" "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/lib/${GFORCE_SDK_WRAPPER_NAME}.dll"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${GFORCE_SDK_WRAPPER_NAME}.dll" "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/${GFORCE_SDK_WRAPPER_NAME}.dll"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/${GFORCE_SDK_WRAPPER_NAME}.dll" "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/${GFORCE_SDK_WRAPPER_NAME}.dll"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/${GFORCE_SDK_NAME}.dll" "${CMAKE_HOME_DIRECTORY}/matlab_package/brainflow/lib/${GFORCE_SDK_NAME}.dll"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/${GFORCE_SDK_NAME}.dll" "${CMAKE_HOME_DIRECTORY}/python_package/brainflow/lib/${GFORCE_SDK_NAME}.dll"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/${GFORCE_SDK_NAME}.dll" "${CMAKE_HOME_DIRECTORY}/csharp_package/brainflow/brainflow/lib/${GFORCE_SDK_NAME}.dll"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/${GFORCE_SDK_NAME}.dll" "${CMAKE_HOME_DIRECTORY}/java_package/brainflow/src/main/resources/${GFORCE_SDK_NAME}.dll"
-        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/${GFORCE_SDK_NAME}.dll" "${CMAKE_HOME_DIRECTORY}/julia_package/brainflow/lib/${GFORCE_SDK_NAME}.dll"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${GFORCE_SDK_WRAPPER_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/${GFORCE_SDK_WRAPPER_NAME}.dll"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${GFORCE_SDK_WRAPPER_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/${GFORCE_SDK_WRAPPER_NAME}.dll"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${GFORCE_SDK_WRAPPER_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/${GFORCE_SDK_WRAPPER_NAME}.dll"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${GFORCE_SDK_WRAPPER_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/${GFORCE_SDK_WRAPPER_NAME}.dll"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${GFORCE_SDK_WRAPPER_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/${GFORCE_SDK_WRAPPER_NAME}.dll"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/${GFORCE_SDK_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/${GFORCE_SDK_NAME}.dll"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/${GFORCE_SDK_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/${GFORCE_SDK_NAME}.dll"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/${GFORCE_SDK_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/${GFORCE_SDK_NAME}.dll"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/${GFORCE_SDK_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/${GFORCE_SDK_NAME}.dll"
+        COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/${GFORCE_SDK_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/${GFORCE_SDK_NAME}.dll"
     )
 endif (MSVC)
 
@@ -57,15 +57,15 @@ if (MSVC)
     if (CMAKE_SIZEOF_VOID_P EQUAL 8)
         install (
             FILES
-            ${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/gForceSDKWrapper.dll
-            ${CMAKE_HOME_DIRECTORY}/third_party/gForceSDKCXX/lib/gforce64.dll
+            ${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/gForceSDKWrapper.dll
+            ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gForceSDKCXX/lib/gforce64.dll
             DESTINATION lib
         )
     else (CMAKE_SIZEOF_VOID_P EQUAL 8)
         install (
             FILES
-            ${CMAKE_HOME_DIRECTORY}/compiled/$<CONFIG>/gForceSDKWrapper32.dll
-            ${CMAKE_HOME_DIRECTORY}/third_party/gForceSDKCXX/lib/gforce32.dll
+            ${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/gForceSDKWrapper32.dll
+            ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gForceSDKCXX/lib/gforce32.dll
             DESTINATION lib
         )
     endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
diff --git a/third_party/kissfft/build.cmake b/third_party/kissfft/build.cmake
index df21265a5..1ca886d2a 100644
--- a/third_party/kissfft/build.cmake
+++ b/third_party/kissfft/build.cmake
@@ -77,11 +77,11 @@ endif()
 #
 
 add_library(kissfft STATIC
-  ${CMAKE_HOME_DIRECTORY}/third_party/kissfft/kiss_fft.c
-  ${CMAKE_HOME_DIRECTORY}/third_party/kissfft/kfc.c
-  ${CMAKE_HOME_DIRECTORY}/third_party/kissfft/kiss_fftnd.c
-  ${CMAKE_HOME_DIRECTORY}/third_party/kissfft/kiss_fftndr.c
-  ${CMAKE_HOME_DIRECTORY}/third_party/kissfft/kiss_fftr.c)
+  ${CMAKE_CURRENT_SOURCE_DIR}/third_party/kissfft/kiss_fft.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/third_party/kissfft/kfc.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/third_party/kissfft/kiss_fftnd.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/third_party/kissfft/kiss_fftndr.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/third_party/kissfft/kiss_fftr.c)
 
 target_include_directories(kissfft PUBLIC
     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>)
diff --git a/third_party/wavelib/build.cmake b/third_party/wavelib/build.cmake
index dc2ad439d..18e727ba6 100644
--- a/third_party/wavelib/build.cmake
+++ b/third_party/wavelib/build.cmake
@@ -1,5 +1,5 @@
 SET (WAVELIB "WaveLib")
-aux_source_directory (${CMAKE_HOME_DIRECTORY}/third_party/wavelib/src WAVELIB_SRC)
+aux_source_directory (${CMAKE_CURRENT_SOURCE_DIR}/third_party/wavelib/src WAVELIB_SRC)
 add_library (${WAVELIB} STATIC ${WAVELIB_SRC})
-target_include_directories (${WAVELIB} PUBLIC $<BUILD_INTERFACE:${CMAKE_HOME_DIRECTORY}/third_party/wavelib/header>)
+target_include_directories (${WAVELIB} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/third_party/wavelib/header>)
 set_property (TARGET ${WAVELIB} PROPERTY POSITION_INDEPENDENT_CODE ON)
\ No newline at end of file
diff --git a/tools/build.py b/tools/build.py
index 92d953370..fbe7dd46a 100644
--- a/tools/build.py
+++ b/tools/build.py
@@ -185,7 +185,6 @@ def prepare_args():
         parser.add_argument('--generator', type=str,
                             help='CMake generator', required=False)
         parser.add_argument('--use-libftdi', action='store_true')
-        parser.add_argument('--use-periphery', action='store_true')
 
     parser.add_argument('--build-dir', type=str, help='build folder',
                         required=False, default=os.path.join(cur_folder, '..', 'build'))
@@ -235,8 +234,6 @@ def config(args):
         cmd_config.append('-DBRAINFLOW_VERSION=%s' % args.brainflow_version)
     if hasattr(args, 'use_libftdi') and args.use_libftdi:
         cmd_config.append('-DUSE_LIBFTDI=ON')
-    if hasattr(args, 'use_periphery') and args.use_periphery:
-        cmd_config.append('-DUSE_PERIPHERY=ON')
     if args.warnings_as_errors:
         cmd_config.append('-DWARNINGS_AS_ERRORS=ON')
     if args.use_openmp:


Test patch:
diff --git a/src/tests/build.cmake b/src/tests/build.cmake
index e15e0e16e..3db4fd092 100644
--- a/src/tests/build.cmake
+++ b/src/tests/build.cmake
@@ -28,11 +28,11 @@ FetchContent_MakeAvailable(googletest)
 enable_testing()
 
 SET (TESTS_SRC
-    ${CMAKE_HOME_DIRECTORY}/src/utils/bluetooth/bluetooth_functions.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/utils/data_buffer.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/tests/utils/bluetooth/socket_bluetooth_test.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/tests/utils/bluetooth/bluetooth_functions_unittest.cpp
-    ${CMAKE_HOME_DIRECTORY}/src/tests/utils/data_buffer_unittest.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/bluetooth/bluetooth_functions.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/data_buffer.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/tests/utils/bluetooth/socket_bluetooth_test.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/tests/utils/bluetooth/bluetooth_functions_unittest.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/tests/utils/data_buffer_unittest.cpp
 )
 
 add_executable(
@@ -42,10 +42,10 @@ add_executable(
 
 target_include_directories (
     ${TESTS_EXE_NAME} PRIVATE
-    ${CMAKE_HOME_DIRECTORY}/src/utils/inc
-    ${CMAKE_HOME_DIRECTORY}/src/utils/bluetooth/inc
-    ${CMAKE_HOME_DIRECTORY}/src/tests/utils/bluetooth/inc
-    ${CMAKE_HOME_DIRECTORY}/src/utils/bluetooth/macos_third_party
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/bluetooth/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/tests/utils/bluetooth/inc
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/bluetooth/macos_third_party
 )
 
 target_link_libraries(
@@ -55,9 +55,9 @@ target_link_libraries(
 
 set_target_properties (${TESTS_EXE_NAME}
     PROPERTIES
-    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/build/tests
-    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/build/tests
-    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/build/tests
+    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build/tests
+    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build/tests
+    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build/tests
 )
 
 include(GoogleTest)