CMakeLists.txt 15.4 KB
Newer Older
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 197 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 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581





########################
#  Main configuration  #
########################

if (DEFINED ENV{JENKINS})
  set(CMAKE_BUILD_TYPE $ENV{BUILD} CACHE STRING "toto" FORCE)
endif ()


cmake_minimum_required(VERSION 2.6.4)
if (NOT DEFINED FORTRAN_INTERFACE)
endif ()
if (FORTRAN_INTERFACE)
endif ()
if ((NOT DEFINED FORTRAN_INTERFACE) OR (FORTRAN_INTERFACE))
  project(PAMPA C Fortran CXX)
else ()
  project(PAMPA C CXX)
endif ()

# Add CTest
enable_testing()

# Add modules
include(CMakeDependentOption)
include(CheckSymbolExists)


set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeScripts)
set(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/MOD)

# Define some variables which will be fill in with ccmake or cmake-gui
set(VALGRIND_EXE "/usr/bin/valgrind" CACHE TYPE "Valgrind with its path")
set(VALGRIND_ARGS "" CACHE TYPE "Valgrind arguments")
mark_as_advanced(VALGRIND_EXE VALGRIND_ARGS)

option(FORTRAN_INTERFACE "Build fortran interface to use PaMPA in fortran programs" OFF)
if (FORTRAN_INTERFACE)
  add_definitions (-DNOT_DOXYGEN)
endif ()

# Temporary, to remove old configuration
if (DEFINED COMMON_PTHREAD)
  unset (PTHREAD CACHE)
  unset (COMMON_PTHREAD CACHE)
  unset (PAMPA_PTHREAD CACHE)
endif ()

set (PTHREAD_LIST "None;IO;Comm;All")
set (PTHREAD "All" CACHE STRING "Pthread use level: possible values ${PTHREAD_LIST}")
set_property (CACHE PTHREAD PROPERTY STRINGS ${PTHREAD_LIST})
list (FIND PTHREAD_LIST ${PTHREAD} FND)

if (${FND} EQUAL -1)
  message (FATAL_ERROR "Value for PTHREAD is not correct, you have to choose one item in the following list ${PTHREAD_LIST}")
endif ()


# Temporary, to remove old configuration
if (DEFINED COMM_MANUAL)
  unset (COMM_MANUAL CACHE)
  unset (COMM_TYPE CACHE)
endif ()
set (COMM_TYPE_LIST "Automatic;Point-to-point;Collective")
set (COMM_TYPE "Automatic" CACHE STRING "Communication type chosen to exhange data between subdomains: possible values ${COMM_TYPE_LIST}")
set_property (CACHE COMM_TYPE PROPERTY STRINGS ${COMM_TYPE_LIST})
list (FIND COMM_TYPE_LIST ${COMM_TYPE} FND)

if (${FND} EQUAL -1)
  message (FATAL_ERROR "Value for COMM_TYPE is not correct, you have to choose one item in the following list ${COMM_TYPE_LIST}")
endif ()

if (COMM_TYPE STREQUAL "Point-to-point")
  add_definitions (-DPAMPA_COMM_PTOP)
elseif (COMM_TYPE STREQUAL "Collective")
  add_definitions (-DPAMPA_COMM_COLL)
endif ()

option (NETLOC "Netloc" ON)
if (NETLOC)
  add_definitions (-DNETLOC)
  set (NETLOC_HOME "" CACHE PATH "NETLOC home directory")
  #find_package (NETLOC REQUIRED)
  set (NETLOC_INCLUDE_DIR "")
  set (NETLOC_LIBRARY "")
  include_directories(${NETLOC_INCLUDE_DIR})
endif ()

option(PAMPA_RENAME "Rename internal function names" ON)
if (PAMPA_RENAME)
  add_definitions (-DPAMPA_RENAME)
endif ()

option(PAMPA_ADAPT "Adapt functions" OFF)
if (PAMPA_ADAPT)
  add_definitions (-DPAMPA_ADAPT)
endif ()

option(PAMPA_MULTILEVEL "Multilevel meshes" OFF)

option(COMMON_MEMORY_TRACE "Rename internal function names" OFF)
if (COMMON_MEMORY_TRACE)
  add_definitions (-DCOMMON_MEMORY_TRACE)
endif ()

cmake_dependent_option(COMMON_MEMORY_USER_FILE "User file (defined as char PAMPA_memFilename[]) for memory logs" ON "COMMON_MEMORY_TRACE" OFF)
if (COMMON_MEMORY_USER_FILE)
  add_definitions (-DCOMMON_MEMORY_USER_FILE)
endif ()

