Detection of NETGEN_VERSION is needed if using Netgen package provided cmake file too.

Do not overwrite NETGEN_VERSION that might be cached. Use a new variable instead, NETGEN_VERSION_C.

Use cmake internal system to specify std=c++14, else you can end up with  `c++ -DFOO -std=c++14 -Ibar -std=c++11`, and the latter is used.
This commit is contained in:
Stian Skjelstad
2019-01-21 12:50:22 +01:00
committed by wmayer
parent 4c38d81d90
commit 80f82b59db
2 changed files with 49 additions and 53 deletions

View File

@@ -382,10 +382,14 @@ TARGET_LINK_LIBRARIES(NETGENPlugin SMDS SMESHDS SMESH StdMeshers ${SMESH_LIBS} )
SET_BIN_DIR(NETGENPlugin NETGENPlugin)
if(WIN32)
set_target_properties(NETGENPlugin PROPERTIES COMPILE_FLAGS "-DNETGENPLUGIN_EXPORTS -DNO_PARALLEL_THREADS -DOCCGEOMETRY -DNETGEN_VERSION=${NETGEN_VERSION}")
set_target_properties(NETGENPlugin PROPERTIES COMPILE_FLAGS "-DNETGENPLUGIN_EXPORTS -DNO_PARALLEL_THREADS -DOCCGEOMETRY -DNETGEN_VERSION=${NETGEN_VERSION_C}")
else()
set_target_properties(NETGENPlugin PROPERTIES COMPILE_FLAGS "${NETGEN_CXX_FLAGS}")
endif(WIN32)
IF(NOT NETGEN_VERSION_C LESS NETGEN_VERSION_62) # Version >= 6.2
set_target_properties(NETGENPlugin PROPERTIES CXX_STANDARD_REQUIRED ON)
set_target_properties(NETGENPlugin PROPERTIES CXX_STANDARD 14) # Standard std=c++1y could work aswell
ENDIF()
endif (BUILD_FEM_NETGEN)