Skip to content

Place generated files in CMAKE_BINARY_DIR. #3459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 2 additions & 3 deletions cmake/initialize_project_version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ if(GIT_FOUND)
endif()

if(NOT VERSION_STRING)
# extract it from the existing generated header file
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/src/aws-cpp-sdk-core/include/aws/core/VersionConfig.h" __SDK_VERSION_LINE LIMIT_COUNT 1 REGEX "AWS_SDK_VERSION_STRING.*[0-9]+\\.[0-9]+\\.[0-9]+" )
string( REGEX MATCH "([0-9]+\\.[0-9]+\\.[0-9]+)" VERSION_STRING "${__SDK_VERSION_LINE}" )
# read it from the version file
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" VERSION_STRING)
endif()

set(PROJECT_VERSION "${VERSION_STRING}")
Expand Down
11 changes: 7 additions & 4 deletions src/aws-cpp-sdk-core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if(VERSION_STRING)
set(AWSSDK_VERSION_PATCH ${AWSSDK_VERSION_PATCH})
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/include/aws/core/VersionConfig.h.in"
"${CMAKE_CURRENT_SOURCE_DIR}/include/aws/core/VersionConfig.h"
"${CMAKE_CURRENT_BINARY_DIR}/include/aws/core/VersionConfig.h"
NEWLINE_STYLE UNIX)
else()
message("Not able to compute versioning string, not updating.")
Expand All @@ -38,7 +38,7 @@ else()
endif()

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/include/aws/core/SDKConfig.h.in"
"${CMAKE_CURRENT_SOURCE_DIR}/include/aws/core/SDKConfig.h"
"${CMAKE_CURRENT_BINARY_DIR}/include/aws/core/SDKConfig.h"
NEWLINE_STYLE UNIX)

file(GLOB AWS_HEADERS "include/aws/core/*.h")
Expand Down Expand Up @@ -93,6 +93,8 @@ file(GLOB SMITHY_IDENTITY_SIGNER_BUILTIN_HEADERS "include/smithy/identity/signer
file(GLOB SMITHY_INTERCEPTOR_HEADERS "include/smithy/interceptor/*.h")
file(GLOB SMITHY_INTERCEPTOR_IMPL_HEADERS "include/smithy/interceptor/impl/*.h")

file(GLOB AWS_GENERATED_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/include/aws/core/*.h")

file(GLOB AWS_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp")
file(GLOB AWS_TINYXML2_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/source/external/tinyxml2/*.cpp")
file(GLOB CJSON_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/source/external/cjson/*.cpp")
Expand Down Expand Up @@ -383,7 +385,7 @@ file(GLOB AWS_NATIVE_SDK_SRC

# Visual studio project directory structure
if(MSVC)
source_group("Header Files\\aws\\core" FILES ${AWS_HEADERS})
source_group("Header Files\\aws\\core" FILES ${AWS_HEADERS} ${AWS_GENERATED_HEADERS})
source_group("Header Files\\aws\\core\\auth" FILES ${AWS_AUTH_HEADERS})
source_group("Header Files\\aws\\core\\auth\\signer" FILES ${AWS_AUTH_SIGNER_HEADERS})
source_group("Header Files\\aws\\core\\auth\\signer-provider" FILES ${AWS_AUTH_SIGNER_PROVIDER_HEADERS})
Expand Down Expand Up @@ -591,6 +593,7 @@ endif()

target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>)

if (EXTERNAL_DEPS_INCLUDE_DIRS)
Expand Down Expand Up @@ -663,7 +666,7 @@ if(SIMPLE_INSTALL)
endif()
endif()

install (FILES ${AWS_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/aws/core)
install (FILES ${AWS_HEADERS} ${AWS_GENERATED_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/aws/core)
install (FILES ${AWS_AUTH_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/aws/core/auth)
install (FILES ${AWS_AUTH_SIGNER_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/aws/core/auth/signer)
install (FILES ${AWS_AUTH_SIGNER_PROVIDER_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/aws/core/auth/signer-provider)
Expand Down
10 changes: 0 additions & 10 deletions src/aws-cpp-sdk-core/include/aws/core/VersionConfig.h

This file was deleted.