Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Algiane committed Oct 1, 2021
2 parents dd093ae + ec74d30 commit cf9bb59
Show file tree
Hide file tree
Showing 75 changed files with 3,870 additions and 3,704 deletions.
57 changes: 37 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
## use this copy of the mmg distribution only if you accept them.
## =============================================================================

CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)

# if PROJECT_NAME is defined, mmg is a subproject
if(DEFINED PROJECT_NAME)
Expand Down Expand Up @@ -190,6 +190,13 @@ IF ( BUILD_MMG3D OR BUILD_MMGS )
ELSE ()
SET(BUILD_MMGS3D OFF)
ENDIF()

# Explicitly set the DNDEBUG flag in case the user or a parent project overrides
# it.
if (NOT CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions(-DNDEBUG)
endif()

############################################################################
#####
##### Fortran header: libmmgtypesf.h
Expand Down Expand Up @@ -311,6 +318,9 @@ ENDFUNCTION()

OPTION(BUILD_SHARED_LIBS "Build shared libraries" OFF)
INVERT_BOOL("BUILD_STATIC_LIBS" ${BUILD_SHARED_LIBS})
IF ( (${BUILD_STATIC_LIBS} EQUAL ON) AND NOT CMAKE_POSITION_INDEPENDENT_CODE)
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
ENDIF()

#------------------------------- mmg2d
CMAKE_DEPENDENT_OPTION ( LIBMMG2D_STATIC "Compile the mmg2d static library" ${BUILD_STATIC_LIBS}
Expand Down Expand Up @@ -425,6 +435,17 @@ CMAKE_DEPENDENT_OPTION(
###############################################################################
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)

# CTEST_OUTPUT_DIR MUST BE SETTED HERE TO AVOID UNINITIALIZATION FOR LIBRARY
# TESTS DEFS
OPTION ( BUILD_TESTING "Enable/Disable continuous integration" OFF )

IF( BUILD_TESTING )
SET ( CTEST_OUTPUT_DIR ${PROJECT_BINARY_DIR}/TEST_OUTPUTS
CACHE PATH "Path toward the tests outputs" )
MARK_AS_ADVANCED ( CTEST_OUTPUT_DIR )
FILE ( MAKE_DIRECTORY ${CTEST_OUTPUT_DIR} )
ENDIF ( )

IF ( BUILD_MMG2D )
INCLUDE(cmake/modules/mmg2d.cmake)
ENDIF ( )
Expand All @@ -443,7 +464,7 @@ ENDIF ( )

IF( SCOTCH_FOUND )
# Include Scotch Dir here to ensure that Mmg doesn't search it's own headers in /usr/local
INCLUDE_DIRECTORIES(PUBLIC ${SCOTCH_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${SCOTCH_INCLUDE_DIRS})
ENDIF()

IF ( MmgTargetsExported )
Expand Down Expand Up @@ -473,8 +494,6 @@ ENDIF()
#####
###############################################################################

OPTION ( BUILD_TESTING "Enable/Disable continuous integration" OFF )

CMAKE_DEPENDENT_OPTION (
ONLY_VERY_SHORT_TESTS "Enable/Disable very short tests" OFF
"BUILD_TESTING;NOT LONG_TESTS" OFF )
Expand All @@ -490,18 +509,12 @@ CMAKE_DEPENDENT_OPTION ( COVERAGE "Watch code coverage (Linux only)" OFF

IF( BUILD_TESTING )

SET ( CTEST_OUTPUT_DIR ${PROJECT_BINARY_DIR}/TEST_OUTPUTS
CACHE PATH "Path toward the tests outputs" )
MARK_AS_ADVANCED ( CTEST_OUTPUT_DIR )

FILE ( MAKE_DIRECTORY ${CTEST_OUTPUT_DIR} )

IF ( NOT ONLY_VERY_SHORT_TESTS )
##-------------------------------------------------------------------##
##------- Get the continuous integration tests ----------------------##
##-------------------------------------------------------------------##
INCLUDE(cmake/modules/LoadCiTests.cmake)
ENDIF ( )
ENDIF ( )

##-------------------------------------------------------------------##
##------- Set the continuous integration options --------------------##
Expand Down Expand Up @@ -555,18 +568,22 @@ ENDIF ( )
SET(LISTEXEC_MMG ${LISTEXEC_MMGS} ${LISTEXEC_MMG3D})
SET(EXECUT_MMG ${EXECUT_MMGS} ${EXECUT_MMG3D})

# Change authorisations for some files...
IF ( EXISTS ${CTEST_OUTPUT_DIR}/LeakCheck_AbnormalEnd7/unreadable.meshb)
FILE(REMOVE ${CTEST_OUTPUT_DIR}/LeakCheck_AbnormalEnd7/unwrittable.meshb)
# Make some files not openable
IF ( EXISTS ${CTEST_OUTPUT_DIR}/unwrittable7.meshb
AND NOT IS_DIRECTORY ${CTEST_OUTPUT_DIR}/unwrittable7.meshb )
FILE ( REMOVE ${CTEST_OUTPUT_DIR}/unwrittable7.meshb )
ENDIF ()
IF ( NOT EXISTS ${CTEST_OUTPUT_DIR}/unwrittable7.meshb)
FILE(MAKE_DIRECTORY ${CTEST_OUTPUT_DIR}/unwrittable7.meshb)
ENDIF()
FILE(COPY ${MMG_CI_TESTS}/LeakCheck_AbnormalEnd7/dout.mesh
DESTINATION ${CTEST_OUTPUT_DIR}/AbnormalEnd7/unwrittable.meshb)

IF ( EXISTS ${CTEST_OUTPUT_DIR}/LeakCheck_AbnormalEnd8/unwrittable.sol)
FILE(REMOVE ${CTEST_OUTPUT_DIR}/LeakCheck_AbnormalEnd8/unwrittable.sol)
IF ( EXISTS ${CTEST_OUTPUT_DIR}/unwrittable8.sol
AND NOT IS_DIRECTORY ${CTEST_OUTPUT_DIR}/unwrittable8.sol )
FILE ( REMOVE ${CTEST_OUTPUT_DIR}/unwrittable8.sol )
ENDIF ()
IF ( NOT EXISTS ${CTEST_OUTPUT_DIR}/unwrittable8.sol)
FILE(MAKE_DIRECTORY ${CTEST_OUTPUT_DIR}/unwrittable8.sol)
ENDIF()
FILE(COPY ${MMG_CI_TESTS}/LeakCheck_AbnormalEnd8/dsol.sol
DESTINATION ${CTEST_OUTPUT_DIR}/AbnormalEnd8/unwrittable.sol)

# Add common tests for mmgs/3d appli
INCLUDE( ${PROJECT_SOURCE_DIR}/cmake/testing/mmg_tests.cmake )
Expand Down
Loading

0 comments on commit cf9bb59

Please sign in to comment.