Commit 755f92a5 authored by Robert Maynard's avatar Robert Maynard

Cleanup the logic of getting the moab include directory.

Now we expect the MOAB target to have a include dir transitive property set.
parent 8b6fb363
...@@ -37,10 +37,16 @@ find_package_handle_standard_args(MOAB DEFAULT_MSG ...@@ -37,10 +37,16 @@ find_package_handle_standard_args(MOAB DEFAULT_MSG
if(MOAB_FOUND) if(MOAB_FOUND)
if(EXISTS ${MOAB_ROOT_DIR}/lib/MOABConfig.cmake) if(EXISTS ${MOAB_ROOT_DIR}/lib/MOABConfig.cmake)
#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/MOABConfig.cmake)
else()
#now we create fake targets to be used
include(${MOAB_ROOT_DIR}/lib/MOABTargets.cmake) include(${MOAB_ROOT_DIR}/lib/MOABTargets.cmake)
set_target_properties(MOAB PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${MOAB_INCLUDE_DIR}"
)
endif() endif()
endif() endif()
......
...@@ -40,9 +40,7 @@ function(smtk_add_header_test name dir_prefix) ...@@ -40,9 +40,7 @@ function(smtk_add_header_test name dir_prefix)
#include the build directory for the export header #include the build directory for the export header
target_include_directories(TestBuild_${name} target_include_directories(TestBuild_${name}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
${MOAB_INCLUDE_DIRS}
)
#also link against moab so we build properly #also link against moab so we build properly
target_link_libraries(TestBuild_${name} target_link_libraries(TestBuild_${name}
PRIVATE MOAB) PRIVATE MOAB)
......
...@@ -50,13 +50,6 @@ target_link_libraries(smtkCore ...@@ -50,13 +50,6 @@ target_link_libraries(smtkCore
LINK_PUBLIC cJSON MOAB LINK_PUBLIC cJSON MOAB
LINK_PRIVATE ${Boost_LIBRARIES}) LINK_PRIVATE ${Boost_LIBRARIES})
#when we are building moab itself the target has the proper include directory
#but when we import moab it
if(SMTK_USE_SYSTEM_MOAB)
target_include_directories(smtkCore
PRIVATE ${MOAB_INCLUDE_DIRS})
endif()
smtk_export_header(smtkCore CoreExports.h) smtk_export_header(smtkCore CoreExports.h)
if (NOT BUILD_SHARED_LIBS AND SMTK_ENABLE_PYTHON_WRAPPING) if (NOT BUILD_SHARED_LIBS AND SMTK_ENABLE_PYTHON_WRAPPING)
# Set position-independent flag when other project libs are shared. # Set position-independent flag when other project libs are shared.
......
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