option(SAMPLES "Build samples" OFF)
if (SAMPLES)
  set (SAMPLE_TYPE_LIST "All;Compounds;Units")
  set (SAMPLE_TYPE "All" CACHE STRING "Choose which categories of samples: possible values ${SAMPLE_TYPE_LIST}")
  set_property (CACHE SAMPLE_TYPE PROPERTY STRINGS ${SAMPLE_TYPE_LIST})
  list (FIND SAMPLE_TYPE_LIST ${SAMPLE_TYPE} FND)

  if (${FND} EQUAL -1)
    message (FATAL_ERROR "Value for SAMPLE_TYPE is not correct, you have to choose one item in the following list ${SAMPLE_TYPE_LIST}")
  endif ()

  set (SAMPLE_PREFIX "pampa")
endif ()

option(PAMPA_BUILD_DOC "Build documentation for PaMPA" OFF)
option(PAMPA_BUILD_ALONE "Build PaMPA in one build folder" OFF)
mark_as_advanced(PAMPA_BUILD_DOC PAMPA_BUILD_ALONE)
#######################
# Find some libraries #
#######################


if (COMMON_COMPRESSION)
  # BZIP2
  find_package (BZip2)
  message (STATUS "bzip2: ${BZIP2_FOUND}")
  if (BZIP2_FOUND)
    add_definitions (-DCOMMON_FILE_COMPRESS_BZ2)
    include_directories(${BZIP2_INCLUDE_DIR})
    #list (APPEND PAMPA_DEPENDENCIES ${BZIP2_LIBRARIES})
    list (APPEND PAMPA_DEPENDENCIES ${BZIP2_LIBRARY} ${BZIP2_LIBRARIES})
  endif (BZIP2_FOUND)
endif (COMMON_COMPRESSION)


# MMG3D4
option (PAMPA_MMG3D4 "Build PaMPA-MMG3D4 library" OFF)
cmake_dependent_option(PAMPA_MMG3D4_SCOTCH "If MMG3D4 is built with Scotch" ON "PAMPA_MMG3D4" OFF)
if  (PAMPA_MMG3D4)
  add_definitions (-DMMG3D4)
  set (MMG3D4_HOME ${MMG3D4_HOME-INT} CACHE PATH "MMG3D4 home directory")
  set (MMG3D4_LIBNAME ${MMG3D4_LIBNAME-INT} CACHE STRING "MMG3D4 library name")
  find_package (MMG3D4 REQUIRED)
  set(CMAKE_REQUIRED_INCLUDES ${MMG3D4_INCLUDE_DIR})
  ##set (CMAKE_REQUIRED_DEFINITIONS -DMMG3D4_REQUIRED)
  #set (HAVE_MMG3D4_H "HAVE_MMG3D4_H")
  #check_symbol_exists (MMG3D4_REQUIRED libmmg3d4.h HAVE_MMG3D4_H)
  #if (NOT HAVE_MMG3D4_H)
  #  message (FATAL_ERROR " MMG3D4 wat not compiled with MMG3D4_REQUIRED option")
  #endif ()
else  ()
  unset (MMG3D4_HOME CACHE)
  unset (MMG3D4_LIBNAME CACHE)
endif  ()


# MMG3D5
option (PAMPA_MMG3D5 "Build PaMPA-MMG3D5 library" OFF)
cmake_dependent_option(PAMPA_MMG3D5_SCOTCH "If MMG3D5 is built with Scotch" ON "PAMPA_MMG3D5" OFF)
if  (PAMPA_MMG3D5)
  add_definitions (-DMMG3D5)
  set (MMG3D5_HOME ${MMG3D5_HOME-INT} CACHE PATH "MMG3D5 home directory")
  set (MMG3D5_LIBNAME ${MMG3D5_LIBNAME-INT} CACHE STRING "MMG3D5 library name")
  find_package (MMG3D5 REQUIRED)
else  ()
  unset (MMG3D5_HOME CACHE)
  unset (MMG3D5_LIBNAME CACHE)
endif  ()

# MMG3D
option (PAMPA_MMG3D "Build PaMPA-MMG3D library" OFF)
cmake_dependent_option(PAMPA_MMG3D_SCOTCH "If MMG3D is built with Scotch" ON "PAMPA_MMG3D" OFF)
if  (PAMPA_MMG3D)
  add_definitions (-DMMG3D)
  set (MMG3D_HOME ${MMG3D_HOME-INT} CACHE PATH "MMG3D home directory")
  set (MMG3D_LIBNAME ${MMG3D_LIBNAME-INT} CACHE STRING "MMG3D library name")
  find_package (MMG3D REQUIRED)
else  ()
  unset (MMG3D_HOME CACHE)
  unset (MMG3D_LIBNAME CACHE)
endif  ()

# MSHINT
option (PAMPA_MSHINT "Build PaMPA-MSHINT library" OFF)
if  (PAMPA_MSHINT)
  add_definitions (-DMSHINT)
  set (MSHINT_HOME ${MSHINT_HOME-INT} CACHE PATH "MSHINT home directory")
  set (MSHINT_LIBNAME ${MSHINT_LIBNAME-INT} CACHE STRING "MSHINT library name")
  find_package (MSHINT REQUIRED)
  set (LIBMESH5_HOME ${LIBMESH5_HOME-INT} CACHE PATH "LIBMESH5 home directory")
  set (LIBMESH5_LIBNAME ${LIBMESH5_LIBNAME-INT} CACHE STRING "LIBMESH5 library name")
  find_package (LIBMESH5 REQUIRED)
else  ()
  unset (MSHINT_HOME CACHE)
  unset (MSHINT_LIBNAME CACHE)
  unset (LIBMESH5_HOME CACHE)
  unset (LIBMESH5_LIBNAME CACHE)
endif  ()

# TETGEN
option (PAMPA_TETGEN "Build PaMPA-TETGEN library" OFF)
if  (PAMPA_TETGEN)
  add_definitions (-DTETGEN -DTETLIBRARY)
  set (TETGEN_HOME ${TETGEN_HOME-INT} CACHE PATH "TETGEN home directory")
  set (TETGEN_LIBNAME ${TETGEN_LIBNAME-INT} CACHE STRING "TETGEN library name")
  find_package (TETGEN REQUIRED)
  set(CMAKE_REQUIRED_INCLUDES ${TETGEN_INCLUDE_DIR})
else  ()
  unset (TETGEN_HOME CACHE)
  unset (TETGEN_LIBNAME CACHE)
endif  ()

# AEROSOL
option (PAMPA_AEROSOL "Build PaMPA-AEROSOL library" OFF)
if  (PAMPA_AEROSOL)
  add_definitions (-DAEROSOL)
  set (AEROSOL_HOME ${AEROSOL_HOME-INT} CACHE PATH "AEROSOL home directory")
  find_package (AEROSOL REQUIRED)
else  ()
  unset (AEROSOL_HOME CACHE)
endif  ()


# PT-Scotch
option (PTSCOTCH "Build PaMPA with PT-Scotch dependencies" ON)
if (PTSCOTCH)
  add_definitions (-DPTSCOTCH)
  set(PTSCOTCH_HOME "" CACHE PATH "PT-Scotch home directory")
  find_package(PTSCOTCH REQUIRED)
  include_directories(${PTSCOTCH_INCLUDE_DIR})
else ()
  unset (PTSCOTCH_HOME CACHE)
endif  ()


# MPI
set(MPI_COMPILER mpicc)
find_package(MPI REQUIRED)
include_directories(${MPI_INCLUDE_PATH})
if (MPI_C_LIBRARIES)
  list (APPEND PAMPA_DEPENDENCIES ${MPI_C_LIBRARIES} m)
else ()
  list (APPEND PAMPA_DEPENDENCIES ${MPI_LIBRARIES} m)
endif ()

if (PAMPA_BUILD_ALONE)
include_directories(${PAMPA_SOURCE_DIR}/include)
endif ()


# Pthread
if (NOT PTHREAD STREQUAL "None")
  find_package(Threads REQUIRED)
  if (NOT CMAKE_USE_PTHREADS_INIT) # if pthread was not found
    message (FATAL_ERROR "Pthread are not available")
  endif()
  if (PTHREAD STREQUAL "IO" OR PTHREAD STREQUAL "All")
    add_definitions(-DCOMMON_PTHREAD)
  endif ()
  if (PTHREAD STREQUAL "Comm" OR PTHREAD STREQUAL "All")
    add_definitions(-DPAMPA_PTHREAD)
  endif ()
  list (APPEND PAMPA_DEPENDENCIES ${CMAKE_THREAD_LIBS_INIT})
endif ()

# Define PaMPA version
set(PAMPA_VERSION "1")
set(PAMPA_RELEASE "0")
set(PAMPA_PATCHLEVEL "0")

# Add some flags
add_definitions(-DPAMPA_VERSION=${PAMPA_VERSION} -DPAMPA_RELEASE=${PAMPA_RELEASE}
  -DPAMPA_PATCHLEVEL=${PAMPA_PATCHLEVEL} -Drestrict=__restrict)


