Commit ece16a34 authored by T.J. Corona's avatar T.J. Corona

Fix pybind11 build flags to work on windows.

parent 15f0cf0d
......@@ -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()
......
......@@ -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)
......
......@@ -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)
......
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