diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ce3d4b..7291247 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ # GLOBAL CONFIGURATION VARIABLES ################################ -cmake_minimum_required (VERSION 3.7.2) +cmake_minimum_required (VERSION 3.10) set (libMeshb_VERSION_MAJOR 7) set (libMeshb_VERSION_MINOR 80) project(libMeshb VERSION ${libMeshb_VERSION_MAJOR}.${libMeshb_VERSION_MINOR} LANGUAGES C) @@ -94,6 +94,7 @@ file(WRITE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake "include(\${CMAKE_CURRENT_LIST_DIR}/meshb-target.cmake) include(\${CMAKE_CURRENT_LIST_DIR}/libMeshb-target.cmake) set(libMeshb_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include) +set(libMeshb_HELPERS_DIRS ${CMAKE_INSTALL_PREFIX}/helpers) set(libMeshb_LINK_DIRS ${CMAKE_INSTALL_PREFIX}/lib) set(libMeshb_LIBRARIES Meshb.7 ${AIO_LIBRARIES}) set(libMeshb_Fortran_LIBRARIES Meshbf.7 ${AIO_LIBRARIES}) diff --git a/sources/CMakeLists.txt b/sources/CMakeLists.txt index 1b1519c..2a5e0c6 100644 --- a/sources/CMakeLists.txt +++ b/sources/CMakeLists.txt @@ -9,18 +9,21 @@ else() add_library(Meshb.7 libmeshb7.c ../utilities/libmeshb7_helpers.c) endif() -install (FILES libmeshb7.h libmeshb7.ins ../utilities/libmeshb7_helpers.h DESTINATION include COMPONENT headers) +install (FILES libmeshb7.h libmeshb7.ins DESTINATION include COMPONENT headers) + target_include_directories( Meshb.7 PUBLIC $ $) + install (TARGETS Meshb.7 EXPORT meshb-target DESTINATION lib COMPONENT libraries) + install (EXPORT meshb-target NAMESPACE ${PROJECT_NAME}:: DESTINATION lib/cmake/${PROJECT_NAME}) + install (TARGETS Meshb.7 EXPORT libMeshb-target DESTINATION lib COMPONENT libraries) install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION include) install (EXPORT libMeshb-target DESTINATION lib/cmake/${PROJECT_NAME}) -export (PACKAGE libMeshb) - +export (PACKAGE libMeshb) diff --git a/utilities/CMakeLists.txt b/utilities/CMakeLists.txt index 632c0ea..087ad4f 100644 --- a/utilities/CMakeLists.txt +++ b/utilities/CMakeLists.txt @@ -19,3 +19,6 @@ install (TARGETS speed_test DESTINATION bin COMPONENT applications) add_executable(ugrid2mesh ugrid2mesh.c) target_link_libraries (ugrid2mesh Meshb.7 ${AIO_LIBRARIES}) install (TARGETS ugrid2mesh DESTINATION bin COMPONENT applications) + +install (FILES libmeshb7_helpers.c DESTINATION helpers COMPONENT sources) +install (FILES libmeshb7_helpers.h DESTINATION include COMPONENT headers) diff --git a/utilities/libmeshb7_helpers.c b/utilities/libmeshb7_helpers.c index e4a369b..b6f4762 100644 --- a/utilities/libmeshb7_helpers.c +++ b/utilities/libmeshb7_helpers.c @@ -13,14 +13,16 @@ /* */ /*----------------------------------------------------------------------------*/ + /*----------------------------------------------------------------------------*/ /* Includes */ /*----------------------------------------------------------------------------*/ -#include "libmeshb7_helpers.h" -#include "libmeshb7.h" #include #include +#include "libmeshb7_helpers.h" +#include "libmeshb7.h" + /*----------------------------------------------------------------------------*/ /* Defines */ @@ -38,6 +40,7 @@ #define fpn double #endif + /*----------------------------------------------------------------------------*/ /* Defintion of macro commands */ /*----------------------------------------------------------------------------*/ @@ -46,6 +49,7 @@ #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define POW(a) ((a) * (a)) + /*----------------------------------------------------------------------------*/ /* Allocate a structure to hold all polygons and polyhedra related data */ /*----------------------------------------------------------------------------*/ @@ -138,6 +142,7 @@ PolMshSct *GmfAllocatePolyhedralStructure(int64_t MshIdx) return (pol); } + /*----------------------------------------------------------------------------*/ /* Free all polyhedral tables and the head structure itself */ /*----------------------------------------------------------------------------*/ @@ -168,6 +173,7 @@ void GmfFreePolyghedralStructure(PolMshSct *pol) free(pol); } + /*----------------------------------------------------------------------------*/ /* Read the surface polygons from an already opened mesh file */ /* and store the data in the provided polyhedral structure */ @@ -197,6 +203,7 @@ int GmfReadBoundaryPolygons(PolMshSct *pol) return (1); } + /*----------------------------------------------------------------------------*/ /* Read the polyhedra from an already opened mesh file */ /* and store the data in the provided polyhedral structure */ @@ -206,7 +213,8 @@ int GmfReadPolyhedra(PolMshSct *pol) { int ret; - if (!pol || !pol->InrHdrTab || !pol->InrVerTab || !pol->VolHdrTab || !pol->VolFacTab) + if (!pol || !pol->InrHdrTab || !pol->InrVerTab + || !pol->VolHdrTab || !pol->VolFacTab) { return (0); } @@ -242,6 +250,7 @@ int GmfReadPolyhedra(PolMshSct *pol) return (1); } + /*----------------------------------------------------------------------------*/ /* Copy one surface polygon list of vertices in the table and return its size */ /*----------------------------------------------------------------------------*/ @@ -268,6 +277,7 @@ itg GmfGetBoundaryPolygon(PolMshSct *pol, itg EleIdx, itg *UsrTab) return (EndIdx - BegIdx + 1); } + /*----------------------------------------------------------------------------*/ /* Copy one inner polygon list of vertices in the table and return its size */ /*----------------------------------------------------------------------------*/ @@ -304,6 +314,7 @@ itg GmfGetInnerPolygon(PolMshSct *pol, itg EleIdx, itg *UsrTab) return (EndIdx - BegIdx + 1); } + /*----------------------------------------------------------------------------*/ /* Copy one polyhedra list of polygonal faces in the table and return its size*/ /*----------------------------------------------------------------------------*/ @@ -330,6 +341,7 @@ itg GmfGetPolyhedron(PolMshSct *pol, itg EleIdx, itg *UsrTab) return (EndIdx - BegIdx + 1); } + /*----------------------------------------------------------------------------*/ /* Create the tessellation in triangles of a polygon */ /* Output: number of triangles, list of trangles and visibility of egdes */ @@ -370,11 +382,6 @@ itg GmfTesselatePolygon(PolMshSct *pol, itg EleIdx, itg (*Tri)[3], itg (*VisEdg) VisEdg[NmbTri - 1][1] = 1; VisEdg[NmbTri - 1][2] = 0; - // for (i = 0; i < NmbTri; i++) { - // printf("GmfTesselatePolygon: Tri[%d] %d %d %d \n", i, Tri[i][0], Tri[i][1], Tri[i][2]); - // printf("GmfTesselatePolygon: VisEdg[%d] %d %d %d \n", i, VisEdg[i][0], VisEdg[i][1], VisEdg[i][2]); - // } - return NmbTri; }