diff --git a/devicedefender/CMakeLists.txt b/devicedefender/CMakeLists.txt index 4104c6b3b..c53bd520d 100644 --- a/devicedefender/CMakeLists.txt +++ b/devicedefender/CMakeLists.txt @@ -1,11 +1,6 @@ cmake_minimum_required(VERSION 3.9) -project(IotDeviceDefender-cpp - LANGUAGES CXX) -if (DEFINED SIMPLE_VERSION) - message("Device Defender version is ${SIMPLE_VERSION}") - set(PROJECT_VERSION ${SIMPLE_VERSION}) -endif() +project(IotDeviceDefender-cpp LANGUAGES CXX VERSION ${SIMPLE_VERSION}) set(RUNTIME_DIRECTORY bin) @@ -19,6 +14,11 @@ elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR) endif() endif() +set(GENERATED_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated") +set(GENERATED_INCLUDE_DIR "${GENERATED_ROOT_DIR}/include") +set(GENERATED_CONFIG_HEADER "${GENERATED_INCLUDE_DIR}/aws/iotdevicedefender/Config.h") +configure_file(include/aws/iotdevicedefender/Config.h.in ${GENERATED_CONFIG_HEADER} @ONLY) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake") if (NOT CMAKE_CXX_STANDARD) @@ -27,6 +27,7 @@ endif() file(GLOB AWS_IOTDEVICEDEFENDER_HEADERS "include/aws/iotdevicedefender/*.h" + ${GENERATED_CONFIG_HEADER} ) file(GLOB AWS_IOTDEVICEDEFENDER_SRC diff --git a/devicedefender/include/aws/iotdevicedefender/Config.h.in b/devicedefender/include/aws/iotdevicedefender/Config.h.in new file mode 100644 index 000000000..0c2801b27 --- /dev/null +++ b/devicedefender/include/aws/iotdevicedefender/Config.h.in @@ -0,0 +1,11 @@ +#pragma once +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTDEVICEDEFENDER_VERSION "@FULL_VERSION@" +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTDEVICEDEFENDER_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTDEVICEDEFENDER_VERSION_MINOR @PROJECT_VERSION_MINOR@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTDEVICEDEFENDER_VERSION_PATCH @PROJECT_VERSION_PATCH@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTDEVICEDEFENDER_GIT_HASH "@GIT_HASH@" diff --git a/discovery/CMakeLists.txt b/discovery/CMakeLists.txt index d592212ff..d3557c476 100644 --- a/discovery/CMakeLists.txt +++ b/discovery/CMakeLists.txt @@ -1,10 +1,6 @@ cmake_minimum_required(VERSION 3.9) -project(Discovery-cpp LANGUAGES CXX) -if (DEFINED SIMPLE_VERSION) - message("Discovery version is ${SIMPLE_VERSION}") - set(PROJECT_VERSION ${SIMPLE_VERSION}) -endif() +project(Discovery-cpp LANGUAGES CXX VERSION ${SIMPLE_VERSION}) set(RUNTIME_DIRECTORY bin) @@ -18,6 +14,11 @@ elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR) endif() endif() +set(GENERATED_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated") +set(GENERATED_INCLUDE_DIR "${GENERATED_ROOT_DIR}/include") +set(GENERATED_CONFIG_HEADER "${GENERATED_INCLUDE_DIR}/aws/discovery/Config.h") +configure_file(include/aws/discovery/Config.h.in ${GENERATED_CONFIG_HEADER} @ONLY) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake") if (NOT CMAKE_CXX_STANDARD) @@ -26,6 +27,7 @@ endif() file(GLOB AWS_DISCOVERY_HEADERS "include/aws/discovery/*.h" + ${GENERATED_CONFIG_HEADER} ) file(GLOB AWS_DISCOVERY_SRC diff --git a/discovery/include/aws/discovery/Config.h.in b/discovery/include/aws/discovery/Config.h.in new file mode 100644 index 000000000..00b320f76 --- /dev/null +++ b/discovery/include/aws/discovery/Config.h.in @@ -0,0 +1,11 @@ +#pragma once +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#define AWS_IOT_DEVICE_SDK_CPP_V2_DISCOVERY_VERSION "@FULL_VERSION@" +#define AWS_IOT_DEVICE_SDK_CPP_V2_DISCOVERY_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_DISCOVERY_VERSION_MINOR @PROJECT_VERSION_MINOR@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_DISCOVERY_VERSION_PATCH @PROJECT_VERSION_PATCH@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_DISCOVERY_GIT_HASH "@GIT_HASH@" diff --git a/eventstream_rpc/CMakeLists.txt b/eventstream_rpc/CMakeLists.txt index 9904496d3..193d4173b 100644 --- a/eventstream_rpc/CMakeLists.txt +++ b/eventstream_rpc/CMakeLists.txt @@ -1,10 +1,6 @@ cmake_minimum_required(VERSION 3.9) -project(EventstreamRpc-cpp LANGUAGES CXX) -if (DEFINED SIMPLE_VERSION) - message("EventStreamRPC version is ${SIMPLE_VERSION}") - set(PROJECT_VERSION ${SIMPLE_VERSION}) -endif() +project(EventstreamRpc-cpp LANGUAGES CXX VERSION ${SIMPLE_VERSION}) set(RUNTIME_DIRECTORY bin) @@ -18,6 +14,11 @@ elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR) endif() endif() +set(GENERATED_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated") +set(GENERATED_INCLUDE_DIR "${GENERATED_ROOT_DIR}/include") +set(GENERATED_CONFIG_HEADER "${GENERATED_INCLUDE_DIR}/aws/eventstreamrpc/Config.h") +configure_file(include/aws/eventstreamrpc/Config.h.in ${GENERATED_CONFIG_HEADER} @ONLY) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake") if (NOT CMAKE_CXX_STANDARD) @@ -26,6 +27,7 @@ endif() file(GLOB AWS_EVENTSTREAMRPC_HEADERS "include/aws/eventstreamrpc/*.h" + ${GENERATED_CONFIG_HEADER} ) file(GLOB AWS_EVENTSTREAMRPC_SRC diff --git a/eventstream_rpc/include/aws/eventstreamrpc/Config.h.in b/eventstream_rpc/include/aws/eventstreamrpc/Config.h.in new file mode 100644 index 000000000..3a5b25844 --- /dev/null +++ b/eventstream_rpc/include/aws/eventstreamrpc/Config.h.in @@ -0,0 +1,11 @@ +#pragma once +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#define AWS_IOT_DEVICE_SDK_CPP_V2_EVENTSTREAMRPC_VERSION "@FULL_VERSION@" +#define AWS_IOT_DEVICE_SDK_CPP_V2_EVENTSTREAMRPC_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_EVENTSTREAMRPC_VERSION_MINOR @PROJECT_VERSION_MINOR@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_EVENTSTREAMRPC_VERSION_PATCH @PROJECT_VERSION_PATCH@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_EVENTSTREAMRPC_GIT_HASH "@GIT_HASH@" diff --git a/greengrass_ipc/CMakeLists.txt b/greengrass_ipc/CMakeLists.txt index 911650ec9..890c8c188 100644 --- a/greengrass_ipc/CMakeLists.txt +++ b/greengrass_ipc/CMakeLists.txt @@ -1,10 +1,6 @@ cmake_minimum_required(VERSION 3.9) -project(GreengrassIpc-cpp LANGUAGES CXX) -if (DEFINED SIMPLE_VERSION) - message("GreengrassIpc version is ${SIMPLE_VERSION}") - set(PROJECT_VERSION ${SIMPLE_VERSION}) -endif() +project(GreengrassIpc-cpp LANGUAGES CXX VERSION ${SIMPLE_VERSION}) set(RUNTIME_DIRECTORY bin) @@ -18,6 +14,11 @@ elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR) endif() endif() +set(GENERATED_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated") +set(GENERATED_INCLUDE_DIR "${GENERATED_ROOT_DIR}/include") +set(GENERATED_CONFIG_HEADER "${GENERATED_INCLUDE_DIR}/aws/greengrass/Config.h") +configure_file(include/aws/greengrass/Config.h.in ${GENERATED_CONFIG_HEADER} @ONLY) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake") if (NOT CMAKE_CXX_STANDARD) @@ -26,6 +27,7 @@ endif() file(GLOB AWS_GREENGRASSIPC_HEADERS "include/aws/greengrass/*.h" + ${GENERATED_CONFIG_HEADER} ) file(GLOB AWS_GREENGRASSIPC_SRC diff --git a/greengrass_ipc/include/aws/greengrass/Config.h.in b/greengrass_ipc/include/aws/greengrass/Config.h.in new file mode 100644 index 000000000..9518e0364 --- /dev/null +++ b/greengrass_ipc/include/aws/greengrass/Config.h.in @@ -0,0 +1,11 @@ +#pragma once +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#define AWS_IOT_DEVICE_SDK_CPP_V2_GREENGRASS_VERSION "@FULL_VERSION@" +#define AWS_IOT_DEVICE_SDK_CPP_V2_GREENGRASS_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_GREENGRASS_VERSION_MINOR @PROJECT_VERSION_MINOR@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_GREENGRASS_VERSION_PATCH @PROJECT_VERSION_PATCH@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_GREENGRASS_GIT_HASH "@GIT_HASH@" diff --git a/identity/CMakeLists.txt b/identity/CMakeLists.txt index 6a29bfaaf..09ea945a5 100644 --- a/identity/CMakeLists.txt +++ b/identity/CMakeLists.txt @@ -2,11 +2,7 @@ cmake_minimum_required(VERSION 3.9) -project(IotIdentity-cpp LANGUAGES CXX) -if (DEFINED SIMPLE_VERSION) - message("IotIdentity version is ${SIMPLE_VERSION}") - set(PROJECT_VERSION ${SIMPLE_VERSION}) -endif() +project(IotIdentity-cpp LANGUAGES CXX VERSION ${SIMPLE_VERSION}) set(RUNTIME_DIRECTORY bin) @@ -20,6 +16,11 @@ elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR) endif() endif() +set(GENERATED_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated") +set(GENERATED_INCLUDE_DIR "${GENERATED_ROOT_DIR}/include") +set(GENERATED_CONFIG_HEADER "${GENERATED_INCLUDE_DIR}/aws/iotidentity/Config.h") +configure_file(include/aws/iotidentity/Config.h.in ${GENERATED_CONFIG_HEADER} @ONLY) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake") if (NOT CMAKE_CXX_STANDARD) @@ -28,6 +29,7 @@ endif() file(GLOB AWS_IOTIDENTITY_HEADERS "include/aws/iotidentity/*.h" + ${GENERATED_CONFIG_HEADER} ) file(GLOB AWS_IOTIDENTITY_SRC diff --git a/identity/include/aws/iotidentity/Config.h.in b/identity/include/aws/iotidentity/Config.h.in new file mode 100644 index 000000000..b3f4cfb13 --- /dev/null +++ b/identity/include/aws/iotidentity/Config.h.in @@ -0,0 +1,11 @@ +#pragma once +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTIDENTITY_VERSION "@FULL_VERSION@" +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTIDENTITY_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTIDENTITY_VERSION_MINOR @PROJECT_VERSION_MINOR@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTIDENTITY_VERSION_PATCH @PROJECT_VERSION_PATCH@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTIDENTITY_GIT_HASH "@GIT_HASH@" diff --git a/iotdevicecommon/CMakeLists.txt b/iotdevicecommon/CMakeLists.txt index a4fb4e0fc..9ab28e8b0 100644 --- a/iotdevicecommon/CMakeLists.txt +++ b/iotdevicecommon/CMakeLists.txt @@ -1,10 +1,6 @@ cmake_minimum_required(VERSION 3.9) -project(IotDeviceCommon-cpp LANGUAGES CXX) -if (DEFINED SIMPLE_VERSION) - message("IoT Device Common version is ${SIMPLE_VERSION}") - set(PROJECT_VERSION ${SIMPLE_VERSION}) -endif() +project(IotDeviceCommon-cpp LANGUAGES CXX VERSION ${SIMPLE_VERSION}) set(RUNTIME_DIRECTORY bin) @@ -18,6 +14,11 @@ elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR) endif() endif() +set(GENERATED_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated") +set(GENERATED_INCLUDE_DIR "${GENERATED_ROOT_DIR}/include") +set(GENERATED_CONFIG_HEADER "${GENERATED_INCLUDE_DIR}/aws/iotdevicecommon/Config.h") +configure_file(include/aws/iotdevicecommon/Config.h.in ${GENERATED_CONFIG_HEADER} @ONLY) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake") if (NOT CMAKE_CXX_STANDARD) @@ -26,6 +27,7 @@ endif() file(GLOB AWS_IOTDEVICECOMMON_HEADERS "include/aws/iotdevicecommon/*.h" + ${GENERATED_CONFIG_HEADER} ) file(GLOB AWS_IOTDEVICECOMMON_SRC diff --git a/iotdevicecommon/include/aws/iotdevicecommon/Config.h.in b/iotdevicecommon/include/aws/iotdevicecommon/Config.h.in new file mode 100644 index 000000000..7b9827ba5 --- /dev/null +++ b/iotdevicecommon/include/aws/iotdevicecommon/Config.h.in @@ -0,0 +1,11 @@ +#pragma once +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTDEVICECOMMON_VERSION "@FULL_VERSION@" +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTDEVICECOMMON_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTDEVICECOMMON_VERSION_MINOR @PROJECT_VERSION_MINOR@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTDEVICECOMMON_VERSION_PATCH @PROJECT_VERSION_PATCH@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTDEVICECOMMON_GIT_HASH "@GIT_HASH@" diff --git a/jobs/CMakeLists.txt b/jobs/CMakeLists.txt index 79b62ea0e..5f436f8ec 100644 --- a/jobs/CMakeLists.txt +++ b/jobs/CMakeLists.txt @@ -2,11 +2,7 @@ cmake_minimum_required(VERSION 3.9) -project(IotJobs-cpp LANGUAGES CXX) -if (DEFINED SIMPLE_VERSION) - message("IotJobs version is ${SIMPLE_VERSION}") - set(PROJECT_VERSION ${SIMPLE_VERSION}) -endif() +project(IotJobs-cpp LANGUAGES CXX VERSION ${SIMPLE_VERSION}) set(RUNTIME_DIRECTORY bin) @@ -20,6 +16,11 @@ elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR) endif() endif() +set(GENERATED_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated") +set(GENERATED_INCLUDE_DIR "${GENERATED_ROOT_DIR}/include") +set(GENERATED_CONFIG_HEADER "${GENERATED_INCLUDE_DIR}/aws/iotjobs/Config.h") +configure_file(include/aws/iotjobs/Config.h.in ${GENERATED_CONFIG_HEADER} @ONLY) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake") if (NOT CMAKE_CXX_STANDARD) @@ -28,6 +29,7 @@ endif() file(GLOB AWS_IOTJOBS_HEADERS "include/aws/iotjobs/*.h" + ${GENERATED_CONFIG_HEADER} ) file(GLOB AWS_IOTJOBS_SRC diff --git a/jobs/include/aws/iotjobs/Config.h.in b/jobs/include/aws/iotjobs/Config.h.in new file mode 100644 index 000000000..747f13316 --- /dev/null +++ b/jobs/include/aws/iotjobs/Config.h.in @@ -0,0 +1,11 @@ +#pragma once +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTJOBS_VERSION "@FULL_VERSION@" +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTJOBS_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTJOBS_VERSION_MINOR @PROJECT_VERSION_MINOR@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTJOBS_VERSION_PATCH @PROJECT_VERSION_PATCH@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTJOBS_GIT_HASH "@GIT_HASH@" diff --git a/secure_tunneling/CMakeLists.txt b/secure_tunneling/CMakeLists.txt index 3a5cb08e6..5b15026b6 100644 --- a/secure_tunneling/CMakeLists.txt +++ b/secure_tunneling/CMakeLists.txt @@ -1,10 +1,6 @@ cmake_minimum_required(VERSION 3.9) -project(IotSecureTunneling-cpp LANGUAGES CXX) -if (DEFINED SIMPLE_VERSION) - message("Secure Tunneling version is ${SIMPLE_VERSION}") - set(PROJECT_VERSION ${SIMPLE_VERSION}) -endif() +project(IotSecureTunneling-cpp LANGUAGES CXX VERSION ${SIMPLE_VERSION}) set(RUNTIME_DIRECTORY bin) @@ -18,6 +14,11 @@ elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR) endif() endif() +set(GENERATED_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated") +set(GENERATED_INCLUDE_DIR "${GENERATED_ROOT_DIR}/include") +set(GENERATED_CONFIG_HEADER "${GENERATED_INCLUDE_DIR}/aws/iotsecuretunneling/Config.h") +configure_file(include/aws/iotsecuretunneling/Config.h.in ${GENERATED_CONFIG_HEADER} @ONLY) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake") if (NOT CMAKE_CXX_STANDARD) @@ -26,6 +27,7 @@ endif() file(GLOB AWS_IOTSECURETUNNELING_HEADERS "include/aws/iotsecuretunneling/*.h" + ${GENERATED_CONFIG_HEADER} ) file(GLOB AWS_IOTSECURETUNNELING_SRC diff --git a/secure_tunneling/include/aws/iotsecuretunneling/Config.h.in b/secure_tunneling/include/aws/iotsecuretunneling/Config.h.in new file mode 100644 index 000000000..d11e602bc --- /dev/null +++ b/secure_tunneling/include/aws/iotsecuretunneling/Config.h.in @@ -0,0 +1,11 @@ +#pragma once +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTSECURETUNNELING_VERSION "@FULL_VERSION@" +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTSECURETUNNELING_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTSECURETUNNELING_VERSION_MINOR @PROJECT_VERSION_MINOR@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTSECURETUNNELING_VERSION_PATCH @PROJECT_VERSION_PATCH@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTSECURETUNNELING_GIT_HASH "@GIT_HASH@" diff --git a/shadow/CMakeLists.txt b/shadow/CMakeLists.txt index 837c79fc2..1f717b8c5 100644 --- a/shadow/CMakeLists.txt +++ b/shadow/CMakeLists.txt @@ -2,11 +2,7 @@ cmake_minimum_required(VERSION 3.9) -project(IotShadow-cpp LANGUAGES CXX) -if (DEFINED SIMPLE_VERSION) - message("IotShadow version is ${SIMPLE_VERSION}") - set(PROJECT_VERSION ${SIMPLE_VERSION}) -endif() +project(IotShadow-cpp LANGUAGES CXX VERSION ${SIMPLE_VERSION}) set(RUNTIME_DIRECTORY bin) @@ -20,6 +16,11 @@ elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR) endif() endif() +set(GENERATED_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated") +set(GENERATED_INCLUDE_DIR "${GENERATED_ROOT_DIR}/include") +set(GENERATED_CONFIG_HEADER "${GENERATED_INCLUDE_DIR}/aws/iotshadow/Config.h") +configure_file(include/aws/iotshadow/Config.h.in ${GENERATED_CONFIG_HEADER} @ONLY) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake") if (NOT CMAKE_CXX_STANDARD) @@ -28,6 +29,7 @@ endif() file(GLOB AWS_IOTSHADOW_HEADERS "include/aws/iotshadow/*.h" + ${GENERATED_CONFIG_HEADER} ) file(GLOB AWS_IOTSHADOW_SRC diff --git a/shadow/include/aws/iotshadow/Config.h.in b/shadow/include/aws/iotshadow/Config.h.in new file mode 100644 index 000000000..66d133a2c --- /dev/null +++ b/shadow/include/aws/iotshadow/Config.h.in @@ -0,0 +1,11 @@ +#pragma once +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTSHADOW_VERSION "@FULL_VERSION@" +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTSHADOW_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTSHADOW_VERSION_MINOR @PROJECT_VERSION_MINOR@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTSHADOW_VERSION_PATCH @PROJECT_VERSION_PATCH@ +#define AWS_IOT_DEVICE_SDK_CPP_V2_IOTSHADOW_GIT_HASH "@GIT_HASH@"