# Check CMake version
if (${CMAKE_VERSION} VERSION_LESS 2.8.4)
  set (OLD_CMAKE 1)
endif ()
set (LIBRARY_OUTPUT_DIRECTORY ${PAMPA_SOURCE_DIR}/pampa_lib)


# SCM Version Option
option (SCM_VERSIONS "Get SCM Versions for softwares" OFF)
if (SCM_VERSIONS)
  add_definitions(-DSCM_VERSIONS)
  if (PTSCOTCH)
    set(SCM_PTSCOTCH_HOME "" CACHE PATH "SCM PT-Scotch path")
    list(APPEND VERSIONS_EXT_ARGS
      PTSCOTCH:${SCM_PTSCOTCH_HOME}:${PTSCOTCH_LIBRARY},${SCOTCH_LIBRARY},${PTSCOTCH_EXTRA_LIBRARY})
    list(APPEND VERSIONS_EXT_DEPS
      ${PTSCOTCH_LIBRARY} ${SCOTCH_LIBRARY} ${PTSCOTCH_EXTRA_LIBRARY})
  endif  ()
  if (PAMPA_MMG3D4)
    set(SCM_MMG3D4_HOME "" CACHE PATH "SCM MMG3D4 path")
    list(APPEND VERSIONS_EXT_ARGS
      MMG3D4:${SCM_MMG3D4_HOME}:${MMG3D4_LIBRARY})
    list(APPEND VERSIONS_EXT_DEPS
      ${MMG3D4_LIBRARY})
  endif  ()
  if (PAMPA_MMG3D5)
    set(SCM_MMG3D5_HOME "" CACHE PATH "SCM MMG3D5 path")
    list(APPEND VERSIONS_EXT_ARGS
      MMG3D5:${SCM_MMG3D5_HOME}:${MMG3D5_LIBRARY})
    list(APPEND VERSIONS_EXT_DEPS
      ${MMG3D5_LIBRARY})
  endif  ()
  if (PAMPA_MMG3D)
    set(SCM_MMG3D_HOME "" CACHE PATH "SCM MMG3D path")
    list(APPEND VERSIONS_EXT_ARGS
      MMG3D:${SCM_MMG3D_HOME}:${MMG3D_LIBRARY})
    list(APPEND VERSIONS_EXT_DEPS
      ${MMG3D_LIBRARY})
  endif  ()
  if (PAMPA_AEROSOL)
    set(SCM_AEROSOL_HOME "" CACHE PATH "SCM Aerosol path")
    list(APPEND VERSIONS_EXT_ARGS
      AEROSOL:${SCM_AEROSOL_HOME}:${AEROSOL_COMMON_LIBRARY},${AEROSOL_MESH_LIBRARY},${AEROSOL_IO_LIBRARY})
    list(APPEND VERSIONS_EXT_DEPS
      ${AEROSOL_COMMON_LIBRARY} ${AEROSOL_MESH_LIBRARY} ${AEROSOL_IO_LIBRARY})
  endif  ()
endif ()

option(COMMON_COMPRESSION "Build with founded compression libraries (CMake will search automatically which are availables" ON)


########################
#       tests          #
########################

if (CMAKE_VERSION VERSION_GREATER "2.8.11")
  file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test2.c "
  #include <stdio.h>
  #include <stdlib.h>

  #ifdef EXT
  extern
  #endif
  inline void f() {
  }
  ")

  file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test.c "
  #include <stdio.h>
  #include <stdlib.h>

  int main() {
  f();
  return 0;
  }
  ")

  try_compile(TEST_INLINE ${CMAKE_CURRENT_BINARY_DIR}/test
    SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test.c ${CMAKE_CURRENT_BINARY_DIR}/test2.c
    )

  if (NOT TEST_INLINE)
    try_compile(TEST_INLINE ${CMAKE_CURRENT_BINARY_DIR}/test2
      SOURCES ${CMAKE_CURRENT_BINARY_DIR}/test.c ${CMAKE_CURRENT_BINARY_DIR}/test2.c
      COMPILE_DEFINITIONS -DEXT
      )
    if (NOT TEST_INLINE)
      message (FATAL_ERROR "internal error")
    else ()
      add_definitions (-DPAMPA_WORD_EXTERN)
    endif ()
  endif ()
else (CMAKE_VERSION VERSION_GREATER "2.8.11")
  if (CMAKE_C_COMPILER MATCHES "gcc") # XXX Is-it just for gcc?
    file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test.c "
    #include <stdio.h>
    #include <stdlib.h>

    extern
    inline void f() {
    }

    int main() {
    f();
    return 0;
    }
    ")

    try_compile(TEST_INLINE ${CMAKE_CURRENT_BINARY_DIR}/test
      ${CMAKE_CURRENT_BINARY_DIR}/test.c
      )

    if (TEST_INLINE)
      add_definitions (-DPAMPA_WORD_EXTERN)
    endif ()

  endif (CMAKE_C_COMPILER MATCHES "gcc")
