Commit 0e42716f authored by T.J. Corona's avatar T.J. Corona

Fix up build for SDK functionality

parent 664a3243
# Given a string representing an XML file, extract all of the include items and
# replace them with the contents of the file being included.
function(expandXMLString rawString expandedString includedFiles)
function(expandXMLString rawString expandedString includedFiles includeDirectories)
# First, grab all of the xml elements describing included files
string(REGEX MATCHALL "<include[^/]* href=\"[^\"]+\"[^/]*/>" includes ${${rawString}})
......@@ -16,16 +16,16 @@ function(expandXMLString rawString expandedString includedFiles)
math(EXPR newlen "${len} - 7")
string(SUBSTRING ${tmp} 6 ${newlen} incFileName)
# We need to differentiate betwen the build and install trees here. Just now
# we fake it by assuming that projects that depend on SMTK have
# SMTK_INCLUDE_DIR set.
#
# TODO: do this correctly
if (NOT DEFINED SMTK_INCLUDE_DIR)
string(CONCAT incFileName ${SMTK_SOURCE_DIR} "/" ${incFileName})
else ()
string(CONCAT incFileName ${SMTK_INCLUDE_DIR} "/" ${incFileName})
endif ()
# Locate the included file so we can expand it. Check the list of include
# directories, but do not use find_file() as that caches results.
foreach (includeDir IN LISTS includeDirectories)
string(CONCAT absoluteIncFileName ${includeDir} "/" ${incFileName})
if (EXISTS ${absoluteIncFileName})
set(incFileName ${absoluteIncFileName})
break()
endif()
endforeach()
find_file(incFileName NAMES ${incFileName} PATHS ${includeDirectories} NO_DEFAULT_PATH)
list(FIND includedFiles ${incFileName} index)
......@@ -48,7 +48,7 @@ function(expandXMLString rawString expandedString includedFiles)
list(APPEND includedFiles ${incFileName})
# Recursively expand the dependency xml string
expandXMLString(incFileContents expandedIncFileContents includedFiles)
expandXMLString(incFileContents expandedIncFileContents includedFiles includeDirectories)
# Pop the file name
list(REMOVE_ITEM includedFiles ${incFileName})
......@@ -61,10 +61,10 @@ function(expandXMLString rawString expandedString includedFiles)
endfunction()
function(encodeStringAsCVariable rawString encodedVarName stringOut)
function(encodeStringAsCVariable rawString encodedVarName stringOut includeDirectories)
set(includedFiles)
expandXMLString(${rawString} expandedString includedFiles)
expandXMLString(${rawString} expandedString includedFiles "${includeDirectories}")
string(REPLACE "\\" "\\\\" str1 "${expandedString}")
string(REPLACE "\"" "\\\"" str2 "${str1}")
......@@ -76,9 +76,9 @@ function(encodeStringAsCVariable rawString encodedVarName stringOut)
endfunction()
function(configureStringAsCVariable rawString dstFileName encodedVarName)
function(configureStringAsCVariable rawString dstFileName encodedVarName includeDirectories)
encodeStringAsCVariable(${rawString} ${encodedVarName} encodedContents)
encodeStringAsCVariable(${rawString} ${encodedVarName} encodedContents "${includeDirectories}")
if (EXISTS ${dstFileName})
file(READ ${dstFileName} already)
endif()
......@@ -88,11 +88,11 @@ function(configureStringAsCVariable rawString dstFileName encodedVarName)
endfunction()
function(configureFileAsCVariable srcFileName dstFileName encodedVarName)
function(configureFileAsCVariable srcFileName dstFileName encodedVarName includeDirectories)
if (EXISTS ${srcFileName})
file(READ ${srcFileName} fileContents)
configureStringAsCVariable(fileContents ${dstFileName} ${encodedVarName})
configureStringAsCVariable(fileContents ${dstFileName} ${encodedVarName} "${includeDirectories}")
else()
file(REMOVE ${dstFileName})
endif()
......@@ -115,19 +115,19 @@ endfunction()
# string or variable name differs, in order to avoid recompiling
# dependent files unneccessarily.
function(encodeStringAsPyVariable rawString encodedVarName stringOut)
function(encodeStringAsPyVariable rawString encodedVarName stringOut includeDirectories)
set(includedFiles)
expandXMLString(${rawString} expandedString includedFiles)
expandXMLString(${rawString} expandedString includedFiles "${includeDirectories}")
string(CONFIGURE "\ndescription = '''\n${expandedString}\n'''\n" pyString)
set(${stringOut} "${pyString}" PARENT_SCOPE)
endfunction()
function(configureStringAsPyVariable rawString dstFileName encodedVarName)
function(configureStringAsPyVariable rawString dstFileName encodedVarName includeDirectories)
encodeStringAsPyVariable(${rawString} ${encodedVarName} encodedContents)
encodeStringAsPyVariable(${rawString} ${encodedVarName} encodedContents "${includeDirectories}")
if (EXISTS ${dstFileName})
file(READ ${dstFileName} already)
endif()
......@@ -137,11 +137,11 @@ function(configureStringAsPyVariable rawString dstFileName encodedVarName)
endfunction()
function(configureFileAsPyVariable srcFileName dstFileName encodedVarName)
function(configureFileAsPyVariable srcFileName dstFileName encodedVarName includeDirectories)
if (EXISTS ${srcFileName})
file(READ ${srcFileName} fileContents)
configureStringAsPyVariable(fileContents ${dstFileName} ${encodedVarName})
configureStringAsPyVariable(fileContents ${dstFileName} ${encodedVarName} "${includeDirectories}")
else()
file(REMOVE ${dstFileName})
endif()
......
......@@ -10,7 +10,7 @@ include(GenerateExportHeader)
# Utility to build a kit name from the current directory.
function(smtk_get_kit_name kitvar)
string(REPLACE "${SMTK_SOURCE_DIR}/" "" dir_prefix ${CMAKE_CURRENT_SOURCE_DIR})
string(REPLACE "${${CMAKE_PROJECT_NAME}_SOURCE_DIR}/" "" dir_prefix ${CMAKE_CURRENT_SOURCE_DIR})
string(REPLACE "/" "_" kit "${dir_prefix}")
set(${kitvar} "${kit}" PARENT_SCOPE)
# Optional second argument to get dir_prefix.
......@@ -47,7 +47,7 @@ function(smtk_add_header_test name dir_prefix)
get_filename_component(headername ${header} NAME_WE)
smtk_header_test_cxx_name(${name} ${headername} src)
# set(src ${CMAKE_CURRENT_BINARY_DIR}/TestBuild_${name}_${headername}${suffix})
configure_file(${SMTK_SOURCE_DIR}/CMake/TestBuild.cxx.in ${src} @ONLY)
configure_file(${${CMAKE_PROJECT_NAME}_SOURCE_DIR}/CMake/TestBuild.cxx.in ${src} @ONLY)
set(cxxfiles ${cxxfiles} ${src})
endforeach (header)
......@@ -87,9 +87,9 @@ function(smtk_public_headers)
else ()
set(suffix "")
endif ()
install (FILES ${header} DESTINATION include/smtk/${SMTK_VERSION}/${dir_prefix}${suffix})
install (FILES ${header} DESTINATION include/${CMAKE_PROJECT_NAME}/${PROJECT_VERSION}/${dir_prefix}${suffix})
endforeach ()
if (SMTK_ENABLE_TESTING)
if (BUILD_TESTING)
smtk_add_header_test("${name}" "${dir_prefix}" ${ARGN})
endif()
endfunction(smtk_public_headers)
......@@ -98,7 +98,7 @@ endfunction(smtk_public_headers)
# compiled and show up in an IDE.
function(smtk_private_headers)
smtk_get_kit_name(name dir_prefix)
if (SMTK_ENABLE_TESTING)
if (BUILD_TESTING)
smtk_add_header_test("${name}" "${dir_prefix}" ${ARGN})
endif()
endfunction(smtk_private_headers)
......@@ -110,19 +110,19 @@ endfunction(smtk_private_headers)
function(smtk_install_library target)
set_target_properties(${target} PROPERTIES CXX_VISIBILITY_PRESET hidden)
install(TARGETS ${target}
EXPORT SMTK
EXPORT ${CMAKE_PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
export(TARGETS ${target} APPEND FILE ${SMTK_BINARY_DIR}/SMTKTargets.cmake)
export(TARGETS ${target} APPEND FILE ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}Targets.cmake)
endfunction(smtk_install_library)
#generate an export header and create an install target for it
function(smtk_export_header target file)
smtk_get_kit_name(name dir_prefix)
generate_export_header(${target} EXPORT_FILE_NAME ${file})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file} DESTINATION include/smtk/${SMTK_VERSION}/${dir_prefix})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file} DESTINATION include/${CMAKE_PROJECT_NAME}/${PROJECT_VERSION}/${dir_prefix})
endfunction(smtk_export_header)
# Builds a source file and an executable that does nothing other than
......@@ -142,7 +142,6 @@ function(smtk_prepend_string prefix result)
endfunction(smtk_prepend_string)
include(SMTKOperationXML)
include(SMTKSessionJSON)
# Builds source groups for the smtk files so that they show up nicely in
# Visual Studio.
......@@ -189,9 +188,9 @@ MACRO(ADD_SMTK_UI_VIEW OUTIFACES OUTSRCS)
ENDIF()
SET(${OUTIFACES} ${ARG_CLASS_NAME})
CONFIGURE_FILE(${SMTK_SOURCE_DIR}/CMake/qtSMTKViewImplementation.h.in
CONFIGURE_FILE(${smtk_cmake_dir}/qtSMTKViewImplementation.h.in
${CMAKE_CURRENT_BINARY_DIR}/${ARG_CLASS_NAME}Implementation.h @ONLY)
CONFIGURE_FILE(${SMTK_SOURCE_DIR}/CMake/qtSMTKViewImplementation.cxx.in
CONFIGURE_FILE(${smtk_cmake_dir}/qtSMTKViewImplementation.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/${ARG_CLASS_NAME}Implementation.cxx @ONLY)
qt5_wrap_cpp(VIEW_MOC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/${ARG_CLASS_NAME}Implementation.h)
......
......@@ -2,28 +2,50 @@ include("${CMAKE_CURRENT_LIST_DIR}/EncodeStringFunctions.cmake")
# Given a list of filenames (opSpecs) containing XML descriptions of
# operations, configure C++ source that encodes the XML as a string.
# Includes in the xml that resolve to accessible files are replaced by
# the injection of the included file's contents. Query paths for included
# files are passed to this macro with the flag INCLUDE_DIRS.
# The resulting files are placed in the current binary directory and
# appended to genFiles.
# smtk_operation_xml(
# <xml> <output_variable>
# INCLUDE_DIRS <path_to_include_directories>
# )
function(smtk_operation_xml opSpecs genFiles)
set(options)
set(oneValueArgs)
set(multiValueArgs INCLUDE_DIRS)
cmake_parse_arguments(SMTK_op "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
list(APPEND SMTK_op_INCLUDE_DIRS ${PROJECT_SOURCE_DIR} ${SMTK_INCLUDE_DIR})
foreach (opSpec ${opSpecs})
get_filename_component(genFileBase "${opSpec}" NAME_WE)
set(genFile "${CMAKE_CURRENT_BINARY_DIR}/${genFileBase}_xml.h")
#message("Writing ${genFileBase}_xml.cxx (${opSpec})")
configureFileAsCVariable("${opSpec}" "${genFile}" "${genFileBase}_xml")
configureFileAsCVariable("${opSpec}" "${genFile}" "${genFileBase}_xml" "${SMTK_op_INCLUDE_DIRS}")
set(${genFiles} ${${genFiles}} "${genFile}" PARENT_SCOPE)
endforeach()
endfunction()
# Given a list of filenames (opSpecs) containing XML descriptions of
# operations, configure Python source that encodes the XML as a string.
# Includes in the xml that resolve to accessible files are replaced by
# the injection of the included file's contents. Query paths for included
# files are passed to this macro with the flag INCLUDE_DIRS.
# The resulting files are placed in the current binary directory and
# appended to genFiles.
# smtk_pyoperation_xml(
# <xml> <output_variable>
# INCLUDE_DIRS <path_to_include_directories>
# )
function(smtk_pyoperation_xml opSpecs genFiles)
set(options)
set(oneValueArgs)
set(multiValueArgs INCLUDE_DIRS)
cmake_parse_arguments(SMTK_op "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
list(APPEND SMTK_op_INCLUDE_DIRS ${PROJECT_SOURCE_DIR} ${SMTK_INCLUDE_DIR})
foreach (opSpec ${opSpecs})
get_filename_component(genFileBase "${opSpec}" NAME_WE)
set(genFile "${CMAKE_CURRENT_BINARY_DIR}/${genFileBase}_xml.py")
#message("Writing ${genFileBase}_xml.cxx (${opSpec})")
configureFileAsPyVariable("${opSpec}" "${genFile}" "${genFileBase}_xml")
configureFileAsPyVariable("${opSpec}" "${genFile}" "${genFileBase}_xml" "${SMTK_op_INCLUDE_DIRS}")
set(${genFiles} ${${genFiles}} "${genFile}" PARENT_SCOPE)
endforeach()
endfunction()
......@@ -50,18 +50,8 @@ function(add_smtk_plugin SMTK_PLUGIN_NAME SMTK_PLUGIN_VERSION)
set (SMTK_PLUGIN_REGISTRAR_HEADER "#include \"${SMTK_PLUGIN_REGISTRAR_HEADER}\"")
endif ()
# We need to differentiate betwen the build and install trees here. Just now
# we fake it by assuming that projects that depend on SMTK have
# SMTK_INCLUDE_DIR set.
#
# TODO: do this correctly
if (NOT DEFINED SMTK_INCLUDE_DIR)
configure_file(${SMTK_SOURCE_DIR}/CMake/serverSource.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/serverSource.cxx @ONLY)
else ()
configure_file(${SMTK_INCLUDE_DIR}/smtk/serverSource.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/serverSource.cxx @ONLY)
endif ()
configure_file(${smtk_cmake_dir}/serverSource.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/serverSource.cxx @ONLY)
find_package(ParaView)
include(${PARAVIEW_USE_FILE})
......
......@@ -13,6 +13,8 @@ if(IS_DIRECTORY "${smtk_module_dir}")
endif()
unset(smtk_module_dir)
set(smtk_cmake_dir ${CMAKE_CURRENT_LIST_DIR})
set(SMTK_HAS_PYTHON @SMTK_ENABLE_PYTHON_WRAPPING@)
if (SMTK_HAS_PYTHON)
find_package(pybind11 REQUIRED)
......
......@@ -66,7 +66,7 @@ macro(vtk_smtk_process_modules)
endmacro()
# this macro is used to setup the environment for loading/building VTK modules
macro(vtk_smtk_setup_module_environment _name)
macro(vtk_smtk_setup_module_environment _name _ver)
# Setup enviroment to build VTK modules outside of VTK source tree.
set (BUILD_SHARED_LIBS ${VTK_BUILD_SHARED_LIBS})
......@@ -83,8 +83,8 @@ macro(vtk_smtk_setup_module_environment _name)
set (VTK_INSTALL_RUNTIME_DIR "bin")
set (VTK_INSTALL_LIBRARY_DIR "lib")
set (VTK_INSTALL_ARCHIVE_DIR "lib")
set (VTK_INSTALL_INCLUDE_DIR "include")
set (VTK_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${_name}")
set (VTK_INSTALL_INCLUDE_DIR "include/${_ver}")
set (VTK_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${_name}/${_ver}")
if (NOT VTK_FOUND)
set (VTK_FOUND ${ParaView_FOUND})
......
......@@ -11,10 +11,12 @@ endif()
if (POLICY CMP0046)
cmake_policy(SET CMP0046 NEW)
endif()
if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif()
if (POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
#If the user/superbuild hasn't explicitly stated what c++ standard to use
#require C++11
if(NOT DEFINED CMAKE_CXX_STANDARD)
......@@ -23,19 +25,20 @@ if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_EXTENSIONS FALSE)
endif()
project(SMTK)
################################################################################
# SMTK version number
include(CMake/smtkVersion.cmake)
project(smtk VERSION ${SMTK_VERSION})
# Remove SMTKTargets.cmake at the beginning of each CMake run; each time
# Remove smtkTargets.cmake at the beginning of each CMake run; each time
# a library is declared below, the file is appended and we do not want
# to keep appending over multiple runs
file(REMOVE ${PROJECT_BINARY_DIR}/SMTKTargets.cmake)
file(REMOVE ${PROJECT_BINARY_DIR}/smtkTargets.cmake)
#Add our Cmake directory to the module search path
list(APPEND CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${SMTK_SOURCE_DIR}/CMake)
################################################################################
# SMTK version number
include(SMTKVersion)
set (smtk_cmake_dir ${PROJECT_SOURCE_DIR}/CMake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${smtk_cmake_dir})
################################################################################
......@@ -548,8 +551,8 @@ configure_file(
${PROJECT_BINARY_DIR}/smtk/Function.h
@ONLY)
install (FILES ${PROJECT_BINARY_DIR}/smtk/Function.h
DESTINATION include/smtk/${SMTK_VERSION}/smtk)
install (FILES ${PROJECT_BINARY_DIR}/${CMAKE_PROJECT_NAME}/Function.h
DESTINATION include/${CMAKE_PROJECT_NAME}/${PROJECT_VERSION}/smtk)
################################################################################
# Determine hash<X> specialization
......@@ -560,11 +563,11 @@ if (NOT SMTK_HASH_H)
endif ()
configure_file(
${PROJECT_SOURCE_DIR}/CMake/HashFunctor.h.in
${PROJECT_BINARY_DIR}/smtk/HashFunctor.h
${PROJECT_BINARY_DIR}/${CMAKE_PROJECT_NAME}/HashFunctor.h
@ONLY)
install (FILES ${PROJECT_BINARY_DIR}/smtk/HashFunctor.h
DESTINATION include/smtk/${SMTK_VERSION}/smtk)
install (FILES ${PROJECT_BINARY_DIR}/${CMAKE_PROJECT_NAME}/HashFunctor.h
DESTINATION include/${CMAKE_PROJECT_NAME}/${PROJECT_VERSION}/smtk)
find_file(CGM_HAVE_VERSION_H
NAMES cgm_version.h
......@@ -576,11 +579,11 @@ find_file(CGM_HAVE_VERSION_H
################################################################################
configure_file(
${PROJECT_SOURCE_DIR}/CMake/Options.h.in
${PROJECT_BINARY_DIR}/smtk/Options.h
${PROJECT_BINARY_DIR}/${CMAKE_PROJECT_NAME}/Options.h
@ONLY)
install (FILES ${PROJECT_BINARY_DIR}/smtk/Options.h
DESTINATION include/smtk/${SMTK_VERSION}/smtk)
install (FILES ${PROJECT_BINARY_DIR}/${CMAKE_PROJECT_NAME}/Options.h
DESTINATION include/${CMAKE_PROJECT_NAME}/${PROJECT_VERSION}/smtk)
################################################################################
......@@ -594,18 +597,9 @@ install(
${PROJECT_SOURCE_DIR}/CMake/EncodeStringFunctions.cmake
${PROJECT_SOURCE_DIR}/CMake/SMTKOperationXML.cmake
${PROJECT_SOURCE_DIR}/CMake/SMTKPluginMacros.cmake
${PROJECT_SOURCE_DIR}/CMake/SMTKSessionJSON.cmake
DESTINATION
${CMAKE_INSTALL_LIBDIR}/cmake/SMTK
)
# This file needs to be installed, but I'm not quite sure where to put it. For
# now, let's put it in SMTK's include directory.
install(
FILES
${PROJECT_SOURCE_DIR}/CMake/serverSource.cxx.in
DESTINATION
include/smtk/${SMTK_VERSION}/smtk
${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME}/${PROJECT_VERSION}
)
################################################################################
......@@ -649,12 +643,12 @@ endif()
#
# Setup the exports for the library when used from an installed location
install(
EXPORT SMTK
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SMTK
FILE SMTKTargets.cmake
EXPORT ${CMAKE_PROJECT_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME}/${PROJECT_VERSION}
FILE ${CMAKE_PROJECT_NAME}Targets.cmake
)
export(EXPORT SMTK FILE "${PROJECT_BINARY_DIR}/SMTKTargets.cmake")
export(EXPORT ${CMAKE_PROJECT_NAME} FILE "${PROJECT_BINARY_DIR}/${CMAKE_PROJECT_NAME}Targets.cmake")
################################################################################
# Create a build directory package configuration file
......@@ -665,14 +659,20 @@ export(EXPORT SMTK FILE "${PROJECT_BINARY_DIR}/SMTKTargets.cmake")
#
# Required to happen before we include the docs directory
set(MOAB_ROOT_DIR "${MOAB_ROOT_DIR}")
set(SMTK_VTK_MODULE_DIR "${CMAKE_BINARY_DIR}/lib/cmake/SMTK")
set(SMTK_VTK_MODULE_DIR "${CMAKE_BINARY_DIR}/lib/cmake/${CMAKE_PROJECT_NAME}/${PROJECT_VERSION}")
set(SMTK_MODULE_DIR "${PROJECT_SOURCE_DIR}/CMake")
set(SMTK_CONFIG_DIR "${PROJECT_BINARY_DIR}")
configure_file(
${PROJECT_SOURCE_DIR}/CMake/SMTKConfig.cmake.in
${PROJECT_BINARY_DIR}/SMTKConfig.cmake
${PROJECT_SOURCE_DIR}/CMake/${CMAKE_PROJECT_NAME}Config.cmake.in
${PROJECT_BINARY_DIR}/${CMAKE_PROJECT_NAME}Config.cmake
@ONLY)
install(
EXPORT ${CMAKE_PROJECT_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME}/${PROJECT_VERSION}
FILE ${CMAKE_PROJECT_NAME}Targets.cmake
)
################################################################################
# Create an install package configuration file
#
......@@ -683,12 +683,12 @@ set(SMTK_VTK_MODULE_DIR "\${CMAKE_CURRENT_LIST_DIR}")
set(SMTK_MODULE_DIR "\${CMAKE_CURRENT_LIST_DIR}")
set(SMTK_CONFIG_DIR "\${CMAKE_CURRENT_LIST_DIR}")
configure_file(
${PROJECT_SOURCE_DIR}/CMake/SMTKConfig.cmake.in
${PROJECT_BINARY_DIR}/CMakeFiles/SMTKConfig.cmake
${PROJECT_SOURCE_DIR}/CMake/${CMAKE_PROJECT_NAME}Config.cmake.in
${PROJECT_BINARY_DIR}/CMakeFiles/${CMAKE_PROJECT_NAME}Config.cmake
@ONLY)
install (FILES ${PROJECT_BINARY_DIR}/CMakeFiles/SMTKConfig.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SMTK)
install (FILES ${PROJECT_BINARY_DIR}/CMakeFiles/${CMAKE_PROJECT_NAME}Config.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME}/${PROJECT_VERSION})
################################################################################
# Build documentation
......
## Support for SMTK as a development SDK
Several build-related updates have been made to facilitate the use of
SMTK as a development SDK, so SMTK plugins can be developed using the
installed version of SMTK.
......@@ -50,12 +50,10 @@ elseif(SMTK_ENABLE_VTK_SUPPORT)
if (SMTK_ENABLE_TESTING)
list(APPEND __required_vtk_modules vtkTestingRendering)
endif()
message("__required_vtk_modules = ${__required_vtk_modules}")
find_package( VTK REQUIRED COMPONENTS ${__required_vtk_modules} )
include("${VTK_USE_FILE}")
list(APPEND CMAKE_MODULE_PATH "${VTK_MODULES_DIR}")
# message("VTK_MODULES_DIR=${VTK_MODULES_DIR}")
endif()
set(SMTK_VTK_SUPPORT_ENABLED "False")
......@@ -66,7 +64,7 @@ if (SMTK_ENABLE_VTK_SUPPORT)
# The pv_process_modules() macro finds all subdirectories
# containing a module.cmake file automatically.
include (smtkVTKModules)
vtk_smtk_setup_module_environment("SMTK")
vtk_smtk_setup_module_environment(${CMAKE_PROJECT_NAME} ${PROJECT_VERSION})
vtk_smtk_process_modules()
set(SMTK_VTK_SUPPORT_ENABLED "True")
......
......@@ -21,7 +21,7 @@ if(SMTK_ENABLE_POLYGON_SESSION)
# The vtk_smtk_process_modules() macro finds all subdirectories
# containing a module.cmake file automatically.
include (smtkVTKModules)
vtk_smtk_setup_module_environment("SMTK")
vtk_smtk_setup_module_environment(${CMAKE_PROJECT_NAME} ${PROJECT_VERSION})
list(APPEND import_vtk_depends
vtkCommonCore
......
PROJECT(SMTKVTKExtensionMeshing)
PROJECT(SMTKVTKExtensionMeshing VERSION ${SMTK_VERSION})
set(srcs
cmbUniquePointSet.cxx
......
......@@ -27,7 +27,7 @@ include_directories(
# The pv_process_modules() macro finds all subdirectories
# containing a module.cmake file automatically.
include (smtkVTKModules)
vtk_smtk_setup_module_environment("SMTK")
vtk_smtk_setup_module_environment(${CMAKE_PROJECT_NAME} ${PROJECT_VERSION})
vtk_smtk_process_modules()
# Build vtk moab reader before session
......
PROJECT(SMTKDiscreteModel)
PROJECT(SMTKDiscreteModel VERSION ${SMTK_VERSION})
# The configured header file used to pass CMake settings to the source code.
configure_file(
......@@ -235,7 +235,7 @@ target_include_directories(${vtk-module}
PUBLIC
$<BUILD_INTERFACE:${SMTK_SOURCE_DIR}>
$<BUILD_INTERFACE:${SMTK_BINARY_DIR}>
$<INSTALL_INTERFACE:include/smtk/${SMTK_VERSION}>)
$<INSTALL_INTERFACE:include/smtk/${PROJECT_VERSION}>)
target_link_libraries(vtkSMTKDiscreteModel LINK_PRIVATE ${UUID_LIBS})
......
......@@ -113,7 +113,7 @@ if(SMTK_ENABLE_VTK_SUPPORT)
# The vtk_smtk_process_modules() macro finds all subdirectories
# containing a module.cmake file automatically.
include (smtkVTKModules)
vtk_smtk_setup_module_environment("SMTK")
vtk_smtk_setup_module_environment(${CMAKE_PROJECT_NAME} ${PROJECT_VERSION})
vtk_smtk_process_modules()
set(polygonSrcs ${polygonSrcs}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment