Skip to content

Commit a003c9d

Browse files
committed
cmake: refine cmake target name for better integration
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]>
1 parent 0c7a279 commit a003c9d

File tree

6 files changed

+39
-39
lines changed

6 files changed

+39
-39
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ file(STRINGS "VERSION" version)
2424
project(alibabacloud-oss-cpp-sdk VERSION ${version})
2525
message(STATUS "Project version: ${PROJECT_VERSION}")
2626
set(SDK_ROOT "${CMAKE_CURRENT_SOURCE_DIR}")
27-
set(TARGET_OUTPUT_NAME_PREFIX "alibabacloud-oss-" CACHE STRING "The target's output name prefix")
27+
set(TARGET_OUTPUT_NAME_PREFIX "alibabacloud-" CACHE STRING "The target's output name prefix")
2828

2929
#Options
3030
option(BUILD_SHARED_LIBS "Enable shared library" OFF)

ptest/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
project(cpp-sdk-ptest VERSION ${version})
16+
project(oss-cpp-sdk-ptest VERSION ${version})
1717

1818
file(GLOB ptest_src "src/*")
1919

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

26-
target_link_libraries(${PROJECT_NAME} cpp-sdk${STATIC_LIB_SUFFIX})
26+
target_link_libraries(${PROJECT_NAME} oss-cpp-sdk${STATIC_LIB_SUFFIX})
2727
target_link_libraries(${PROJECT_NAME} ${CRYPTO_LIBS})
2828
target_link_libraries(${PROJECT_NAME} ${CLIENT_LIBS})
2929
if (${TARGET_OS} STREQUAL "LINUX")

sample/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
project(cpp-sdk-sample VERSION ${version})
16+
project(oss-cpp-sdk-sample VERSION ${version})
1717

1818
file(GLOB sample_src "src/*")
1919

@@ -45,7 +45,7 @@ add_executable(${PROJECT_NAME}
4545
target_include_directories(${PROJECT_NAME}
4646
PRIVATE ${CMAKE_SOURCE_DIR}/sdk/include)
4747

48-
target_link_libraries(${PROJECT_NAME} cpp-sdk)
48+
target_link_libraries(${PROJECT_NAME} oss-cpp-sdk)
4949
target_link_libraries(${PROJECT_NAME} ${CRYPTO_LIBS})
5050
target_link_libraries(${PROJECT_NAME} ${CLIENT_LIBS})
5151
if (${TARGET_OS} STREQUAL "LINUX")
@@ -59,4 +59,4 @@ install(TARGETS ${PROJECT_NAME}
5959
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
6060
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
6161
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
62-
)
62+
)

sdk/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# limitations under the License.
1515
#
1616

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

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

@@ -220,4 +220,4 @@ install(TARGETS ${PROJECT_NAME}
220220
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
221221
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
222222
)
223-
endif()
223+
endif()
Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
/*
2-
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
17-
#pragma once
18-
19-
// version = (major << 16) + (minor << 8) + patch
20-
#define ALIBABACLOUD_OSS_VERSION ((1 << 16) + (9 << 8) + 0)
21-
22-
#define ALIBABACLOUD_OSS_VERSION_STR "1.9.0"
23-
24-
// auto generated by cmake option
25-
/* #undef OSS_DISABLE_BUCKET */
26-
/* #undef OSS_DISABLE_LIVECHANNEL */
27-
/* #undef OSS_DISABLE_RESUAMABLE */
28-
/* #undef OSS_DISABLE_ENCRYPTION */
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#pragma once
18+
19+
// version = (major << 16) + (minor << 8) + patch
20+
#define ALIBABACLOUD_OSS_VERSION ((1 << 16) + (9 << 8) + 0)
21+
22+
#define ALIBABACLOUD_OSS_VERSION_STR "1.9.0"
23+
24+
// auto generated by cmake option
25+
/* #undef OSS_DISABLE_BUCKET */
26+
/* #undef OSS_DISABLE_LIVECHANNEL */
27+
/* #undef OSS_DISABLE_RESUAMABLE */
28+
/* #undef OSS_DISABLE_ENCRYPTION */

test/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
project(cpp-sdk-test VERSION ${version})
16+
project(oss-cpp-sdk-test VERSION ${version})
1717

1818
file(GLOB test_gtest_src "external/gtest/*")
1919
file(GLOB test_main_src "src/*")
@@ -52,7 +52,7 @@ target_include_directories(${PROJECT_NAME}
5252
PRIVATE ${CMAKE_SOURCE_DIR}/third_party/include)
5353
endif()
5454

55-
target_link_libraries(${PROJECT_NAME} cpp-sdk${STATIC_LIB_SUFFIX})
55+
target_link_libraries(${PROJECT_NAME} oss-cpp-sdk${STATIC_LIB_SUFFIX})
5656
target_link_libraries(${PROJECT_NAME} ${CRYPTO_LIBS})
5757
target_link_libraries(${PROJECT_NAME} ${CLIENT_LIBS})
5858
if (${TARGET_OS} STREQUAL "LINUX")
@@ -65,4 +65,4 @@ target_compile_options(${PROJECT_NAME}
6565
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
6666
target_compile_options(${PROJECT_NAME}
6767
PRIVATE "-Wno-invalid-source-encoding")
68-
endif()
68+
endif()

0 commit comments

Comments
 (0)