Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Alvaro Sanchez
SMTK
Commits
1748e8db
Commit
1748e8db
authored
Sep 08, 2015
by
Robert Maynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the SMTKConfig to find MOAB and Remus if needed.
parent
995d33bb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
8 deletions
+78
-8
CMake/FindMOAB.cmake
CMake/FindMOAB.cmake
+9
-2
CMake/SMTKConfig.cmake.in
CMake/SMTKConfig.cmake.in
+26
-0
CMake/SMTKMacros.cmake
CMake/SMTKMacros.cmake
+1
-1
CMakeLists.txt
CMakeLists.txt
+42
-5
No files found.
CMake/FindMOAB.cmake
View file @
1748e8db
...
...
@@ -41,8 +41,15 @@ if(MOAB_FOUND)
#Because we have a built-in moab the config.cmake
#will fail to include targets.cmake so we must do it
#manually
include
(
${
MOAB_ROOT_DIR
}
/lib/MOABConfig.cmake
)
include
(
${
MOAB_ROOT_DIR
}
/lib/MOABTargets.cmake
)
if
(
SMTK_USE_SYSTEM_MOAB
)
include
(
${
MOAB_ROOT_DIR
}
/lib/MOABConfig.cmake
)
include
(
${
MOAB_ROOT_DIR
}
/lib/MOABTargets.cmake
)
else
()
#otherwise we are use the third-party bundled version
#and nothing else needs to be done
include
(
MOABConfig.cmake
)
include
(
MOABTargets.cmake
)
endif
()
set_target_properties
(
MOAB PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES
"
${
MOAB_INCLUDE_DIR
}
"
...
...
CMake/SMTKConfig.cmake.in
0 → 100644
View file @
1748e8db
#setup if we are being included from the build directory of SMTK
set(SMTK_IN_BUILD_DIR @SMTK_IN_BUILD_DIR@)
#Setup the CMake module paths
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "@SMTK_MODULE_DIR@")
#First thing to find is MOAB. Even when moab is built-in we install the
#MOAB package.
set(SMTK_USE_SYSTEM_MOAB @SMTK_USE_SYSTEM_MOAB@)
#Only dont find SMTK when in BUILD_DIR and not using system
if(SMTK_IN_BUILD_DIR)
if(SMTK_USE_SYSTEM_MOAB)
find_package(MOAB REQUIRED)
endif()
else()
find_package(MOAB REQUIRED)
endif()
set(SMTK_ENABLE_REMUS_SUPPORT @SMTK_ENABLE_REMUS_SUPPORT@)
if(SMTK_ENABLE_REMUS_SUPPORT)
find_package(Remus REQUIRED)
endif()
include("@SMTK_CONFIG_DIR@/SMTKTargets.cmake")
\ No newline at end of file
CMake/SMTKMacros.cmake
View file @
1748e8db
...
...
@@ -95,7 +95,7 @@ function(smtk_install_library target)
LIBRARY DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
ARCHIVE DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
)
export
(
TARGETS
${
target
}
APPEND FILE
${
SMTK_BINARY_DIR
}
/SMTK
Config
.cmake
)
export
(
TARGETS
${
target
}
APPEND FILE
${
SMTK_BINARY_DIR
}
/SMTK
Targets
.cmake
)
endfunction
(
smtk_install_library
)
#generate an export header and create an install target for it
...
...
CMakeLists.txt
View file @
1748e8db
...
...
@@ -10,12 +10,12 @@ if (POLICY CMP0054)
cmake_policy
(
SET CMP0054 OLD
)
endif
()
# Remove SMTKConfig.cmake at the beginning of each CMake run; each time
project
(
SMTK
)
# 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 SMTKConfig.cmake
)
project
(
SMTK
)
file
(
REMOVE
${
PROJECT_BINARY_DIR
}
/SMTKTargets.cmake
)
################################################################################
# SMTK version number
...
...
@@ -397,6 +397,17 @@ install(
lib/cmake/SMTK
)
# Install find modules for SMTK needs to find external packages:
install
(
FILES
${
PROJECT_SOURCE_DIR
}
/CMake/FindCGM.cmake
${
PROJECT_SOURCE_DIR
}
/CMake/FindMoab.cmake
${
PROJECT_SOURCE_DIR
}
/CMake/FindRemus.cmake
${
PROJECT_SOURCE_DIR
}
/CMake/FindZeroMQ.cmake
DESTINATION
lib/cmake/SMTK
)
################################################################################
# Build third party libraries
################################################################################
...
...
@@ -458,6 +469,32 @@ endif()
install
(
EXPORT SMTK
DESTINATION lib/cmake/SMTK
FILE SMTK
Config
.cmake
FILE SMTK
Targets
.cmake
)
export
(
PACKAGE SMTK
)
# Setup the config file for exports that stores what other thirdparty
# packages we need to search for ( MOAB, Remus, etc ) for when using the
# build version of smtk
set
(
SMTK_IN_BUILD_DIR
"TRUE"
)
set
(
SMTK_MODULE_DIR
"
${
SMTK_SOURCE_DIR
}
/CMake"
)
set
(
SMTK_CONFIG_DIR
"
${
PROJECT_BINARY_DIR
}
"
)
configure_file
(
${
PROJECT_SOURCE_DIR
}
/CMake/SMTKConfig.cmake.in
${
PROJECT_BINARY_DIR
}
/SMTKConfig.cmake
@ONLY
)
# Setup the config file for exports that stores what other thirdparty
# packages we need to search for ( MOAB, Remus, etc ) for when using the
# install version of smtk
set
(
SMTK_IN_BUILD_DIR
"FALSE"
)
set
(
SMTK_MODULE_DIR
"
\$
{CMAKE_CURRENT_LIST_DIR};
\$
{CMAKE_CURRENT_LIST_DIR}/../MOAB"
)
set
(
SMTK_CONFIG_DIR
"
\$
{CMAKE_CURRENT_LIST_DIR}"
)
configure_file
(
${
PROJECT_SOURCE_DIR
}
/CMake/SMTKConfig.cmake.in
${
PROJECT_BINARY_DIR
}
/CMakeFiles/SMTKConfig.cmake
@ONLY
)
install
(
FILES
${
PROJECT_BINARY_DIR
}
/CMakeFiles/SMTKConfig.cmake
DESTINATION lib/cmake/SMTK
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment