diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e0e11fbb..cab5da3ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/applications/utilities/mesh/conversion/CMakeLists.txt b/applications/utilities/mesh/conversion/CMakeLists.txt index a14e517a2..e57f0a8e3 100644 --- a/applications/utilities/mesh/conversion/CMakeLists.txt +++ b/applications/utilities/mesh/conversion/CMakeLists.txt @@ -52,4 +52,4 @@ add_subdirectory(plot3dToFoam) add_subdirectory(fluent3DMeshToFoam) add_subdirectory(tetgenToFoam) add_subdirectory(fluentMeshToFoam) -add_subdirectory(star4ToFoam) \ No newline at end of file +add_subdirectory(star4ToFoam) diff --git a/applications/utilities/mesh/conversion/Optional/CMakeLists.txt b/applications/utilities/mesh/conversion/Optional/CMakeLists.txt index 6bf17eb65..e3a43bc6e 100644 --- a/applications/utilities/mesh/conversion/Optional/CMakeLists.txt +++ b/applications/utilities/mesh/conversion/Optional/CMakeLists.txt @@ -30,4 +30,4 @@ # # -------------------------------------------------------------------------- -#add_subdirectory(ccm26ToFoam) +add_subdirectory(ccm26ToFoam) diff --git a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/CMakeLists.txt b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/CMakeLists.txt index 7ac61fc6f..1a3a6c0e2 100644 --- a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/CMakeLists.txt +++ b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/CMakeLists.txt @@ -41,6 +41,6 @@ if(NOT FOAM_FOUND) endif() add_foam_executable(ccm26ToFoam - DEPENDS finiteVolume meshTools + DEPENDS finiteVolume meshTools ccmio SOURCES ${SOURCES} ) diff --git a/applications/utilities/postProcessing/dataConversion/CMakeLists.txt b/applications/utilities/postProcessing/dataConversion/CMakeLists.txt index 27a9b4768..57e7b23cb 100644 --- a/applications/utilities/postProcessing/dataConversion/CMakeLists.txt +++ b/applications/utilities/postProcessing/dataConversion/CMakeLists.txt @@ -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) diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/CMakeLists.txt b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/CMakeLists.txt index 0ee4acbb6..c66cef97b 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/CMakeLists.txt +++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/CMakeLists.txt @@ -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} +) diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/CMakeLists.txt b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/CMakeLists.txt index 2973e92e0..4428adf7f 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/CMakeLists.txt +++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/CMakeLists.txt @@ -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 diff --git a/cmake/FindCCMIO.cmake b/cmake/FindCCMIO.cmake new file mode 100644 index 000000000..d1274c9a8 --- /dev/null +++ b/cmake/FindCCMIO.cmake @@ -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)