Commit 3c9b1233 authored by T.J. Corona's avatar T.J. Corona Committed by Kitware Robot

Merge topic 'pybind-flags-windows-compatibility'

ea4ce6c4 Fix some tests to work on windows.
ece16a34 Fix pybind11 build flags to work on windows.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard's avatarRobert Maynard <robert.maynard@kitware.com>
Merge-request: !367
parents 5a7af0a1 ea4ce6c4
......@@ -295,6 +295,13 @@ add_subdirectory(thirdparty)
if(SMTK_ENABLE_PYTHON_WRAPPING)
if(SMTK_USE_PYBIND11)
find_package(PythonLibs REQUIRED)
set(SMTK_PYBIND11_FLAGS " ")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR
CMAKE_CXX_COMPILER_ID MATCHES "Intel")
set(SMTK_PYBIND11_FLAGS "${SMTK_PYBIND11_FLAGS} -Wno-shadow")
endif()
else()
include(UseShiboken)
endif()
......@@ -417,6 +424,8 @@ if(SMTK_ENABLE_PYTHON_WRAPPING)
# Add the path to the build tree's compiled modules.
list(APPEND smtk_pythonpaths
"${CMAKE_BINARY_DIR}${envsep}${CMAKE_BINARY_DIR}/lib")
list(APPEND smtk_libpaths
"${CMAKE_BINARY_DIR}/lib")
if (CMAKE_RUNTIME_OUTPUT_DIRECTORY)
list(APPEND smtk_libpaths
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
......
......@@ -6,7 +6,7 @@ target_link_libraries(smtkPybindAttribute LINK_PUBLIC smtkCore)
set_target_properties(smtkPybindAttribute
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
COMPILE_FLAGS "-Wno-shadow"
COMPILE_FLAGS ${SMTK_PYBIND11_FLAGS}
)
install(TARGETS smtkPybindAttribute DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
......
......@@ -6,7 +6,7 @@ target_link_libraries(smtkPybindCGMSession LINK_PUBLIC smtkCore smtkCGMSession L
set_target_properties(smtkPybindCGMSession
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
COMPILE_FLAGS "-Wno-shadow"
COMPILE_FLAGS ${SMTK_PYBIND11_FLAGS}
)
install(TARGETS smtkPybindCGMSession DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
......
......@@ -21,7 +21,7 @@ target_link_libraries(smtkPybindDiscreteSession LINK_PUBLIC smtkCore smtkDiscret
set_target_properties(smtkPybindDiscreteSession
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
COMPILE_FLAGS "-Wno-shadow"
COMPILE_FLAGS ${SMTK_PYBIND11_FLAGS}
)
install(TARGETS smtkPybindDiscreteSession DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
......
......@@ -18,7 +18,7 @@ target_link_libraries(smtkPybindExodusSession LINK_PUBLIC smtkCore smtkExodusSes
set_target_properties(smtkPybindExodusSession
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
COMPILE_FLAGS "-Wno-shadow"
COMPILE_FLAGS ${SMTK_PYBIND11_FLAGS}
)
install(TARGETS smtkPybindExodusSession DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
......
......@@ -6,7 +6,7 @@ target_link_libraries(smtkPybindMeshSession LINK_PUBLIC smtkCore smtkMeshSession
set_target_properties(smtkPybindMeshSession
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
COMPILE_FLAGS "-Wno-shadow"
COMPILE_FLAGS ${SMTK_PYBIND11_FLAGS}
)
install(TARGETS smtkPybindMeshSession DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
......
......@@ -21,7 +21,7 @@ target_link_libraries(smtkPybindPolygonSession LINK_PUBLIC smtkCore smtkPolygonS
set_target_properties(smtkPybindPolygonSession
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
COMPILE_FLAGS "-Wno-shadow"
COMPILE_FLAGS ${SMTK_PYBIND11_FLAGS}
)
install(TARGETS smtkPybindPolygonSession DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
......
......@@ -13,7 +13,7 @@ target_link_libraries(smtkPybindRemoteSession LINK_PUBLIC
set_target_properties(smtkPybindRemoteSession
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
COMPILE_FLAGS "-Wno-shadow"
COMPILE_FLAGS ${SMTK_PYBIND11_FLAGS}
)
install(TARGETS smtkPybindRemoteSession DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
......
......@@ -6,7 +6,7 @@ target_link_libraries(smtkPybindCommon LINK_PUBLIC smtkCore)
set_target_properties(smtkPybindCommon
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
COMPILE_FLAGS "-Wno-shadow"
COMPILE_FLAGS ${SMTK_PYBIND11_FLAGS}
)
install(TARGETS smtkPybindCommon DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
......
......@@ -6,7 +6,7 @@ target_link_libraries(smtkPybindIOVTK LINK_PUBLIC smtkCore smtkIOVTK)
set_target_properties(smtkPybindIOVTK
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
COMPILE_FLAGS "-Wno-shadow"
COMPILE_FLAGS ${SMTK_PYBIND11_FLAGS}
)
install(TARGETS smtkPybindIOVTK DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
......
......@@ -114,10 +114,9 @@ void vtkModelMultiBlockSource::SetModelManager(const char* pointerAsString)
}
else
{
int base = 10;
int base = 16;
if (pointerAsString[0] == '0' && pointerAsString[1] == 'x')
{
base = 16;
pointerAsString += 2;
}
char* endPtr;
......
......@@ -6,7 +6,7 @@ target_link_libraries(smtkPybindIO LINK_PUBLIC smtkCore)
set_target_properties(smtkPybindIO
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
COMPILE_FLAGS "-Wno-shadow"
COMPILE_FLAGS ${SMTK_PYBIND11_FLAGS}
)
install(TARGETS smtkPybindIO DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
......
......@@ -6,7 +6,7 @@ target_link_libraries(smtkPybindMesh LINK_PUBLIC smtkCore)
set_target_properties(smtkPybindMesh
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
COMPILE_FLAGS "-Wno-shadow"
COMPILE_FLAGS ${SMTK_PYBIND11_FLAGS}
)
install(TARGETS smtkPybindMesh DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
......
......@@ -6,7 +6,7 @@ target_link_libraries(smtkPybindModel LINK_PUBLIC smtkCore)
set_target_properties(smtkPybindModel
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
COMPILE_FLAGS "-Wno-shadow"
COMPILE_FLAGS ${SMTK_PYBIND11_FLAGS}
)
install(TARGETS smtkPybindModel DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
......
......@@ -250,7 +250,7 @@ PySharedPtrClass< smtk::model::Manager > pybind11_init_smtk_model_Manager(py::mo
.def("useOrShellIncludesShells", &smtk::model::Manager::useOrShellIncludesShells, py::arg("cellUseOrShell"))
.def("pointerAsString", [](smtk::model::Manager &m){
std::ostringstream result;
result << &m;
result << std::hex << &m;
return result.str();
})
;
......
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