Mise à jour terminée. Pour connaître les apports de la version 13.8.4 par rapport à notre ancienne version vous pouvez lire les "Release Notes" suivantes :
https://about.gitlab.com/releases/2021/02/11/security-release-gitlab-13-8-4-released/
https://about.gitlab.com/releases/2021/02/05/gitlab-13-8-3-released/

CMakeLists.txt 11.7 KB
Newer Older
Cédric Lachat's avatar
Cédric Lachat committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
##  Copyright 2009-2016 Inria
##
## This file is part of the PaMPA software package for parallel
## mesh partitioning and adaptation.
##
## PaMPA is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## any later version.
## 
## PaMPA is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
## 
## In this respect, the user's attention is drawn to the risks associated
## with loading, using, modifying and/or developing or reproducing the
## software by the user in light of its specific status of free software,
## that may mean that it is complicated to manipulate, and that also
## therefore means that it is reserved for developers and experienced
## professionals having in-depth computer knowledge. Users are therefore
## encouraged to load and test the software's suitability as regards
## their requirements in conditions enabling the security of their
## systems and/or data to be ensured and, more generally, to use and
## operate it in the same conditions as regards security.
## 
## The fact that you are presently reading this means that you have had
## knowledge of the GPLv3 license and that you accept its terms.
##
#############################################################
##
##    \file        libpampa/CMakeLists.txt
##
##    \authors     Cedric Lachat
##
##    \brief       This file is a part of the configuration
##                 to build PaMPA with CMake
##
##    \date        Version 1.0: from: 31 May 2011
##                              to:   30 Sep 2016
##                 Version 2.0: from:  7 Oct 2016
##                              to:   12 May 2017
##
#############################################################

include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})


########################
#      dummysizes      #
########################
add_executable(dummysizes dummysizes.c)



########################
#     libpampa    #
########################
if (OLD_CMAKE)
  # Generate pampa.h
  add_custom_command(OUTPUT pampa.h
    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/library.h ${CMAKE_CURRENT_BINARY_DIR}
    COMMAND ./dummysizes library.h pampa.h DEPENDS dummysizes
    DEPENDS library.h)

  if (FORTRAN_INTERFACE)
    # Generate pampaf_common.h
    add_custom_command(OUTPUT pampaf_common.h
      COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/library_commonf.h ${CMAKE_CURRENT_BINARY_DIR}
      COMMAND ./dummysizes library_commonf.h pampaf_common.h DEPENDS dummysizes
      DEPENDS library_commonf.h)

    ## Generate pampaf.h
    add_custom_command(OUTPUT pampaf.h
      COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/libraryf.h ${CMAKE_CURRENT_BINARY_DIR}/libraryf.h
      COMMAND ./dummysizes libraryf.h pampaf.h DEPENDS dummysizes
      DEPENDS libraryf.h)
  endif (FORTRAN_INTERFACE)
