Pyodide fixes

This commit is contained in:
Matthias Hochsteger 2023-09-16 19:25:43 +02:00
parent f1ec19b35b
commit d069f57422
4 changed files with 8 additions and 22 deletions

View File

@ -394,16 +394,9 @@ if (USE_OCC)
TKXSBase TKXSBase
TKernel TKernel
) )
foreach(LIB_NAME ${OCC_LIBRARIES}) target_link_libraries(occ_libs INTERFACE ${OCC_LIBRARIES})
set(LIB_VAR "LIB_${LIB_NAME}")
find_library(${LIB_VAR} ${LIB_NAME} NO_DEFAULT_PATH HINTS ${OpenCASCADE_LIBRARY_DIR})
target_link_libraries(occ_libs INTERFACE ${${LIB_VAR}})
endforeach()
include_directories(${OpenCASCADE_INCLUDE_DIR}) include_directories(${OpenCASCADE_INCLUDE_DIR})
if(NOT OpenCASCADE_BUILD_SHARED_LIBS) if(NOT OpenCASCADE_BUILD_SHARED_LIBS)
if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN)
target_link_libraries(occ_libs INTERFACE -Wl,--start-group)
endif()
if(OpenCASCADE_WITH_FREETYPE) if(OpenCASCADE_WITH_FREETYPE)
find_library( FREETYPE NAMES freetype HINTS ${OpenCASCADE_LIBRARY_DIR}) find_library( FREETYPE NAMES freetype HINTS ${OpenCASCADE_LIBRARY_DIR})
list(APPEND OCC_LIBRARIES ${FREETYPE}) list(APPEND OCC_LIBRARIES ${FREETYPE})
@ -413,15 +406,9 @@ if (USE_OCC)
target_link_libraries(occ_libs INTERFACE ${Fontconfig_LIBRARIES}) target_link_libraries(occ_libs INTERFACE ${Fontconfig_LIBRARIES})
endif() endif()
endif(OpenCASCADE_WITH_FREETYPE) endif(OpenCASCADE_WITH_FREETYPE)
if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN) set(THREADS_PREFER_PTHREAD_FLAG ON)
set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED)
find_package(Threads REQUIRED) target_link_libraries(occ_libs INTERFACE Threads::Threads)
target_link_libraries(occ_libs INTERFACE Threads::Threads)
target_link_libraries(occ_libs INTERFACE -Wl,--end-group)
endif()
if(WIN32)
target_link_libraries(occ_libs INTERFACE Threads::Threads)
endif()
endif() endif()
message(STATUS "OCC DIRS ${OpenCASCADE_INCLUDE_DIR}") message(STATUS "OCC DIRS ${OpenCASCADE_INCLUDE_DIR}")
if(WIN32 AND USE_GUI) if(WIN32 AND USE_GUI)

View File

@ -235,7 +235,7 @@ namespace netgen
/// ///
DLL_HEADER ~Mesh(); DLL_HEADER ~Mesh();
Mesh & operator= (const Mesh & mesh2); DLL_HEADER Mesh & operator= (const Mesh & mesh2);
/// ///
DLL_HEADER void DeleteMesh(); DLL_HEADER void DeleteMesh();

View File

@ -44,7 +44,7 @@ if(USE_PYTHON)
set_target_properties( ngpy PROPERTIES OUTPUT_NAME "libngpy") set_target_properties( ngpy PROPERTIES OUTPUT_NAME "libngpy")
endif() endif()
set_target_properties(ngpy PROPERTIES INSTALL_RPATH "${NG_RPATH_TOKEN}/../${NETGEN_PYTHON_RPATH}") set_target_properties(ngpy PROPERTIES INSTALL_RPATH "${NG_RPATH_TOKEN}/../${NETGEN_PYTHON_RPATH}")
install(TARGETS ngpy DESTINATION ${NG_INSTALL_DIR_PYTHON}/${NG_INSTALL_SUFFIX} COMPONENT netgen) install(TARGETS ngpy DESTINATION ${NG_INSTALL_DIR_PYTHON}/${NG_INSTALL_SUFFIX} COMPONENT netgen EXPORT netgen-targets)
if(USE_GUI) if(USE_GUI)
add_library(ngguipy SHARED ngguipy.cpp) add_library(ngguipy SHARED ngguipy.cpp)
@ -56,7 +56,7 @@ if(USE_PYTHON)
set_target_properties( ngguipy PROPERTIES OUTPUT_NAME "libngguipy") set_target_properties( ngguipy PROPERTIES OUTPUT_NAME "libngguipy")
endif() endif()
set_target_properties(ngguipy PROPERTIES INSTALL_RPATH "${NG_RPATH_TOKEN}/../${NETGEN_PYTHON_RPATH}") set_target_properties(ngguipy PROPERTIES INSTALL_RPATH "${NG_RPATH_TOKEN}/../${NETGEN_PYTHON_RPATH}")
install(TARGETS ngguipy DESTINATION ${NG_INSTALL_DIR_PYTHON}/${NG_INSTALL_SUFFIX} COMPONENT netgen) install(TARGETS ngguipy DESTINATION ${NG_INSTALL_DIR_PYTHON}/${NG_INSTALL_SUFFIX} COMPONENT netgen EXPORT netgen-targets)
endif(USE_GUI) endif(USE_GUI)
endif(USE_PYTHON) endif(USE_PYTHON)

View File

@ -11,9 +11,8 @@ if(EMSCRIPTEN)
target_include_directories(nglib PUBLIC $<TARGET_PROPERTY:ngcore,INTERFACE_INCLUDE_DIRECTORIES>) target_include_directories(nglib PUBLIC $<TARGET_PROPERTY:ngcore,INTERFACE_INCLUDE_DIRECTORIES>)
else(EMSCRIPTEN) else(EMSCRIPTEN)
target_link_libraries(nglib PUBLIC ngcore) target_link_libraries(nglib PUBLIC ngcore)
target_link_libraries( nglib PRIVATE ${MPI_CXX_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${JPEG_LIBRARIES} ${MKL_LIBRARIES} ${ZLIB_LIBRARIES} occ_libs netgen_cgns )
endif(EMSCRIPTEN) endif(EMSCRIPTEN)
target_link_libraries( nglib PRIVATE ${MPI_CXX_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${JPEG_LIBRARIES} ${MKL_LIBRARIES} ${ZLIB_LIBRARIES} occ_libs netgen_cgns )
install(TARGETS nglib netgen_cgns ${NG_INSTALL_DIR}) install(TARGETS nglib netgen_cgns ${NG_INSTALL_DIR})
install(FILES nglib.h DESTINATION ${NG_INSTALL_DIR_INCLUDE} COMPONENT netgen_devel) install(FILES nglib.h DESTINATION ${NG_INSTALL_DIR_INCLUDE} COMPONENT netgen_devel)