mcallistertad / nrf_google_iot_core

nRF9160 - Google IoT Core - Pub/Sub
MIT License
2 stars 2 forks source link

BSEC library structure might have changed in BSEC_1.4.8.0_Generic_Release #5

Open frippe75 opened 3 years ago

frippe75 commented 3 years ago

During a build I get:

CMake Error at /workdir/ncs/nrf/zephyr/cmake/extensions.cmake:372 (add_library):
  Cannot find source file:

    /workdir/ncs/nrf/ext/BSEC_1.4.8.0_Generic_Release/examples/bsec_integration.c

Looking at 'src/env_sensors/CMakeLists.txt'

set(bsec_dir ${CONFIG_BOSCH_BSEC_LIBRARY_PATH})
        target_include_directories(app PRIVATE ${bsec_dir}/API)
        target_include_directories(app PRIVATE ${bsec_dir}/examples)
        target_sources(app PRIVATE ${bsec_dir}/examples/bsec_integration.c)

And comparing that to the layout of the library an extra directory has been added in 'bsec_iot_example':

/workdir/ncs/nrf/ext/BSEC_1.4.8.0_Generic_Release/examples/bsec_iot_example
/workdir/ncs/nrf/ext/BSEC_1.4.8.0_Generic_Release/examples/bsec_iot_example/bsec_integration.h
/workdir/ncs/nrf/ext/BSEC_1.4.8.0_Generic_Release/examples/bsec_iot_example/bme680.c

Didn't do a PR since I couldn't determine if this is an error on my part or not.

frippe75 commented 3 years ago

Now it builds...

diff --git a/src/env_sensors/CMakeLists.txt b/src/env_sensors/CMakeLists.txt
index bc90e21..2b223ca 100644
--- a/src/env_sensors/CMakeLists.txt
+++ b/src/env_sensors/CMakeLists.txt
@@ -15,11 +15,11 @@ if (CONFIG_USE_BME680_BSEC)
                if(NOT EXISTS "${BSEC_LIB_DIR}/libalgobsec.a")
                        assert(0 "Could not find BSEC library")
                endif()
-               target_include_directories(app PRIVATE ${bsec_dir}/API)
-               target_include_directories(app PRIVATE ${bsec_dir}/examples)
+               #target_include_directories(app PRIVATE ${bsec_dir}/API)
+               target_include_directories(app PRIVATE ${bsec_dir}/examples/bsec_iot_example)
                target_include_directories(app PRIVATE ${BSEC_INCLUDE_DIR})
-               target_sources(app PRIVATE ${bsec_dir}/examples/bsec_integration.c)
-               target_sources(app PRIVATE ${bsec_dir}/API/bme680.c)
+               target_sources(app PRIVATE ${bsec_dir}/examples/bsec_iot_example/bsec_integration.c)
+               target_sources(app PRIVATE ${bsec_dir}/examples/bsec_iot_example/bme680.c)

                add_library(bsec_lib STATIC IMPORTED GLOBAL)
                add_dependencies(bsec_lib math_lib bsec_target)
mcallistertad commented 3 years ago

Thanks for making me aware of this. Could you please submit a pull request and I will merge your changes. Unfortunately I can't include the BSEC blob due to its license agreement.