else (OLD_CMAKE)
  # Generate pampa.h
  add_custom_command(OUTPUT pampa.h
    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/library.h ${CMAKE_CURRENT_BINARY_DIR}
    COMMAND $<TARGET_FILE:dummysizes> library.h pampa.h DEPENDS dummysizes
    DEPENDS library.h)

  if (SCM_VERSIONS)
    # Generate versions_ext.h
    add_custom_command(OUTPUT versions_ext.h
      COMMAND ${CMAKE_MODULE_PATH}/software_version.sh ${VERSIONS_EXT_ARGS}
      DEPENDS ${VERSIONS_EXT_DEPS})
    file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/version.cmake
      "MACRO (TODAY RESULT)
      IF (WIN32)
        EXECUTE_PROCESS(COMMAND \"cmd\" \" /C date /T\" OUTPUT_VARIABLE \${RESULT})
        string(REGEX REPLACE \"(..)/(..)/..(..).*\" \"\\\\1/\\\\2/\\\\3\" \${RESULT} \${\${RESULT}})
      ELSEIF(UNIX)
        EXECUTE_PROCESS(COMMAND \"date\" \"+%d/%m/%Y\" OUTPUT_VARIABLE \${RESULT})
        string(REGEX REPLACE \"(..)/(..)/..(..).*\" \"\\\\1/\\\\2/\\\\3\" \${RESULT} \${\${RESULT}})
      ELSE (WIN32)
        MESSAGE(SEND_ERROR \"date not implemented\")
        SET(${RESULT} 000000)
      ENDIF (WIN32)
    ENDMACRO (TODAY)
      
    TODAY(DATE)
    CONFIGURE_FILE(\${SRC} \${DST} @ONLY)
    ")

    add_custom_target(
      version
      ${CMAKE_COMMAND}
      -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/core_version.h.in
      -D DST=${CMAKE_CURRENT_BINARY_DIR}/version.h
      -P ${CMAKE_CURRENT_BINARY_DIR}/version.cmake
      )
    add_custom_command(TARGET version POST_BUILD
      COMMAND ${CMAKE_MODULE_PATH}/software_version2.sh
      ${CMAKE_CURRENT_BINARY_DIR}/version.h
      ${CMAKE_CURRENT_SOURCE_DIR}/version.h PAMPA ${PAMPA_SOURCE_DIR}
      )
  endif()



  if (FORTRAN_INTERFACE)
    # Generate pampaf_common.h
    add_custom_command(OUTPUT pampaf_common.h
      COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/library_commonf.h ${CMAKE_CURRENT_BINARY_DIR}
      COMMAND $<TARGET_FILE:dummysizes> library_commonf.h pampaf_common.h DEPENDS dummysizes
      DEPENDS library_commonf.h)

    ## Generate pampaf.h
    add_custom_command(OUTPUT pampaf.h
      COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/libraryf.h ${CMAKE_CURRENT_BINARY_DIR}/libraryf.h
      COMMAND $<TARGET_FILE:dummysizes> libraryf.h pampaf.h DEPENDS dummysizes
      DEPENDS libraryf.h)
  endif (FORTRAN_INTERFACE)
endif (OLD_CMAKE)

# Sources to build libpampa

set(ADAPT_C_SOURCES
  pampa.h
  dmesh_adapt_coarsen.c
  dmesh_adapt_coarsen_grow.c
  dmesh_adapt_common.h
  dmesh_adapt_common.c
  dmesh_adapt_graph_grow.c
  dmesh_adapt_mesh_grow.c
  dmesh_adapt_geompart.c
  dmesh_adapt_part.c
  dmesh_adapt.h
  dmesh_band.c
  dmesh_grow.c
  dmesh_rebuild.c
  dmesh_rebuild.h
  dmesh_zone_dist.c
  dmesh_zone_dist.h
  library_dmesh_adapt.c
  library_dmesh_band.c
  library_mesh_induce_multiple.c
  library_mesh_rebuild.c
  mesh_induce_multiple.c
  mesh_induce_multiple.h
  mesh_per_build.c
  mesh_rebuild.c
  mesh_rebuild.h
  )

set(PAMPA_C_SOURCES
  arch.h
  pampa.h
  comm.c
  common_integer.c
  common_file.c
  common_file_compress.c
  common_file_uncompress.c
  common_memory.c
  dmesh.c
  dmesh_allreduce.c
  dmesh_allreduce.h
  dmesh_build.c
  dmesh_check.c
  dmesh_gather_induce_multiple.c
  dmesh_gather_induce_multiple.h
  dmesh_ghst.c
  dmesh_io_load.c
  dmesh_io_load.h
  dmesh_io_mesh_save.c
  dmesh_io_save.c
  dmesh_io_save.h
  dmesh_iter.c
  dmesh_iter.h
  dmesh_halo.c
  dmesh_mat.c
  dmesh_overlap.c
197
  dmesh_overlap.h
Cédric Lachat's avatar
Cédric Lachat committed
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423
  dmesh_redist.c
  dmesh_redist.h
  dmesh_save.c
  dmesh_scatter.c
  dmesh_values.c
  dsmesh.c
  dsmesh.h
  dsmesh_build.c
  dsmesh_dmesh.c
  dsmesh_dmesh.h
  dsmesh_halo.c
  dsmesh_halo.h
  dsmesh_values.c
  dvalues.c
  dvalues.h
  library_av_iter.c
  library_dmesh.c
  library_dmesh_build.c
  library_dmesh_check.c
  library_dmesh_data.c
  library_dmesh_dgraph.c
  library_dmesh_gather.c
  library_dmesh_gather_induce_multiple.c
  library_dmesh_halo.c
  library_dmesh_iter.c
  library_dmesh_mat.c
  library_dmesh_io_load.c
  library_dmesh_io_save.c
  library_dmesh_io_mesh_save.c
  library_dmesh_save.c
  library_dmesh_scatter.c
  library_dmesh_values.c
  library_iter.c
  library_mesh.c
  library_mesh_build.c
  library_mesh_check.c
  library_mesh_create.c
  library_mesh_data.c
  library_mesh_io_load.c
  library_mesh_io_mesh_save.c
  library_mesh_io_surface_save.c
  library_mesh_io_save.c
  library_mesh_iter.c
  library_mesh_values.c
  library_smesh.c
  library_smesh_build.c
  library_smesh_data.c
  library_smesh_io_save.c
  library_smesh_mesh.c
  library_smesh_values.c
  #library_topo_io_load.c
  library_versions.c
  mesh.c
  mesh_build.c
  mesh_check.c
  mesh_create.c
  #mesh_coarsen.c
  #mesh_coarsen.h
  mesh_io_load.c
  mesh_io_load.h
  mesh_io_mesh_save.c
  mesh_io_surface_save.c
  mesh_io_save.c
  mesh_iter.c
  mesh_values.c
  smesh.c
  smesh_build.c
  smesh_io_save.c
  smesh_mesh.c
  smesh_mesh.h
  smesh_values.c
  strat.h
  values.c
  values.h)
  
if (PAMPA_MULTILEVEL)
  list(APPEND PAMPA_C_SOURCES
  library_mdmesh.c
  library_mdmesh_coar_level_build.c
  library_mdmesh_dmesh_data.c
  library_mdmesh_iter.c
  library_mdmesh_level.c
  library_mdmesh_redist.c
  mdmesh.c
  mdmesh_coar_level_build.c
  mdmesh_coar_level_build.h
  mdmesh_iter.c
  mdmesh_level.c
  mdmesh_mesh_levels.c
  mdmesh_redist.c)
endif ()

if (SCM_VERSIONS)
  list (APPEND PAMPA_C_SOURCES
    version.h
    versions_ext.h)
endif ()
if (PTSCOTCH)
  list (APPEND PAMPA_C_SOURCES
  	dgraph_graph.c
  	dgraph_graph.h
  	dmesh_dgraph.c
  	dmesh_dgraph.h
  	dmesh_graph.c
  	dmesh_graph.h
  	dmesh_map.c
  	library_dmesh_map.c
  	library_dmesh_redist.c
  	library_mesh_map.c
  	library_parser.c
  	mesh_graph.c
  	mesh_graph.h
  	mesh_map.c)
endif ()

if (FORTRAN_INTERFACE)
  set(PAMPA_FORTRAN_SOURCES
    dmesh_f.c
    library_dmesh_values_f.c
    library_mesh_values_f.c
    pampaf.h
    pampaf_common.h
    library_dmesh.F90
    library_dmesh_build.F90
    library_dmesh_check.F90
    library_dmesh_data.F90
    library_dmesh_gather.F90
    library_dmesh_halo.F90
    library_dmesh_iter.F90
    library_dmesh_mat.F90
    library_dmesh_redist.F90
    library_dmesh_scatter_f.c
    library_dmesh_scatter.F90
    library_dmesh_values.F90
    library_iter.F90
    library_mesh.F90
    library_mesh_build.F90
    library_mesh_check.F90
    library_mesh_data.F90
    library_mesh_iter.F90
    library_mesh_values.F90
    library_types.F90
    library.F90)
  if (PTSCOTCH)
    list (APPEND PAMPA_FORTRAN_SOURCES
      library_dmesh_map.F90
      library_mesh_map.F90
      library_parser.F90
      )
  endif ()
else (FORTRAN_INTERFACE)
  set (PAMPA_FORTRAN_SOURCES)
endif (FORTRAN_INTERFACE)



add_library(
  pampa
  ${PAMPA_C_SOURCES}
  ${PAMPA_FORTRAN_SOURCES})
if (SCM_VERSIONS)
  add_dependencies(pampa
    version)
endif ()

add_library(
  pampaerr
  pampa.h
  library_error.c)

add_library(
  pampaerrexit
  pampa.h
  library_error_exit.c)


set_target_properties(pampa PROPERTIES VERSION
  ${PAMPA_VERSION}.${PAMPA_RELEASE}.${PAMPA_PATCHLEVEL})

if (OLD_CMAKE)
  if (PAMPA_BUILD_ALONE)
    add_custom_command(TARGET pampa POST_BUILD
      COMMAND ${CMAKE_COMMAND} -E copy libpampa.a ${PAMPA_SOURCE_DIR}/pampa/lib
      )
    add_custom_command(TARGET pampaerr POST_BUILD
      COMMAND ${CMAKE_COMMAND} -E copy libpampaerr.a ${PAMPA_SOURCE_DIR}/pampa/lib
      )
    add_custom_command(TARGET pampaerrexit POST_BUILD
      COMMAND ${CMAKE_COMMAND} -E copy libpampaerrexit.a ${PAMPA_SOURCE_DIR}/pampa/lib
      )
  endif ()
else (OLD_CMAKE)
  if (PAMPA_BUILD_ALONE)
    add_custom_command(TARGET pampa POST_BUILD
      COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:pampa> ${PAMPA_SOURCE_DIR}/pampa/lib
      )
    add_custom_command(TARGET pampaerr POST_BUILD
      COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:pampaerr> ${PAMPA_SOURCE_DIR}/pampa/lib
      )
    add_custom_command(TARGET pampaerrexit POST_BUILD
      COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:pampaerrexit> ${PAMPA_SOURCE_DIR}/pampa/lib
      )
  endif ()
endif (OLD_CMAKE)
if (FORTRAN_INTERFACE)
  add_custom_command(TARGET pampa POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/MOD/pampa.mod ${PAMPA_SOURCE_DIR}/pampa/include
    )
endif (FORTRAN_INTERFACE)

# Specify where libpampa and include files will be installed
if (BUILD_SHARED_LIBS)
install(TARGETS pampa LIBRARY DESTINATION lib)
install(TARGETS pampaerr LIBRARY DESTINATION lib)
install(TARGETS pampaerrexit LIBRARY DESTINATION lib)
else ()
install(TARGETS pampa ARCHIVE DESTINATION lib)
install(TARGETS pampaerr ARCHIVE DESTINATION lib)
install(TARGETS pampaerrexit ARCHIVE DESTINATION lib)
endif ()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pampa.h
  DESTINATION include)
if (FORTRAN_INTERFACE)
  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pampaf.h ${PROJECT_BINARY_DIR}/MOD/pampa.mod DESTINATION include)
endif (FORTRAN_INTERFACE)