###########################################################################
#
# Library: CTK
#
# Copyright (c) Kitware Inc.
#
# 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.txt
#
# 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.0)
foreach(p
CMP0054 # CMake 3.1
CMP0020 # CMake 2.8.11
)
if(POLICY ${p})
cmake_policy(SET ${p} NEW)
endif()
endforeach()
#-----------------------------------------------------------------------------
# Superbuild
#
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
set(SUPERBUILD_TOPLEVEL_PROJECT "CTK")
set(EXTERNAL_PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/CMakeExternals)
set(EXTERNAL_PROJECT_FILE_PREFIX "")
include(ExternalProject)
include(ctkMacroCheckExternalProjectDependency)
#-----------------------------------------------------------------------------
if(APPLE)
# Note: By setting CMAKE_OSX_* variables before any enable_language() or project() calls,
# we ensure that the bitness will be properly detected.
include(ctkBlockSetCMakeOSXVariables)
mark_as_superbuild(
VARS CMAKE_OSX_ARCHITECTURES:STRING CMAKE_OSX_SYSROOT:PATH CMAKE_OSX_DEPLOYMENT_TARGET:STRING
ALL_PROJECTS
)
endif()
#-----------------------------------------------------------------------------
project(CTK)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Set defaults
#
if(NOT DEFINED CMAKE_MACOSX_RPATH)
set(CMAKE_MACOSX_RPATH 1)
endif()
#-----------------------------------------------------------------------------
# Library mode: SHARED (default) or STATIC
#
set(CTK_LIBRARY_MODE "SHARED")
option(CTK_BUILD_SHARED_LIBS "Build CTK libraries as shared module." ON)
mark_as_advanced(CTK_BUILD_SHARED_LIBS)
mark_as_superbuild(CTK_BUILD_SHARED_LIBS)
if(NOT CTK_BUILD_SHARED_LIBS)
set(CTK_LIBRARY_MODE "STATIC")
endif()
#-----------------------------------------------------------------------------
# Set a default build type if none was specified
#
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
mark_as_advanced(CMAKE_BUILD_TYPE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
endif()
if(NOT CMAKE_CONFIGURATION_TYPES)
mark_as_superbuild(VARS CMAKE_BUILD_TYPE ALL_PROJECTS)
else()
mark_as_superbuild(VARS CMAKE_CONFIGURATION_TYPES ALL_PROJECTS)
endif()
mark_as_superbuild(
VARS
CMAKE_PREFIX_PATH:STRING
CMAKE_DEBUG_POSTFIX:STRING
ALL_PROJECTS
)
#-----------------------------------------------------------------------------
# Superbuild Option - Enabled by default
#
option(CTK_SUPERBUILD "Build ${PROJECT_NAME} and the projects it depends on." ON)
mark_as_advanced(CTK_SUPERBUILD)
#-----------------------------------------------------------------------------
# Output directories.
#
foreach(type LIBRARY RUNTIME ARCHIVE)
# Make sure the directory exists
if(DEFINED CTK_CMAKE_${type}_OUTPUT_DIRECTORY
AND NOT EXISTS ${CTK_CMAKE_${type}_OUTPUT_DIRECTORY})
message(FATAL_ERROR "CTK_CMAKE_${type}_OUTPUT_DIRECTORY is set to a non-existing directory [${CTK_CMAKE_${type}_OUTPUT_DIRECTORY}]")
endif()
if(CTK_SUPERBUILD)
set(output_dir ${CTK_BINARY_DIR}/bin)
if(NOT DEFINED CTK_CMAKE_${type}_OUTPUT_DIRECTORY)
set(CTK_CMAKE_${type}_OUTPUT_DIRECTORY ${CTK_BINARY_DIR}/CTK-build/bin)
endif()
mark_as_superbuild(CTK_CMAKE_${type}_OUTPUT_DIRECTORY:PATH)
else()
if(NOT DEFINED CTK_CMAKE_${type}_OUTPUT_DIRECTORY)
set(output_dir ${CTK_BINARY_DIR}/bin)
else()
set(output_dir ${CTK_CMAKE_${type}_OUTPUT_DIRECTORY})
endif()
endif()
set(CMAKE_${type}_OUTPUT_DIRECTORY ${output_dir} CACHE INTERNAL "Single output directory for building all libraries.")
if(NOT DEFINED CTK_PLUGIN_${type}_OUTPUT_DIRECTORY)
set(CTK_PLUGIN_${type}_OUTPUT_DIRECTORY ${CMAKE_${type}_OUTPUT_DIRECTORY})
endif()
endforeach()
#-----------------------------------------------------------------------------
# CTK version number. An even minor number corresponds to releases.
#
set(CTK_MAJOR_VERSION 0)
set(CTK_MINOR_VERSION 1)
set(CTK_PATCH_VERSION 0)
set(CTK_VERSION
"${CTK_MAJOR_VERSION}.${CTK_MINOR_VERSION}.${CTK_PATCH_VERSION}")
# Append the library version information to the library target
# properties. A parent project may set its own properties and/or may
# block this.
if(NOT CTK_NO_LIBRARY_VERSION)
set(CTK_LIBRARY_PROPERTIES ${CTK_LIBRARY_PROPERTIES}
VERSION "${CTK_VERSION}"
SOVERSION "${CTK_MAJOR_VERSION}.${CTK_MINOR_VERSION}"
)
endif()
#-----------------------------------------------------------------------------
# Install directories, used for install rules.
#
if(NOT CTK_INSTALL_BIN_DIR)
set(CTK_INSTALL_BIN_DIR "bin")
endif()
if(NOT CTK_INSTALL_LIB_DIR)
set(CTK_INSTALL_LIB_DIR "lib/ctk-${CTK_MAJOR_VERSION}.${CTK_MINOR_VERSION}")
endif()
if(NOT CTK_INSTALL_PLUGIN_DIR)
set(CTK_INSTALL_PLUGIN_DIR "lib/ctk-${CTK_MAJOR_VERSION}.${CTK_MINOR_VERSION}/plugins")
endif()
if(NOT CTK_INSTALL_CMAKE_DIR)
set(CTK_INSTALL_CMAKE_DIR "lib/ctk-${CTK_MAJOR_VERSION}.${CTK_MINOR_VERSION}/CMake")
endif()
if(NOT CTK_INSTALL_INCLUDE_DIR)
set(CTK_INSTALL_INCLUDE_DIR "include/ctk-${CTK_MAJOR_VERSION}.${CTK_MINOR_VERSION}")
endif()
if(NOT CTK_INSTALL_PLUGIN_INCLUDE_DIR)
set(CTK_INSTALL_PLUGIN_INCLUDE_DIR ${CTK_INSTALL_INCLUDE_DIR})
endif()
if(NOT CTK_INSTALL_QTPLUGIN_DIR)
set(CTK_INSTALL_QTPLUGIN_DIR ${CTK_INSTALL_LIB_DIR})
endif()
if(NOT CTK_INSTALL_DOC_DIR)
set(CTK_INSTALL_DOC_DIR "doc")
endif()
mark_as_superbuild(
CTK_INSTALL_BIN_DIR:STRING
CTK_INSTALL_LIB_DIR:STRING
CTK_INSTALL_PLUGIN_DIR:STRING
CTK_INSTALL_CMAKE_DIR:STRING
CTK_INSTALL_INCLUDE_DIR:STRING
CTK_INSTALL_PLUGIN_INCLUDE_DIR:STRING
CTK_INSTALL_QTPLUGIN_DIR:STRING
CTK_INSTALL_DOC_DIR:STRING
)
#-----------------------------------------------------------------------------
# Update CMake module path
# Note: FindXXX.cmake script specific to utility should be copied into Utilities/CMake
#
set(CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/Utilities/CMake"
${CMAKE_MODULE_PATH})
#-----------------------------------------------------------------------------
# Clear CTK_BASE_LIBRARIES and CTK_WRAPPED_LIBRARIES_PYTHONQT
#
set(CTK_BASE_LIBRARIES CACHE INTERNAL "CTK base libraries" FORCE)
set(CTK_WRAPPED_LIBRARIES_PYTHONQT CACHE INTERNAL "CTK libraries wrapped using PythonQt" FORCE)
# Variable use in CTKConfig.cmake.in
set(CTK_LIBRARIES CACHE INTERNAL "CTK libraries" FORCE)
set(${PROJECT_NAME}_PLUGIN_LIBRARIES CACHE INTERNAL "CTK plugins" FORCE)
# Used by CTKGenerateCTKConfig.cmake and also used to reference script from other scripts
set(CTK_CMAKE_DIR ${CTK_SOURCE_DIR}/CMake)
set(CTK_CMAKE_UTILITIES_DIR ${CTK_SOURCE_DIR}/Utilities/CMake)
#-----------------------------------------------------------------------------
# CMake function(s) and macro(s)
#
foreach(file
CMake/ctkListToString.cmake
CMake/ctkMacroParseArguments.cmake
CMake/ctkMacroSetPaths.cmake
CMake/ctkMacroListFilter.cmake
CMake/ctkMacroOptionUtils.cmake
CMake/ctkMacroBuildLib.cmake
CMake/ctkMacroBuildLibWrapper.cmake
CMake/ctkMacroBuildPlugin.cmake
CMa
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
CTK-master-src (2737个子文件)
ctkMacroCheckExternalProjectDependency.cmake 35KB
ctkMacroBuildPlugin.cmake 14KB
CMakePackageConfigHelpers.cmake 13KB
FindDCMTK.cmake 12KB
CTKGenerateCTKConfig.cmake 11KB
ctkMacroSetupPlugins.cmake 9KB
ctkMacroTargetLibraries.cmake 9KB
ctkDashboardDriverScript.cmake 8KB
ctkMacroValidateBuildOptions.cmake 8KB
ctkDashboardScript.TEMPLATE.cmake 7KB
ctkMacroBuildQtPlugin.cmake 7KB
ctkMacroBuildLibWrapper.cmake 7KB
ctkMacroBuildLib.cmake 6KB
ctkMacroCompilePythonScript.cmake 6KB
ctkMacroWrapPythonQt.cmake 6KB
ctkBlockCheckDependencies.cmake 6KB
ctkFunctionGenerateDGraphInput.cmake 5KB
ctkListToString.cmake 5KB
ctkMacroBuildApp.cmake 4KB
PythonQt.cmake 4KB
CMakeFindDependencyMacro.cmake 4KB
FindOpenIGTLink.cmake 4KB
ctkFunctionDownloadData.cmake 4KB
FindZMQ.cmake 3KB
ctkMacroSetupQt.cmake 3KB
ctkFunctionGeneratePluginManifest.cmake 3KB
ctkBlockSetCMakeOSXVariables.cmake 3KB
ctkMacroBFDCheck.cmake 3KB
ctkFunctionGetIncludeDirs.cmake 3KB
VTK.cmake 3KB
DCMTK.cmake 3KB
ctkFunctionCMakeDoxygenFilterCompile.cmake 3KB
QtTesting.cmake 3KB
ctkMacroOptionUtils.cmake 3KB
SuperBuild.cmake 3KB
ctkFunctionCompileSnippets.cmake 3KB
ctkLinkerAsNeededFlagCheck.cmake 2KB
ctkMacroSimpleTestWithData.cmake 2KB
ctkFunctionGeneratePluginUseFile.cmake 2KB
QtSOAP.cmake 2KB
FindPythonQt.cmake 2KB
ctkFunctionGetCompilerVisibilityFlags.cmake 2KB
ITK.cmake 2KB
qRestAPI.cmake 2KB
qxmlrpc.cmake 2KB
ctkMacroListFilter.cmake 2KB
Log4Qt.cmake 2KB
ctkFunctionAddPluginRepo.cmake 2KB
ctkFunctionLFtoCRLF.cmake 2KB
ZMQ.cmake 2KB
ctkFunctionExtractPluginTargets.cmake 2KB
CTKData.cmake 2KB
ctkFunctionCheckCompilerFlags.cmake 2KB
ctkFunctionGetLibraryDirs.cmake 2KB
KWStyle.cmake 2KB
OpenIGTLink.cmake 2KB
ctkFunctionExtractOptionNameAndValue.cmake 2KB
ctkFunctionCheckoutRepo.cmake 2KB
KWStyle.cmake 1KB
ctkMacroAddCtkLibraryOptions.cmake 1KB
ctkFunctionApplyPatches.cmake 1KB
ctkFunctionGetTargetDependencies.cmake 1KB
ctkFunctionGetGccVersion.cmake 1KB
ctkMacroGenerateMocs.cmake 1KB
ctkMacroSetPaths.cmake 1KB
ctkMacroGeneratePluginResourceFile.cmake 1KB
ctkQtTesting.cmake 1KB
ctkFunctionGetPluginDependencies.cmake 1KB
ctkMacroSimpleTest.cmake 1KB
ctkMacroParseArguments.cmake 1KB
ctkFunctionGetAllPluginTargets.cmake 792B
ctk_library_options.cmake 623B
manifest_headers.cmake 523B
manifest_headers.cmake 511B
manifest_headers.cmake 508B
manifest_headers.cmake 505B
manifest_headers.cmake 499B
files.cmake 497B
manifest_headers.cmake 494B
target_libraries.cmake 387B
ctk_library_options.cmake 383B
target_libraries.cmake 339B
FindPythonQtGenerator.cmake 339B
target_libraries.cmake 314B
target_libraries.cmake 314B
manifest_headers.cmake 308B
manifest_headers.cmake 308B
target_libraries.cmake 298B
manifest_headers.cmake 276B
manifest_headers.cmake 276B
manifest_headers.cmake 274B
manifest_headers.cmake 274B
target_libraries.cmake 274B
manifest_headers.cmake 273B
target_libraries.cmake 269B
target_libraries.cmake 268B
manifest_headers.cmake 264B
manifest_headers.cmake 258B
target_libraries.cmake 255B
target_libraries.cmake 249B
共 2737 条
- 1
- 2
- 3
- 4
- 5
- 6
- 28
资源评论
- zhangjianscc2019-08-20编译可以使用
Jimmy-G
- 粉丝: 66
- 资源: 24
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功