代码拉取完成,页面将自动刷新
# This file is part of test-drive.
# SPDX-Identifier: Apache-2.0 OR MIT
#
# Licensed under either of Apache License, Version 2.0 or MIT license
# at your option; you may not use this file except in compliance with
# the License.
#
# 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.
cmake_minimum_required(VERSION 3.9)
get_directory_property(is-subproject PARENT_DIRECTORY)
project(
"test-drive"
LANGUAGES "Fortran"
VERSION "0.5.0"
DESCRIPTION "The simple testing framework"
)
# Follow GNU conventions for installing directories
include(GNUInstallDirs)
# General configuration information
add_subdirectory("config")
# Collect source of the project
set(srcs)
add_subdirectory("src")
# We need the module directory before we finish the configure stage
if(NOT EXISTS "${PROJECT_BINARY_DIR}/include")
make_directory("${PROJECT_BINARY_DIR}/include")
endif()
# Testing library target
add_library(
"${PROJECT_NAME}-lib"
"${srcs}"
)
set_target_properties(
"${PROJECT_NAME}-lib"
PROPERTIES
POSITION_INDEPENDENT_CODE TRUE
OUTPUT_NAME "${PROJECT_NAME}"
VERSION "${PROJECT_VERSION}"
SOVERSION "${PROJECT_VERSION_MAJOR}"
Fortran_MODULE_DIRECTORY "${PROJECT_BINARY_DIR}/include"
)
target_include_directories(
"${PROJECT_NAME}-lib"
PUBLIC
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${module-dir}>
)
target_compile_definitions(
"${PROJECT_NAME}-lib"
PRIVATE
"WITH_QP=$<BOOL:${WITH_QP}>"
"WITH_XDP=$<BOOL:${WITH_XDP}>"
)
# Export targets for other projects
add_library("${PROJECT_NAME}" INTERFACE)
target_link_libraries("${PROJECT_NAME}" INTERFACE "${PROJECT_NAME}-lib")
install(
TARGETS
"${PROJECT_NAME}"
"${PROJECT_NAME}-lib"
EXPORT
"${PROJECT_NAME}-targets"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
install(
EXPORT
"${PROJECT_NAME}-targets"
NAMESPACE
"${PROJECT_NAME}::"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
)
install(
DIRECTORY
"${PROJECT_BINARY_DIR}/include/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${module-dir}"
)
# Package license files
install(
FILES
"LICENSE-Apache"
"LICENSE-MIT"
DESTINATION "${CMAKE_INSTALL_DATADIR}/licenses/${PROJECT_NAME}"
)
# add the testsuite
include(CTest)
if(BUILD_TESTING AND TEST_DRIVE_BUILD_TESTING)
add_subdirectory("test")
endif()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。