Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@ set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )

# Set prefix to PWD if any path flags are relative.
# PWD is set to the path where you run the cmake command.
if(DEFINED ENV{PWD})
if(ROOT_CA_CERT_PATH AND NOT IS_ABSOLUTE ${ROOT_CA_CERT_PATH})
set(ROOT_CA_CERT_PATH "$ENV{PWD}/${ROOT_CA_CERT_PATH}")
endif()
if(CLIENT_CERT_PATH AND NOT IS_ABSOLUTE ${CLIENT_CERT_PATH})
set(CLIENT_CERT_PATH "$ENV{PWD}/${CLIENT_CERT_PATH}")
endif()
if(CLIENT_PRIVATE_KEY_PATH AND NOT IS_ABSOLUTE ${CLIENT_PRIVATE_KEY_PATH})
set(CLIENT_PRIVATE_KEY_PATH "$ENV{PWD}/${CLIENT_PRIVATE_KEY_PATH}")
endif()
endif()

# Add libraries.
add_subdirectory( libraries )

Expand All @@ -59,3 +73,5 @@ add_subdirectory( platform )

# Build the demos.
add_subdirectory( demos )


14 changes: 0 additions & 14 deletions demos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,6 @@ if(BUILD_TESTS)
DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tests")
endif()

# Set prefix to PWD if any path flags are relative.
# PWD is set to the path where you run the cmake command.
if(DEFINED ENV{PWD})
if(ROOT_CA_CERT_PATH AND NOT IS_ABSOLUTE ${ROOT_CA_CERT_PATH})
set(ROOT_CA_CERT_PATH "$ENV{PWD}/${ROOT_CA_CERT_PATH}")
endif()
if(CLIENT_CERT_PATH AND NOT IS_ABSOLUTE ${CLIENT_CERT_PATH})
set(CLIENT_CERT_PATH "$ENV{PWD}/${CLIENT_CERT_PATH}")
endif()
if(CLIENT_PRIVATE_KEY_PATH AND NOT IS_ABSOLUTE ${CLIENT_PRIVATE_KEY_PATH})
set(CLIENT_PRIVATE_KEY_PATH "$ENV{PWD}/${CLIENT_PRIVATE_KEY_PATH}")
endif()
endif()

# Include each subdirectory that has a CMakeLists.txt file in it
file(GLOB demo_dirs "${DEMOS_DIR}/*/*")
foreach(demo_dir IN LISTS demo_dirs)
Expand Down
10 changes: 2 additions & 8 deletions demos/mqtt/mqtt_demo_basic_tls/demo_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@
* a Mosquitto broker locally.
* Alternatively,instructions to run Mosquitto server on Docker container can
* be viewed in the README.md of the root directory.
*
* #define BROKER_ENDPOINT "...insert here..."
*/
#ifndef BROKER_ENDPOINT
#define BROKER_ENDPOINT "localhost"
#endif

/**
* @brief MQTT server port number.
Expand All @@ -76,11 +75,6 @@
* #define ROOT_CA_CERT_PATH ".....insert here...."
*/

/**
* @brief Length of path to server certificate.
*/
#define ROOT_CA_CERT_PATH_LENGTH ( ( uint16_t ) ( sizeof( ROOT_CA_CERT_PATH ) - 1 ) )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is an unused macro

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is unused


/**
* @brief MQTT client identifier.
*
Expand Down
5 changes: 2 additions & 3 deletions demos/mqtt/mqtt_demo_lightweight/demo_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@
* a Mosquitto broker locally.
* Alternatively,instructions to run Mosquitto server on Docker container can
* be viewed in the README.md of the root directory.
*
* #define BROKER_ENDPOINT "...insert here..."
*/
#ifndef BROKER_ENDPOINT
#define BROKER_ENDPOINT "localhost"
#endif

/**
* @brief MQTT server port number.
Expand Down
5 changes: 2 additions & 3 deletions demos/mqtt/mqtt_demo_plaintext/demo_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@
* a Mosquitto broker locally.
* Alternatively,instructions to run Mosquitto server on Docker container can
* be viewed in the README.md of the root directory.
*
* #define BROKER_ENDPOINT "...insert here..."
*/
#ifndef BROKER_ENDPOINT
#define BROKER_ENDPOINT "localhost"
#endif

/**
* @brief MQTT server port number.
Expand Down