Added libCCMIO

This commit is contained in:
Henrik Rusche 2017-04-04 21:46:38 +02:00
parent 0d45ee3a16
commit d1128a1056
8 changed files with 107 additions and 5 deletions

View file

@ -116,6 +116,13 @@ if(PARMGRIDGEN_FOUND)
set_property(TARGET parmgridgen PROPERTY IMPORTED_LOCATION ${PARMGRIDGEN_LIBRARY})
endif()
find_package(CCMIO REQUIRED)
if(CCMIO_FOUND)
add_library(ccmio SHARED IMPORTED)
set_property(TARGET ccmio PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CCMIO_INCLUDE_DIRS})
set_property(TARGET ccmio PROPERTY IMPORTED_LOCATION ${CCMIO_LIBRARY})
set_property(TARGET ccmio PROPERTY INTERFACE_LINK_LIBRARIES ${CCMIO_LIBRARIES})
endif()
#
# Recurse into the source

View file

@ -30,4 +30,4 @@
#
# --------------------------------------------------------------------------
#add_subdirectory(ccm26ToFoam)
add_subdirectory(ccm26ToFoam)

View file

@ -41,6 +41,6 @@ if(NOT FOAM_FOUND)
endif()
add_foam_executable(ccm26ToFoam
DEPENDS finiteVolume meshTools
DEPENDS finiteVolume meshTools ccmio
SOURCES ${SOURCES}
)

View file

@ -34,7 +34,7 @@ add_subdirectory(foamToEnsight)
add_subdirectory(smapToFoam)
add_subdirectory(foamToVTK)
add_subdirectory(foamToEnsightParts)
#add_subdirectory(foamToTecplot360)
add_subdirectory(foamToTecplot360)
add_subdirectory(foamToFieldview9)
add_subdirectory(foamDataToFluent)
add_subdirectory(foamToGMV)

View file

@ -31,3 +31,20 @@
# --------------------------------------------------------------------------
add_subdirectory(tecio)
list(APPEND SOURCES
tecplotWriter.C
vtkMesh.C
foamToTecplot360.C
)
# Set minimal environment for external compilation
if(NOT FOAM_FOUND)
cmake_minimum_required(VERSION 2.8)
find_package(FOAM REQUIRED)
endif()
add_foam_executable(foamToTecplot360
DEPENDS finiteVolume meshTools tecio
SOURCES ${SOURCES}
)

View file

@ -51,6 +51,43 @@ list(APPEND SOURCES
TranslatedString.cpp
)
add_foam_library(tecio SHARED ${SOURCES})
#target_link_libraries(tecio finiteVolume)
target_compile_definitions(tecio PRIVATE MAKEARCHIVE USEENUM THREED ENGINE)
if(UNIX)
target_compile_definitions(tecio PRIVATE LINUX)
target_compile_options(tecio PRIVATE -U_WIN32)
if(CMAKE_${LANG}_COMPILER_ID STREQUAL "Intel")
target_compile_definitions(tecio PRIVATE LINUXI64)
else()
target_compile_definitions(tecio PRIVATE LINUX64)
target_compile_options(tecio PRIVATE -U_WIN32)
endif()
elseif(APPLE)
target_compile_definitions(tecio PRIVATE DARWIN LINUX64)
target_compile_options(tecio PRIVATE -U_WIN32)
elseif(MINGW)
target_compile_definitions(tecio PRIVATE LINUX)
endif()
# This tries to mimic
#
#if defined(linux64)
# TECIO_FLAGS = -DMAKEARCHIVE -DLINUX -DLINUX64 -DUSEENUM -DTHREED -U_WIN32 -DENGINE
#elif defined(darwinIntel) || defined(darwinIntel64) || defined(darwinPpc) || defined(darwinPpc64)
# TECIO_FLAGS = -DMAKEARCHIVE -DDARWIN -DUSEENUM -DTHREED -U_WIN32 -DENGINE
#elif defined(linuxIA64)
# TECIO_FLAGS = -DMAKEARCHIVE -DLINUX -DLINUXI64 -DUSEENUM -DTHREED -U_WIN32 -DENGINE
#elif defined(linux)
# TECIO_FLAGS = -DMAKEARCHIVE -DLINUX -DLINUX64 -DUSEENUM -DTHREED -U_WIN32 -DENGINE
#elif defined(darwinIntel)
# warning "DarwinIntel architecture detected"
# TECIO_FLAGS = -DMAKEARCHIVE -DLINUX -DLINUX64 -DUSEENUM -DTHREED -U_WIN32 -DENGINE
#elif defined(mingw)
# warning "MSWin mingw architecture detected"
# TECIO_FLAGS = -DMAKEARCHIVE -DLINUX -DUSEENUM -DTHREED -DENGINE
#else
#error "architecture not supported for compiling tecio."
#endif

41
cmake/FindCCMIO.cmake Normal file
View file

@ -0,0 +1,41 @@
include(LibFindMacros)
# Use pkg-config to get hints about paths
libfind_pkg_check_modules(CCMIO_PKGCONF mesquite)
# Include dir
find_path(CCMIO_INCLUDE_DIR
NAMES libccmio/ccmio.h
HINTS
ThirdParty/packages/libccmio-2.6.1/platforms/linux64GccDPOpt/include
${MESQUITE_PKGCONF_INCLUDE_DIRS}
)
find_path(CCMIO_INCLUDE_DIR2
NAMES ccmio.h
HINTS
ThirdParty/packages/libccmio-2.6.1/platforms/linux64GccDPOpt/include/libccmio
${MESQUITE_PKGCONF_INCLUDE_DIRS}
)
# Finally the library itself
find_library(CCMIO_LIBRARY
NAMES ccmio
HINTS
ThirdParty/packages/libccmio-2.6.1/platforms/linux64GccDPOpt/lib
${CCMIO_PKGCONF_LIBRARY_DIRS}
)
find_library(CCMIO_LIBRARY2
NAMES adf_ccmio
HINTS
ThirdParty/packages/libccmio-2.6.1/platforms/linux64GccDPOpt/lib
${CCMIO_PKGCONF_LIBRARY_DIRS}
)
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
set(CCMIO_PROCESS_INCLUDES CCMIO_INCLUDE_DIR CCMIO_INCLUDE_DIR2)
set(CCMIO_PROCESS_LIBS CCMIO_LIBRARY CCMIO_LIBRARY2)
libfind_process(CCMIO)