Skip to content
Snippets Groups Projects
Commit 213e0dba authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

simpler DLL definitions

parent a93cf0f1
No related branches found
No related tags found
No related merge requests found
Pipeline #2510 passed
......@@ -274,12 +274,14 @@ if(MSVC)
set(${VAR} "${${VAR}} /MP")
endif(NOT ${VAR} MATCHES "/MP")
endforeach(VAR)
if(ENABLE_PRIVATE_API)
if(ENABLE_BUILD_DYNAMIC OR ENABLE_BUILD_SHARED)
# automatically export .def file with all symbols (requires CMake 3.4);
# depending on the compiling options this might lead to more than 64k export
# symbols; just trim the .def file to keep the ones you need
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
endif(ENABLE_BUILD_DYNAMIC OR ENABLE_BUILD_SHARED)
endif(ENABLE_PRIVATE_API)
endif(MSVC)
if(ENABLE_OPENMP)
......@@ -1520,16 +1522,13 @@ endif(ENABLE_BUILD_LIB)
# shared library target
if(ENABLE_BUILD_SHARED OR ENABLE_BUILD_DYNAMIC)
if(WIN32 OR CYGWIN)
add_definitions(-DGMSH_DLL)
endif(WIN32 OR CYGWIN)
add_library(shared SHARED ${GMSH_SRC})
set_target_properties(shared PROPERTIES OUTPUT_NAME gmsh
VERSION ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}
SOVERSION ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION})
if(WIN32 OR CYGWIN)
set_target_properties(shared PROPERTIES PREFIX "" IMPORT_PREFIX ""
IMPORT_SUFFIX ".lib" COMPILE_FLAGS -DGMSH_DLL_EXPORT)
IMPORT_SUFFIX ".lib" COMPILE_FLAGS "-DGMSH_DLL -DGMSH_DLL_EXPORT")
endif(WIN32 OR CYGWIN)
target_link_libraries(shared ${LINK_LIBRARIES})
if(MSVC AND ENABLE_MSVC_STATIC_RUNTIME)
......
import gmsh
import sys
gmsh.initialize(sys.argv)
gmsh.fltk.initialize()
gmsh.option.setNumber("General.Terminal", 1)
gmsh.model.add("square with cracks")
surf1 = 1
gmsh.model.occ.addRectangle(0, 0, 0, 1, 1, surf1)
pt1 = gmsh.model.occ.addPoint(0.2, 0.2, 0)
pt2 = gmsh.model.occ.addPoint(0.4, 0.4, 0)
line1 = gmsh.model.occ.addLine(pt1, pt2)
pt3 = gmsh.model.occ.addPoint(0.6, 0.1, 0)
pt4 = gmsh.model.occ.addPoint(0.1, 0.3, 0)
line2 = gmsh.model.occ.addLine(pt3, pt4)
o, m = gmsh.model.occ.fragment([(2,surf1)], [(1,line1), (1,line2)])
gmsh.model.occ.synchronize()
# m contains, for each input entity (surf1, line1 and line2), the child entities
# (if any) after the fragmentation, as lists of tuples. To apply the crack
# plugin we group all the intersecting lines in a physical group
new_surf = m[0][0][1]
new_lines = [item[1] for sublist in m[1:] for item in sublist]
gmsh.model.addPhysicalGroup(2, [new_surf], 100)
gmsh.model.addPhysicalGroup(1, new_lines, 101)
gmsh.model.mesh.generate(2)
gmsh.plugin.setNumber("Crack", "PhysicalGroup", 101)
gmsh.plugin.run("Crack")
gmsh.fltk.run()
gmsh.finalize()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment