Skip to content

Commit

Permalink
cmake: refine cmake target name for better integration
Browse files Browse the repository at this point in the history
The previous target name is `cpp-sdk` which is quite confusing for
higher level applications. We should rename the target name with
`oss-cpp-sdk` and thus all related CMake scrips should be also changed.

Signed-off-by: Kuankuan Guo <[email protected]>
  • Loading branch information
royguo committed Sep 6, 2021
1 parent 0c7a279 commit a003c9d
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ file(STRINGS "VERSION" version)
project(alibabacloud-oss-cpp-sdk VERSION ${version})
message(STATUS "Project version: ${PROJECT_VERSION}")
set(SDK_ROOT "${CMAKE_CURRENT_SOURCE_DIR}")
set(TARGET_OUTPUT_NAME_PREFIX "alibabacloud-oss-" CACHE STRING "The target's output name prefix")
set(TARGET_OUTPUT_NAME_PREFIX "alibabacloud-" CACHE STRING "The target's output name prefix")

#Options
option(BUILD_SHARED_LIBS "Enable shared library" OFF)
Expand Down
4 changes: 2 additions & 2 deletions ptest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
project(cpp-sdk-ptest VERSION ${version})
project(oss-cpp-sdk-ptest VERSION ${version})

file(GLOB ptest_src "src/*")

Expand All @@ -23,7 +23,7 @@ add_executable(${PROJECT_NAME} ${ptest_src})
target_include_directories(${PROJECT_NAME}
PRIVATE ${CMAKE_SOURCE_DIR}/sdk/include)

target_link_libraries(${PROJECT_NAME} cpp-sdk${STATIC_LIB_SUFFIX})
target_link_libraries(${PROJECT_NAME} oss-cpp-sdk${STATIC_LIB_SUFFIX})
target_link_libraries(${PROJECT_NAME} ${CRYPTO_LIBS})
target_link_libraries(${PROJECT_NAME} ${CLIENT_LIBS})
if (${TARGET_OS} STREQUAL "LINUX")
Expand Down
6 changes: 3 additions & 3 deletions sample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
project(cpp-sdk-sample VERSION ${version})
project(oss-cpp-sdk-sample VERSION ${version})

file(GLOB sample_src "src/*")

Expand Down Expand Up @@ -45,7 +45,7 @@ add_executable(${PROJECT_NAME}
target_include_directories(${PROJECT_NAME}
PRIVATE ${CMAKE_SOURCE_DIR}/sdk/include)

target_link_libraries(${PROJECT_NAME} cpp-sdk)
target_link_libraries(${PROJECT_NAME} oss-cpp-sdk)
target_link_libraries(${PROJECT_NAME} ${CRYPTO_LIBS})
target_link_libraries(${PROJECT_NAME} ${CLIENT_LIBS})
if (${TARGET_OS} STREQUAL "LINUX")
Expand All @@ -59,4 +59,4 @@ install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
)
4 changes: 2 additions & 2 deletions sdk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#

project(cpp-sdk VERSION ${version})
project(oss-cpp-sdk VERSION ${version})

configure_file(src/Config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/include/alibabacloud/oss/Config.h @ONLY)

Expand Down Expand Up @@ -220,4 +220,4 @@ install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
endif()
endif()
56 changes: 28 additions & 28 deletions sdk/include/alibabacloud/oss/Config.h
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

// version = (major << 16) + (minor << 8) + patch
#define ALIBABACLOUD_OSS_VERSION ((1 << 16) + (9 << 8) + 0)

#define ALIBABACLOUD_OSS_VERSION_STR "1.9.0"

// auto generated by cmake option
/* #undef OSS_DISABLE_BUCKET */
/* #undef OSS_DISABLE_LIVECHANNEL */
/* #undef OSS_DISABLE_RESUAMABLE */
/* #undef OSS_DISABLE_ENCRYPTION */
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

// version = (major << 16) + (minor << 8) + patch
#define ALIBABACLOUD_OSS_VERSION ((1 << 16) + (9 << 8) + 0)

#define ALIBABACLOUD_OSS_VERSION_STR "1.9.0"

// auto generated by cmake option
/* #undef OSS_DISABLE_BUCKET */
/* #undef OSS_DISABLE_LIVECHANNEL */
/* #undef OSS_DISABLE_RESUAMABLE */
/* #undef OSS_DISABLE_ENCRYPTION */
6 changes: 3 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
project(cpp-sdk-test VERSION ${version})
project(oss-cpp-sdk-test VERSION ${version})

file(GLOB test_gtest_src "external/gtest/*")
file(GLOB test_main_src "src/*")
Expand Down Expand Up @@ -52,7 +52,7 @@ target_include_directories(${PROJECT_NAME}
PRIVATE ${CMAKE_SOURCE_DIR}/third_party/include)
endif()

target_link_libraries(${PROJECT_NAME} cpp-sdk${STATIC_LIB_SUFFIX})
target_link_libraries(${PROJECT_NAME} oss-cpp-sdk${STATIC_LIB_SUFFIX})
target_link_libraries(${PROJECT_NAME} ${CRYPTO_LIBS})
target_link_libraries(${PROJECT_NAME} ${CLIENT_LIBS})
if (${TARGET_OS} STREQUAL "LINUX")
Expand All @@ -65,4 +65,4 @@ target_compile_options(${PROJECT_NAME}
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(${PROJECT_NAME}
PRIVATE "-Wno-invalid-source-encoding")
endif()
endif()

0 comments on commit a003c9d

Please sign in to comment.