From bf521630bd93aec88d32fd79d18df12a70ee896d Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Wed, 7 Oct 2020 08:35:48 +0200 Subject: [PATCH] Propagate to medcoupling C++ client code MEDCOUPLING_USE_64BIT_IDS definition --- CMakeLists.txt | 10 +++++++--- MEDCoupling_version.h.in | 7 ++++--- src/INTERP_KERNEL/MCIdType.hxx | 2 ++ src/MEDCoupling/MCType.hxx | 5 +---- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 653937485..83db58ac8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,6 +84,7 @@ OPTION(MEDCOUPLING_BUILD_TESTS "Build MED tests." ON) OPTION(MEDCOUPLING_BUILD_DOC "Build MED doc." ON) OPTION(MEDCOUPLING_BUILD_STATIC "Build MEDCoupling library in static mode." OFF) OPTION(MEDCOUPLING_USE_64BIT_IDS "Size of IDs to refer cells and nodes. 32 bits when OFF (default), 64 bits when ON." OFF) + IF(${MEDCOUPLING_USE_MPI}) SET(USE_METIS_NOT_PARMETIS OFF) ELSE() @@ -124,9 +125,10 @@ ENDIF() # Set list of prerequisites # ========================= -IF(MEDCOUPLING_USE_64BIT_IDS) - ADD_DEFINITIONS("-DMEDCOUPLING_USE_64BIT_IDS") -ENDIF(MEDCOUPLING_USE_64BIT_IDS) +set(MEDCOUPLING_USE_64BIT_IDS_CPP_DEFINE) +if(MEDCOUPLING_USE_64BIT_IDS) + set(MEDCOUPLING_USE_64BIT_IDS_CPP_DEFINE "#define MEDCOUPLING_USE_64BIT_IDS") +endif(MEDCOUPLING_USE_64BIT_IDS) IF(NOT MEDCOUPLING_MICROMED) FIND_PACKAGE(SalomeHDF5 REQUIRED) @@ -269,6 +271,8 @@ IF(WIN32) ADD_DEFINITIONS("-D_USE_MATH_DEFINES") ENDIF(WIN32) +INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) + ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(adm_local) diff --git a/MEDCoupling_version.h.in b/MEDCoupling_version.h.in index 36bf7484d..4d29e02ef 100644 --- a/MEDCoupling_version.h.in +++ b/MEDCoupling_version.h.in @@ -20,8 +20,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#if !defined(__MEDCOUPLING_VERSION_H__) -#define __MEDCOUPLING_VERSION_H__ +#pragma once /*! Specify version of MEDCoupling, as follows @@ -39,4 +38,6 @@ #define MEDCOUPLING_VERSION_STR "@MEDCOUPLING_VERSION@" #define MEDCOUPLING_VERSION @MEDCOUPLING_XVERSION@ -#endif // __MEDCOUPLING_VERSION_H__ +// define MEDCOUPLING_USE_64BIT_IDS if effectly used at medcoupling compile time + +@MEDCOUPLING_USE_64BIT_IDS_CPP_DEFINE@ diff --git a/src/INTERP_KERNEL/MCIdType.hxx b/src/INTERP_KERNEL/MCIdType.hxx index f4befdd77..b0e1dd19a 100644 --- a/src/INTERP_KERNEL/MCIdType.hxx +++ b/src/INTERP_KERNEL/MCIdType.hxx @@ -20,6 +20,8 @@ #pragma once +#include "MEDCoupling_version.h" + #include #include #include diff --git a/src/MEDCoupling/MCType.hxx b/src/MEDCoupling/MCType.hxx index 2393f9f5a..cd5e65c5d 100644 --- a/src/MEDCoupling/MCType.hxx +++ b/src/MEDCoupling/MCType.hxx @@ -18,8 +18,7 @@ // // Author : Anthony Geay (EDF R&D) -#ifndef __MEDCOUPLING_MCTYPE_HXX__ -#define __MEDCOUPLING_MCTYPE_HXX__ +#pragma once #include "MCIdType.hxx" @@ -54,5 +53,3 @@ namespace MEDCoupling #define DataArrayInt DataArrayInt32 #define DataArrayIntIterator DataArrayInt32Iterator } - -#endif -- 2.39.2