Files
aliyun-openapi-cpp-sdk/ivpd/CMakeLists.txt
2019-09-18 11:18:56 +08:00

114 lines
3.8 KiB
CMake

#
# 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.
#
set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include)
set(ivpd_public_header
include/alibabacloud/ivpd/IvpdClient.h
include/alibabacloud/ivpd/IvpdExport.h )
set(ivpd_public_header_model
include/alibabacloud/ivpd/model/ChangeImageSizeRequest.h
include/alibabacloud/ivpd/model/ChangeImageSizeResult.h
include/alibabacloud/ivpd/model/DetectImageElementsRequest.h
include/alibabacloud/ivpd/model/DetectImageElementsResult.h
include/alibabacloud/ivpd/model/ExtendImageStyleRequest.h
include/alibabacloud/ivpd/model/ExtendImageStyleResult.h
include/alibabacloud/ivpd/model/MakeSuperResolutionImageRequest.h
include/alibabacloud/ivpd/model/MakeSuperResolutionImageResult.h
include/alibabacloud/ivpd/model/RecognizeImageColorRequest.h
include/alibabacloud/ivpd/model/RecognizeImageColorResult.h
include/alibabacloud/ivpd/model/RecognizeImageStyleRequest.h
include/alibabacloud/ivpd/model/RecognizeImageStyleResult.h
include/alibabacloud/ivpd/model/RecolorImageRequest.h
include/alibabacloud/ivpd/model/RecolorImageResult.h
include/alibabacloud/ivpd/model/SegmentImageRequest.h
include/alibabacloud/ivpd/model/SegmentImageResult.h )
set(ivpd_src
src/IvpdClient.cc
src/model/ChangeImageSizeRequest.cc
src/model/ChangeImageSizeResult.cc
src/model/DetectImageElementsRequest.cc
src/model/DetectImageElementsResult.cc
src/model/ExtendImageStyleRequest.cc
src/model/ExtendImageStyleResult.cc
src/model/MakeSuperResolutionImageRequest.cc
src/model/MakeSuperResolutionImageResult.cc
src/model/RecognizeImageColorRequest.cc
src/model/RecognizeImageColorResult.cc
src/model/RecognizeImageStyleRequest.cc
src/model/RecognizeImageStyleResult.cc
src/model/RecolorImageRequest.cc
src/model/RecolorImageResult.cc
src/model/SegmentImageRequest.cc
src/model/SegmentImageResult.cc )
add_library(ivpd ${LIB_TYPE}
${ivpd_public_header}
${ivpd_public_header_model}
${ivpd_src})
set_target_properties(ivpd
PROPERTIES
LINKER_LANGUAGE CXX
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}ivpd
)
if(${LIB_TYPE} STREQUAL "SHARED")
set_target_properties(ivpd
PROPERTIES
DEFINE_SYMBOL ALIBABACLOUD_IVPD_LIBRARY)
endif()
target_include_directories(ivpd
PRIVATE include
${CMAKE_SOURCE_DIR}/core/include
)
target_link_libraries(ivpd
core)
if(CMAKE_HOST_WIN32)
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
set(jsoncpp_install_dir ${INSTALL_DIR})
add_dependencies(ivpd
jsoncpp)
target_include_directories(ivpd
PRIVATE ${jsoncpp_install_dir}/include)
target_link_libraries(ivpd
${jsoncpp_install_dir}/lib/jsoncpp.lib)
set_target_properties(ivpd
PROPERTIES
COMPILE_OPTIONS "/bigobj")
else()
target_include_directories(ivpd
PRIVATE /usr/include/jsoncpp)
target_link_libraries(ivpd
jsoncpp)
endif()
install(FILES ${ivpd_public_header}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/ivpd)
install(FILES ${ivpd_public_header_model}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/ivpd/model)
install(TARGETS ivpd
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)