endif (CMAKE_VERSION VERSION_GREATER "2.8.11")

########################
#       libpampa       #
########################

add_subdirectory(${PAMPA_SOURCE_DIR}/src/libpampa)

# Add dependency on PT-Scotch
if (PTSCOTCH)
  list (APPEND PAMPA_DEPENDENCIES ${PTSCOTCH_LIBRARY})
  list (APPEND PAMPA_DEPENDENCIES ${SCOTCH_LIBRARY})
  list (APPEND PAMPA_DEPENDENCIES ${PTSCOTCH_EXTRA_LIBRARY})
endif ()



########################
#    libpampa-mmg3d4   #
########################

if  (PAMPA_MMG3D4)
  add_subdirectory (${PAMPA_SOURCE_DIR}/src/remeshers/mmg3d/libpampa-mmg3d4)
endif  ()




########################
#    libpampa-mmg3d5   #
########################

if  (PAMPA_MMG3D5)
  add_subdirectory (${PAMPA_SOURCE_DIR}/src/remeshers/mmg3d/libpampa-mmg3d5)
endif  ()




########################
#    libpampa-mmg3d    #
########################

if  (PAMPA_MMG3D)
  add_subdirectory (${PAMPA_SOURCE_DIR}/src/remeshers/mmg3d/libpampa-mmg3d)
endif  ()




########################
#    libpampa-mshint    #
########################

if  (PAMPA_MSHINT)
  add_subdirectory (${PAMPA_SOURCE_DIR}/src/interpolators/mshint/libpampa-mshint)
endif  ()




########################
#    libpampa-tetgen    #
########################

if  (PAMPA_TETGEN)
  add_subdirectory (${PAMPA_SOURCE_DIR}/src/remeshers/tetgen/libpampa-tetgen)
endif  ()




##########################
#    libpampa-aerosol    #
##########################

if  (PAMPA_AEROSOL)

  # Add dependency on Aerosol
  include_directories (${AEROSOL_INCLUDE_DIR})
  find_package(LibXml2 REQUIRED)
  include_directories( ${LIBXML2_INCLUDE_DIR} )
  list (APPEND AEROSOL_DEPENDENCIES ${AEROSOL_COMMON_LIBRARY} ${AEROSOL_MESH_LIBRARY} ${AEROSOL_IO_LIBRARY} ${LIBXML2_LIBRARIES})

  add_subdirectory (${PAMPA_SOURCE_DIR}/src/libpampa-aerosol)
endif  ()


########################
#        samples       #
########################

if (SAMPLES)
add_subdirectory(${PAMPA_SOURCE_DIR}/src/samples)
endif ()



########################
#     executables      #
########################

add_subdirectory(${PAMPA_SOURCE_DIR}/src/pampa)



########################
#        tests         #
########################

# Add target on Unix
if(UNIX)
  add_custom_target(all_and_test COMMAND make all COMMAND ctest --force-new-ctest-process --output-on-failure)
endif(UNIX)





########################
#      real clean      #
########################

if(UNIX)
  if (PAMPA_BUILD_ALONE)
    add_custom_target(realclean
      COMMAND make clean
      COMMAND ${CMAKE_COMMAND} -E remove ${PAMPA_SOURCE_DIR}/include/*
      COMMAND ${CMAKE_COMMAND} -E remove ${PAMPA_SOURCE_DIR}/lib/*
      )
  else ()
    add_custom_target(realclean
      COMMAND make clean
      )
  endif ()
endif(UNIX)

########################
#       install        #
########################

install(FILES ${PTSCOTCH_INCLUDE_DIR}/ptscotch.h DESTINATION include)
install(FILES ${PTSCOTCH_LIBRARY} ${PTSCOTCH_EXTRA_LIBRARY} DESTINATION lib)




########################
#      uninstall       #
########################

# uninstall target
configure_file(
  "${PAMPA_SOURCE_DIR}/src/cmake_uninstall.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
  IMMEDIATE @ONLY)

add_custom_target(uninstall
    COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)






########################
#    documentation     #
########################

if (PAMPA_BUILD_DOC)
  if (EXISTS ${PAMPA_SOURCE_DIR}/docs/CMakeLists.txt)
    add_subdirectory(${PAMPA_SOURCE_DIR}/docs)
  endif()
endif ()