Skip to content
Snippets Groups Projects
Commit 0ee7d462 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix MSH_NUM_TYPES + be more verbose in cmake

parent 8ceeb52d
No related branches found
No related tags found
No related merge requests found
...@@ -166,13 +166,18 @@ macro(find_all_libraries VARNAME LISTNAME PATH SUFFIX) ...@@ -166,13 +166,18 @@ macro(find_all_libraries VARNAME LISTNAME PATH SUFFIX)
endif(NUM_FOUND_LIBRARIES LESS NUM_LIST) endif(NUM_FOUND_LIBRARIES LESS NUM_LIST)
endmacro(find_all_libraries) endmacro(find_all_libraries)
macro(set_config_option VARNAME STRING)
set(${VARNAME} TRUE)
list(APPEND CONFIG_OPTIONS ${STRING})
message(STATUS "Found " ${STRING})
endmacro(set_config_option)
# check if the machine is 64 bits (this is more reliable than using # check if the machine is 64 bits (this is more reliable than using
# CMAKE_SIZEOF_VOID_P, which does not seem to work e.g. on some Suse # CMAKE_SIZEOF_VOID_P, which does not seem to work e.g. on some Suse
# machines) # machines)
check_type_size("void*" SIZEOF_VOID_P) check_type_size("void*" SIZEOF_VOID_P)
if(SIZEOF_VOID_P EQUAL 8) if(SIZEOF_VOID_P EQUAL 8)
set(HAVE_64BIT_SIZE_T TRUE) set_config_option(HAVE_64BIT_SIZE_T "Have64BitSizeT")
list(APPEND CONFIG_OPTIONS "Have64BitSizeT")
endif(SIZEOF_VOID_P EQUAL 8) endif(SIZEOF_VOID_P EQUAL 8)
if(ENABLE_BLAS_LAPACK) if(ENABLE_BLAS_LAPACK)
...@@ -191,16 +196,14 @@ if(ENABLE_BLAS_LAPACK) ...@@ -191,16 +196,14 @@ if(ENABLE_BLAS_LAPACK)
set(MKL_LIBS_REQUIRED libguide40 mkl_intel_c mkl_intel_thread mkl_core) set(MKL_LIBS_REQUIRED libguide40 mkl_intel_c mkl_intel_thread mkl_core)
find_all_libraries(LAPACK_LIBRARIES MKL_LIBS_REQUIRED "" ${MKL_PATH}) find_all_libraries(LAPACK_LIBRARIES MKL_LIBS_REQUIRED "" ${MKL_PATH})
if(LAPACK_LIBRARIES) if(LAPACK_LIBRARIES)
set(HAVE_BLAS TRUE) set_config_option(HAVE_BLAS "Blas(IntelMKL)")
set(HAVE_LAPACK TRUE) set_config_option(HAVE_LAPACK "Lapack(IntelMKL)")
list(APPEND CONFIG_OPTIONS "IntelMKL")
else(LAPACK_LIBRARIES) else(LAPACK_LIBRARIES)
set(REFLAPACK_LIBS_REQUIRED lapack blas g2c gcc) set(REFLAPACK_LIBS_REQUIRED lapack blas g2c gcc)
find_all_libraries(LAPACK_LIBRARIES REFLAPACK_LIBS_REQUIRED "" "") find_all_libraries(LAPACK_LIBRARIES REFLAPACK_LIBS_REQUIRED "" "")
if(LAPACK_LIBRARIES) if(LAPACK_LIBRARIES)
set(HAVE_BLAS TRUE) set_config_option(HAVE_BLAS "Blas(Ref)")
set(HAVE_LAPACK TRUE) set_config_option(HAVE_LAPACK "Lapack(Ref)")
list(APPEND CONFIG_OPTIONS "RefBlas" "RefLapack")
endif(LAPACK_LIBRARIES) endif(LAPACK_LIBRARIES)
endif(LAPACK_LIBRARIES) endif(LAPACK_LIBRARIES)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
...@@ -214,22 +217,19 @@ if(ENABLE_BLAS_LAPACK) ...@@ -214,22 +217,19 @@ if(ENABLE_BLAS_LAPACK)
set(MKL_LIBS_REQUIRED mkl_gf_lp64 iomp5 mkl_gnu_thread mkl_core guide pthread) set(MKL_LIBS_REQUIRED mkl_gf_lp64 iomp5 mkl_gnu_thread mkl_core guide pthread)
find_all_libraries(LAPACK_LIBRARIES MKL_LIBS_REQUIRED "" ${MKL_PATH}) find_all_libraries(LAPACK_LIBRARIES MKL_LIBS_REQUIRED "" ${MKL_PATH})
if(LAPACK_LIBRARIES) if(LAPACK_LIBRARIES)
set(HAVE_BLAS TRUE) set_config_option(HAVE_BLAS "Blas(IntelMKL)")
set(HAVE_LAPACK TRUE) set_config_option(HAVE_LAPACK "Lapack(IntelMKL)")
list(APPEND CONFIG_OPTIONS "IntelMKL")
endif(LAPACK_LIBRARIES) endif(LAPACK_LIBRARIES)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS") elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
# on SunOS we know blas and lapack are available in sunperf # on SunOS we know blas and lapack are available in sunperf
set(HAVE_BLAS TRUE) set_config_option(HAVE_BLAS "Blas(SubPerf)")
set(HAVE_LAPACK TRUE) set_config_option(HAVE_LAPACK "Lapack(SunPerf)")
list(APPEND CONFIG_OPTIONS "SunPerf")
set(LAPACK_FLAGS -library=sunperf) set(LAPACK_FLAGS -library=sunperf)
elseif(APPLE) elseif(APPLE)
# on Mac we also know that blas and lapack are available # on Mac we also know that blas and lapack are available
set(LAPACK_LIBRARIES "-framework vecLib") set(LAPACK_LIBRARIES "-framework vecLib")
set(HAVE_BLAS TRUE) set_config_option(HAVE_BLAS "Blas(VecLib)")
set(HAVE_LAPACK TRUE) set_config_option(HAVE_LAPACK "Lapack(VecLib)")
list(APPEND CONFIG_OPTIONS "VecLib")
endif(MSVC) endif(MSVC)
if(NOT HAVE_BLAS OR NOT HAVE_LAPACK) if(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
# if we haven't found blas and lapack without using the standard # if we haven't found blas and lapack without using the standard
...@@ -237,12 +237,10 @@ if(ENABLE_BLAS_LAPACK) ...@@ -237,12 +237,10 @@ if(ENABLE_BLAS_LAPACK)
enable_language(Fortran) enable_language(Fortran)
find_package(BLAS) find_package(BLAS)
if(BLAS_FOUND) if(BLAS_FOUND)
set(HAVE_BLAS TRUE) set_config_option(HAVE_BLAS "Blas")
list(APPEND CONFIG_OPTIONS "Blas")
find_package(LAPACK) find_package(LAPACK)
if(LAPACK_FOUND) if(LAPACK_FOUND)
set(HAVE_LAPACK TRUE) set_config_option(HAVE_LAPACK "Lapack")
list(APPEND CONFIG_OPTIONS "Lapack")
else(LAPACK_FOUND) else(LAPACK_FOUND)
set(LAPACK_LIBRARIES ${BLAS_LIBRARIES}) set(LAPACK_LIBRARIES ${BLAS_LIBRARIES})
endif(LAPACK_FOUND) endif(LAPACK_FOUND)
...@@ -257,6 +255,10 @@ if(ENABLE_BLAS_LAPACK) ...@@ -257,6 +255,10 @@ if(ENABLE_BLAS_LAPACK)
endif(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") endif(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
endif(BLAS_FOUND) endif(BLAS_FOUND)
endif(NOT HAVE_BLAS OR NOT HAVE_LAPACK) endif(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
if(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
message("WARNING: Could not find Blas or Lapack: most meshing algorithms"
"will not be functional")
endif(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
endif(ENABLE_BLAS_LAPACK) endif(ENABLE_BLAS_LAPACK)
add_subdirectory(Common) add_subdirectory(Common)
...@@ -265,31 +267,26 @@ add_subdirectory(Geo) ...@@ -265,31 +267,26 @@ add_subdirectory(Geo)
if(ENABLE_MESH) if(ENABLE_MESH)
add_subdirectory(Mesh) add_subdirectory(Mesh)
set(HAVE_MESH TRUE) set_config_option(HAVE_MESH "Mesh")
list(APPEND CONFIG_OPTIONS "Mesh")
endif(ENABLE_MESH) endif(ENABLE_MESH)
if(ENABLE_SOLVER) if(ENABLE_SOLVER)
add_subdirectory(Solver) add_subdirectory(Solver)
set(HAVE_SOLVER TRUE) set_config_option(HAVE_SOLVER "Solver")
list(APPEND CONFIG_OPTIONS "Solver")
endif(ENABLE_SOLVER) endif(ENABLE_SOLVER)
if(ENABLE_POST) if(ENABLE_POST)
add_subdirectory(Post) add_subdirectory(Post)
set(HAVE_POST TRUE) set_config_option(HAVE_POST "Post")
list(APPEND CONFIG_OPTIONS "Post")
if(ENABLE_PLUGINS) if(ENABLE_PLUGINS)
add_subdirectory(Plugin) add_subdirectory(Plugin)
set(HAVE_PLUGINS TRUE) set_config_option(HAVE_PLUGINS "Plugins")
list(APPEND CONFIG_OPTIONS "Plugins")
endif(ENABLE_PLUGINS) endif(ENABLE_PLUGINS)
endif(ENABLE_POST) endif(ENABLE_POST)
if(ENABLE_PARSER) if(ENABLE_PARSER)
add_subdirectory(Parser) add_subdirectory(Parser)
set(HAVE_PARSER TRUE) set_config_option(HAVE_PARSER "Parser")
list(APPEND CONFIG_OPTIONS "Parser")
endif(ENABLE_PARSER) endif(ENABLE_PARSER)
if(ENABLE_FLTK) if(ENABLE_FLTK)
...@@ -298,13 +295,13 @@ if(ENABLE_FLTK) ...@@ -298,13 +295,13 @@ if(ENABLE_FLTK)
find_package(FLTK) find_package(FLTK)
if(FLTK_FOUND) if(FLTK_FOUND)
add_subdirectory(Fltk) add_subdirectory(Fltk)
set(HAVE_FLTK TRUE) set_config_option(HAVE_FLTK "Fltk")
list(APPEND CONFIG_OPTIONS "Fltk")
list(APPEND EXTERNAL_INCLUDES ${FLTK_INCLUDE_DIR}) list(APPEND EXTERNAL_INCLUDES ${FLTK_INCLUDE_DIR})
if(FLTK_CONFIG_SCRIPT) if(FLTK_CONFIG_SCRIPT)
execute_process(COMMAND ${FLTK_CONFIG_SCRIPT} --api-version execute_process(COMMAND ${FLTK_CONFIG_SCRIPT} --api-version
OUTPUT_VARIABLE FLTK_VERSION) OUTPUT_VARIABLE FLTK_VERSION)
message("-- Found fltk-config script for FLTK " ${FLTK_VERSION}) string(STRIP ${FLTK_VERSION} FLTK_VERSION)
message(STATUS "Found fltk-config script for FLTK " ${FLTK_VERSION})
endif(FLTK_CONFIG_SCRIPT) endif(FLTK_CONFIG_SCRIPT)
if(ENABLE_NATIVE_FILE_CHOOSER) if(ENABLE_NATIVE_FILE_CHOOSER)
if(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1) if(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1)
...@@ -312,16 +309,14 @@ if(ENABLE_FLTK) ...@@ -312,16 +309,14 @@ if(ENABLE_FLTK)
include_directories(contrib/NativeFileChooser) include_directories(contrib/NativeFileChooser)
add_definitions(-DFLTK1) add_definitions(-DFLTK1)
endif(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1) endif(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1)
set(HAVE_NATIVE_FILE_CHOOSER TRUE) set_config_option(HAVE_NATIVE_FILE_CHOOSER "NativeFileChooser")
list(APPEND CONFIG_OPTIONS "NativeFileChooser")
endif(ENABLE_NATIVE_FILE_CHOOSER) endif(ENABLE_NATIVE_FILE_CHOOSER)
if(ENABLE_FL_TREE) if(ENABLE_FL_TREE)
if(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1) if(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1)
add_subdirectory(contrib/Fl_Tree) add_subdirectory(contrib/Fl_Tree)
include_directories(contrib/Fl_Tree) include_directories(contrib/Fl_Tree)
endif(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1) endif(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1)
set(HAVE_FL_TREE TRUE) set_config_option(HAVE_FL_TREE "FlTree")
list(APPEND CONFIG_OPTIONS "FlTree")
endif(ENABLE_FL_TREE) endif(ENABLE_FL_TREE)
if(APPLE AND FLTK_VERSION EQUAL 1.3) if(APPLE AND FLTK_VERSION EQUAL 1.3)
# required for system sounds (until cmake updates find_package(FLTK)) # required for system sounds (until cmake updates find_package(FLTK))
...@@ -334,8 +329,7 @@ elseif(ENABLE_QT) ...@@ -334,8 +329,7 @@ elseif(ENABLE_QT)
include(${QT_USE_FILE}) include(${QT_USE_FILE})
if(QT_FOUND) if(QT_FOUND)
add_subdirectory(Qt) add_subdirectory(Qt)
set(HAVE_QT TRUE) set_config_option(HAVE_QT "Qt")
list(APPEND CONFIG_OPTIONS "Qt")
list(APPEND EXTERNAL_INCLUDES ${QT_INCLUDE_DIR}) list(APPEND EXTERNAL_INCLUDES ${QT_INCLUDE_DIR})
endif(QT_FOUND) endif(QT_FOUND)
endif(ENABLE_FLTK) endif(ENABLE_FLTK)
...@@ -351,8 +345,7 @@ if(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS) ...@@ -351,8 +345,7 @@ if(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS)
find_library(FLTK_JPEG fltkjpeg) find_library(FLTK_JPEG fltkjpeg)
endif(NOT FLTK_JPEG) endif(NOT FLTK_JPEG)
if(FLTK_JPEG) if(FLTK_JPEG)
set(HAVE_LIBJPEG TRUE) set_config_option(HAVE_LIBJPEG "Jpeg(Fltk)")
list(APPEND CONFIG_OPTIONS "FltkJpeg")
list(APPEND EXTERNAL_LIBRARIES ${FLTK_JPEG}) list(APPEND EXTERNAL_LIBRARIES ${FLTK_JPEG})
foreach(DIR ${FLTK_INCLUDE_DIR}) foreach(DIR ${FLTK_INCLUDE_DIR})
list(APPEND EXTERNAL_INCLUDES ${DIR}/FL/images ${DIR}/jpeg) list(APPEND EXTERNAL_INCLUDES ${DIR}/FL/images ${DIR}/jpeg)
...@@ -362,8 +355,7 @@ if(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS) ...@@ -362,8 +355,7 @@ if(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS)
if(NOT FLTK_JPEG) if(NOT FLTK_JPEG)
find_package(JPEG) find_package(JPEG)
if(JPEG_FOUND) if(JPEG_FOUND)
set(HAVE_LIBJPEG TRUE) set_config_option(HAVE_LIBJPEG "Jpeg")
list(APPEND CONFIG_OPTIONS "Jpeg")
list(APPEND EXTERNAL_LIBRARIES ${JPEG_LIBRARIES}) list(APPEND EXTERNAL_LIBRARIES ${JPEG_LIBRARIES})
list(APPEND EXTERNAL_INCLUDES ${JPEG_INCLUDE_DIR}) list(APPEND EXTERNAL_INCLUDES ${JPEG_INCLUDE_DIR})
endif(JPEG_FOUND) endif(JPEG_FOUND)
...@@ -375,8 +367,7 @@ if(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS) ...@@ -375,8 +367,7 @@ if(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS)
find_library(FLTK_Z fltkz) find_library(FLTK_Z fltkz)
endif(NOT FLTK_Z) endif(NOT FLTK_Z)
if(FLTK_Z) if(FLTK_Z)
set(HAVE_LIBZ TRUE) set_config_option(HAVE_LIBZ "Zlib(Fltk)")
list(APPEND CONFIG_OPTIONS "FltkZlib")
list(APPEND EXTERNAL_LIBRARIES ${FLTK_Z}) list(APPEND EXTERNAL_LIBRARIES ${FLTK_Z})
foreach(DIR ${FLTK_INCLUDE_DIR}) foreach(DIR ${FLTK_INCLUDE_DIR})
list(APPEND EXTERNAL_INCLUDES ${DIR}/FL/images ${DIR}/zlib) list(APPEND EXTERNAL_INCLUDES ${DIR}/FL/images ${DIR}/zlib)
...@@ -386,8 +377,7 @@ if(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS) ...@@ -386,8 +377,7 @@ if(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS)
if(NOT FLTK_Z) if(NOT FLTK_Z)
find_package(ZLIB) find_package(ZLIB)
if(ZLIB_FOUND) if(ZLIB_FOUND)
set(HAVE_LIBZ TRUE) set_config_option(HAVE_LIBZ "Zlib")
list(APPEND CONFIG_OPTIONS "Zlib")
list(APPEND EXTERNAL_LIBRARIES ${ZLIB_LIBRARIES}) list(APPEND EXTERNAL_LIBRARIES ${ZLIB_LIBRARIES})
list(APPEND EXTERNAL_INCLUDES ${ZLIB_INCLUDE_DIR}) list(APPEND EXTERNAL_INCLUDES ${ZLIB_INCLUDE_DIR})
endif(ZLIB_FOUND) endif(ZLIB_FOUND)
...@@ -400,8 +390,7 @@ if(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS) ...@@ -400,8 +390,7 @@ if(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS)
find_library(FLTK_PNG fltkpng) find_library(FLTK_PNG fltkpng)
endif(NOT FLTK_PNG) endif(NOT FLTK_PNG)
if(FLTK_PNG) if(FLTK_PNG)
set(HAVE_LIBPNG TRUE) set_config_option(HAVE_LIBPNG "Png(Fltk)")
list(APPEND CONFIG_OPTIONS "FltkPng")
list(APPEND EXTERNAL_LIBRARIES ${FLTK_PNG}) list(APPEND EXTERNAL_LIBRARIES ${FLTK_PNG})
foreach(DIR ${FLTK_INCLUDE_DIR}) foreach(DIR ${FLTK_INCLUDE_DIR})
list(APPEND EXTERNAL_INCLUDES ${DIR}/FL/images ${DIR}/png) list(APPEND EXTERNAL_INCLUDES ${DIR}/FL/images ${DIR}/png)
...@@ -411,8 +400,7 @@ if(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS) ...@@ -411,8 +400,7 @@ if(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS)
if(NOT FLTK_PNG) if(NOT FLTK_PNG)
find_package(PNG) find_package(PNG)
if(PNG_FOUND) if(PNG_FOUND)
set(HAVE_LIBPNG TRUE) set_config_option(HAVE_LIBPNG "Png")
list(APPEND CONFIG_OPTIONS "Png")
list(APPEND EXTERNAL_LIBRARIES ${PNG_LIBRARIES}) list(APPEND EXTERNAL_LIBRARIES ${PNG_LIBRARIES})
list(APPEND EXTERNAL_INCLUDES ${PNG_INCLUDE_DIR}) list(APPEND EXTERNAL_INCLUDES ${PNG_INCLUDE_DIR})
endif(PNG_FOUND) endif(PNG_FOUND)
...@@ -423,65 +411,53 @@ if(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS) ...@@ -423,65 +411,53 @@ if(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS)
message(SEND_ERROR "Could not find GLU") message(SEND_ERROR "Could not find GLU")
endif(NOT OPENGL_GLU_FOUND) endif(NOT OPENGL_GLU_FOUND)
add_subdirectory(Graphics) add_subdirectory(Graphics)
set(HAVE_OPENGL TRUE) set_config_option(HAVE_OPENGL "OpenGL")
list(APPEND CONFIG_OPTIONS "OpenGL")
endif(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS) endif(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS)
if(ENABLE_ANN) if(ENABLE_ANN)
add_subdirectory(contrib/ANN) add_subdirectory(contrib/ANN)
include_directories(contrib/ANN/include) include_directories(contrib/ANN/include)
set(HAVE_ANN TRUE) set_config_option(HAVE_ANN "Ann")
list(APPEND CONFIG_OPTIONS "Ann")
endif(ENABLE_ANN) endif(ENABLE_ANN)
if(ENABLE_CHACO) if(ENABLE_CHACO)
add_subdirectory(contrib/Chaco) add_subdirectory(contrib/Chaco)
include_directories(contrib/Chaco/main) include_directories(contrib/Chaco/main)
set(HAVE_CHACO TRUE) set_config_option(HAVE_CHACO "Chaco")
list(APPEND CONFIG_OPTIONS "Chaco")
endif(ENABLE_CHACO) endif(ENABLE_CHACO)
if(ENABLE_DINTEGRATION) if(ENABLE_DINTEGRATION)
add_subdirectory(contrib/DiscreteIntegration) add_subdirectory(contrib/DiscreteIntegration)
include_directories(contrib/DiscreteIntegration) include_directories(contrib/DiscreteIntegration)
set(HAVE_DINTEGRATION TRUE) set_config_option(HAVE_DINTEGRATION "DIntegration")
list(APPEND CONFIG_OPTIONS "DIntegration")
endif(ENABLE_DINTEGRATION) endif(ENABLE_DINTEGRATION)
if(ENABLE_GMM) if(ENABLE_GMM)
include_directories(contrib/gmm) include_directories(contrib/gmm)
set(HAVE_GMM TRUE) set_config_option(HAVE_GMM "Gmm")
list(APPEND CONFIG_OPTIONS "Gmm")
endif(ENABLE_GMM) endif(ENABLE_GMM)
if(ENABLE_KBIPACK) if(ENABLE_KBIPACK)
add_subdirectory(contrib/kbipack) add_subdirectory(contrib/kbipack)
include_directories(contrib/kbipack) include_directories(contrib/kbipack)
set(HAVE_KBIPACK TRUE) set_config_option(HAVE_KBIPACK "Kbipack")
list(APPEND CONFIG_OPTIONS "Kbipack")
find_library(GMP_LIB NAMES libgmp.a libgmp.dll.a) find_library(GMP_LIB NAMES libgmp.a libgmp.dll.a)
if(GMP_LIB) if(GMP_LIB)
message("-- Found GMP library") set_config_option(HAVE_GMP "GMP")
set(HAVE_GMP TRUE)
list(APPEND EXTERNAL_LIBRARIES ${GMP_LIB}) list(APPEND EXTERNAL_LIBRARIES ${GMP_LIB})
else(GMP_LIB)
message("-- GMP library not found")
endif(GMP_LIB) endif(GMP_LIB)
endif(ENABLE_KBIPACK) endif(ENABLE_KBIPACK)
if(ENABLE_MATHEX) if(ENABLE_MATHEX)
add_subdirectory(contrib/MathEx) add_subdirectory(contrib/MathEx)
include_directories(contrib/MathEx) include_directories(contrib/MathEx)
set(HAVE_MATHEX TRUE) set_config_option(HAVE_MATHEX "MathEx")
list(APPEND CONFIG_OPTIONS "MathEx")
endif(ENABLE_MATHEX) endif(ENABLE_MATHEX)
if(ENABLE_MPI) if(ENABLE_MPI)
find_package(MPI) find_package(MPI)
if(MPI_FOUND) if(MPI_FOUND)
message("-- Found MPI") set_config_option(HAVE_MPI "MPI")
set(HAVE_MPI TRUE)
list(APPEND CONFIG_OPTIONS "MPI")
list(APPEND EXTERNAL_INCLUDES ${MPI_INCLUDE_DIR}) list(APPEND EXTERNAL_INCLUDES ${MPI_INCLUDE_DIR})
list(APPEND EXTERNAL_LIBRARIES ${MPI_LIBRARIES}) list(APPEND EXTERNAL_LIBRARIES ${MPI_LIBRARIES})
include(CMakeForceCompiler) include(CMakeForceCompiler)
...@@ -492,15 +468,13 @@ endif(ENABLE_MPI) ...@@ -492,15 +468,13 @@ endif(ENABLE_MPI)
if(ENABLE_MPEG_ENCODE) if(ENABLE_MPEG_ENCODE)
add_subdirectory(contrib/mpeg_encode) add_subdirectory(contrib/mpeg_encode)
include_directories(contrib/mpeg_encode/headers) include_directories(contrib/mpeg_encode/headers)
set(HAVE_MPEG_ENCODE TRUE) set_config_option(HAVE_MPEG_ENCODE "Mpeg")
list(APPEND CONFIG_OPTIONS "Mpeg")
endif(ENABLE_MPEG_ENCODE) endif(ENABLE_MPEG_ENCODE)
if(ENABLE_METIS) if(ENABLE_METIS)
add_subdirectory(contrib/Metis) add_subdirectory(contrib/Metis)
include_directories(contrib/Metis) include_directories(contrib/Metis)
set(HAVE_METIS TRUE) set_config_option(HAVE_METIS "Metis")
list(APPEND CONFIG_OPTIONS "Metis")
message("WARNING: By including Metis you have to comply with Metis' special " message("WARNING: By including Metis you have to comply with Metis' special "
"licensing requirements stated in contrib/Metis/README.txt.") "licensing requirements stated in contrib/Metis/README.txt.")
endif(ENABLE_METIS) endif(ENABLE_METIS)
...@@ -509,24 +483,21 @@ if(ENABLE_NETGEN) ...@@ -509,24 +483,21 @@ if(ENABLE_NETGEN)
add_subdirectory(contrib/Netgen) add_subdirectory(contrib/Netgen)
include_directories(contrib/Netgen contrib/Netgen/libsrc/include include_directories(contrib/Netgen contrib/Netgen/libsrc/include
contrib/Netgen/libsrc/interface) contrib/Netgen/libsrc/interface)
set(HAVE_NETGEN TRUE) set_config_option(HAVE_NETGEN "Netgen")
list(APPEND CONFIG_OPTIONS "Netgen")
add_definitions(-DNO_PARALLEL_THREADS) add_definitions(-DNO_PARALLEL_THREADS)
endif(ENABLE_NETGEN) endif(ENABLE_NETGEN)
if(ENABLE_TETGEN_NEW AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/TetgenNew/tetgen.h) if(ENABLE_TETGEN_NEW AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/TetgenNew/tetgen.h)
add_subdirectory(contrib/TetgenNew) add_subdirectory(contrib/TetgenNew)
include_directories(contrib/TetgenNew) include_directories(contrib/TetgenNew)
set(HAVE_TETGEN TRUE) set_config_option(HAVE_TETGEN "Tetgen(New)")
list(APPEND CONFIG_OPTIONS "TetgenNew")
add_definitions(-DTETLIBRARY) add_definitions(-DTETLIBRARY)
message("WARNING: You are including an experimental version of Tetgen " message("WARNING: You are including an experimental version of Tetgen "
"that is KNOWN TO BE BUGGY on 64 bits archs and on WIN32/MSVC.") "that is KNOWN TO BE BUGGY on 64 bits archs and on WIN32/MSVC.")
elseif(ENABLE_TETGEN AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/Tetgen/tetgen.h) elseif(ENABLE_TETGEN AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/Tetgen/tetgen.h)
add_subdirectory(contrib/Tetgen) add_subdirectory(contrib/Tetgen)
include_directories(contrib/Tetgen) include_directories(contrib/Tetgen)
set(HAVE_TETGEN TRUE) set_config_option(HAVE_TETGEN "Tetgen")
list(APPEND CONFIG_OPTIONS "Tetgen")
add_definitions(-DTETLIBRARY) add_definitions(-DTETLIBRARY)
message("WARNING: By including Tetgen you have to comply with Tetgen's " message("WARNING: By including Tetgen you have to comply with Tetgen's "
"special licensing requirements stated in contrib/Tetgen/LICENSE.") "special licensing requirements stated in contrib/Tetgen/LICENSE.")
...@@ -537,8 +508,7 @@ if(ENABLE_FOURIER_MODEL) ...@@ -537,8 +508,7 @@ if(ENABLE_FOURIER_MODEL)
if(FFTW3_LIB) if(FFTW3_LIB)
find_library(FOURIER_MODEL_LIB FourierModel) find_library(FOURIER_MODEL_LIB FourierModel)
if(FOURIER_MODEL_LIB) if(FOURIER_MODEL_LIB)
set(HAVE_FOURIER_MODEL TRUE) set_config_option(HAVE_FOURIER_MODEL "FourierModel")
list(APPEND CONFIG_OPTIONS "FourierModel")
list(APPEND EXTERNAL_LIBRARIES ${FOURIER_MODEL_LIB} ${FFTW3_LIB}) list(APPEND EXTERNAL_LIBRARIES ${FOURIER_MODEL_LIB} ${FFTW3_LIB})
endif(FOURIER_MODEL_LIB) endif(FOURIER_MODEL_LIB)
endif(FFTW3_LIB) endif(FFTW3_LIB)
...@@ -550,16 +520,14 @@ if(ENABLE_MED OR ENABLE_CGNS) ...@@ -550,16 +520,14 @@ if(ENABLE_MED OR ENABLE_CGNS)
if(ENABLE_MED) if(ENABLE_MED)
find_library(MED_LIB med) find_library(MED_LIB med)
if(MED_LIB) if(MED_LIB)
set(HAVE_MED TRUE) set_config_option(HAVE_MED "Med")
list(APPEND CONFIG_OPTIONS "Med")
list(APPEND EXTERNAL_LIBRARIES ${MED_LIB}) list(APPEND EXTERNAL_LIBRARIES ${MED_LIB})
endif(MED_LIB) endif(MED_LIB)
endif(ENABLE_MED) endif(ENABLE_MED)
if(ENABLE_CGNS) if(ENABLE_CGNS)
find_library(CGNS_LIB cgns) find_library(CGNS_LIB cgns)
if(CGNS_LIB) if(CGNS_LIB)
set(HAVE_LIBCGNS TRUE) set_config_option(HAVE_LIBCGNS "Cgns")
list(APPEND CONFIG_OPTIONS "Cgns")
list(APPEND EXTERNAL_LIBRARIES ${CGNS_LIB}) list(APPEND EXTERNAL_LIBRARIES ${CGNS_LIB})
endif(CGNS_LIB) endif(CGNS_LIB)
endif(ENABLE_CGNS) endif(ENABLE_CGNS)
...@@ -572,8 +540,7 @@ if(ENABLE_MED OR ENABLE_CGNS) ...@@ -572,8 +540,7 @@ if(ENABLE_MED OR ENABLE_CGNS)
if(NOT HAVE_LIBZ) # necessary for non-GUI builds if(NOT HAVE_LIBZ) # necessary for non-GUI builds
find_package(ZLIB) find_package(ZLIB)
if(ZLIB_FOUND) if(ZLIB_FOUND)
set(HAVE_LIBZ TRUE) set_config_option(HAVE_LIBZ "Zlib")
list(APPEND CONFIG_OPTIONS "Zlib")
list(APPEND EXTERNAL_LIBRARIES ${ZLIB_LIBRARIES}) list(APPEND EXTERNAL_LIBRARIES ${ZLIB_LIBRARIES})
endif(ZLIB_FOUND) endif(ZLIB_FOUND)
endif(NOT HAVE_LIBZ) endif(NOT HAVE_LIBZ)
...@@ -589,9 +556,8 @@ if(ENABLE_TAUCS) ...@@ -589,9 +556,8 @@ if(ENABLE_TAUCS)
if(TAUCS_LIB) if(TAUCS_LIB)
find_path(TAUCS_INC "taucs.h" PATH_SUFFIXES src include) find_path(TAUCS_INC "taucs.h" PATH_SUFFIXES src include)
if(TAUCS_INC) if(TAUCS_INC)
set(HAVE_TAUCS TRUE) set_config_option(HAVE_TAUCS "Taucs")
add_definitions(-DTAUCS_CILK) add_definitions(-DTAUCS_CILK)
list(APPEND CONFIG_OPTIONS "Taucs")
list(APPEND EXTERNAL_LIBRARIES ${TAUCS_LIB}) list(APPEND EXTERNAL_LIBRARIES ${TAUCS_LIB})
list(APPEND EXTERNAL_INCLUDES ${TAUCS_INC}) list(APPEND EXTERNAL_INCLUDES ${TAUCS_INC})
endif(TAUCS_INC) endif(TAUCS_INC)
...@@ -603,8 +569,7 @@ if(ENABLE_LUA) ...@@ -603,8 +569,7 @@ if(ENABLE_LUA)
if(LUA_LIB) if(LUA_LIB)
find_path(LUA_INC "lua.h" PATH_SUFFIXES src include) find_path(LUA_INC "lua.h" PATH_SUFFIXES src include)
if(LUA_INC) if(LUA_INC)
set(HAVE_LUA TRUE) set_config_option(HAVE_LUA "Lua")
list(APPEND CONFIG_OPTIONS "Lua")
list(APPEND EXTERNAL_LIBRARIES ${LUA_LIB}) list(APPEND EXTERNAL_LIBRARIES ${LUA_LIB})
list(APPEND EXTERNAL_INCLUDES ${LUA_INC}) list(APPEND EXTERNAL_INCLUDES ${LUA_INC})
endif(LUA_INC) endif(LUA_INC)
...@@ -615,9 +580,7 @@ if(ENABLE_PETSC) ...@@ -615,9 +580,7 @@ if(ENABLE_PETSC)
set(ENV_PETSC_DIR $ENV{PETSC_DIR}) set(ENV_PETSC_DIR $ENV{PETSC_DIR})
set(ENV_PETSC_ARCH $ENV{PETSC_ARCH}) set(ENV_PETSC_ARCH $ENV{PETSC_ARCH})
if(EXISTS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/conf/petscvariables) if(EXISTS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/conf/petscvariables)
message(STATUS "Found PETSc 3") set_config_option(HAVE_PETSC "PETSc")
set(HAVE_PETSC TRUE)
list(APPEND CONFIG_OPTIONS "PETSc")
file(STRINGS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/conf/petscvariables file(STRINGS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/conf/petscvariables
PETSC_VARIABLES NEWLINE_CONSUME) PETSC_VARIABLES NEWLINE_CONSUME)
# find include directories # find include directories
...@@ -648,8 +611,7 @@ if(HAVE_PETSC AND ENABLE_SLEPC) ...@@ -648,8 +611,7 @@ if(HAVE_PETSC AND ENABLE_SLEPC)
set(ENV_SLEPC_DIR $ENV{SLEPC_DIR}) set(ENV_SLEPC_DIR $ENV{SLEPC_DIR})
find_library(SLEPC_LIB slepc PATHS ${ENV_SLEPC_DIR}/${ENV_PETSC_ARCH}/lib) find_library(SLEPC_LIB slepc PATHS ${ENV_SLEPC_DIR}/${ENV_PETSC_ARCH}/lib)
if(SLEPC_LIB) if(SLEPC_LIB)
set(HAVE_SLEPC TRUE) set_config_option(HAVE_SLEPC "SLEPc")
list(APPEND CONFIG_OPTIONS "SLEPc")
list(APPEND EXTERNAL_LIBRARIES ${SLEPC_LIB}) list(APPEND EXTERNAL_LIBRARIES ${SLEPC_LIB})
list(APPEND EXTERNAL_INCLUDES ${ENV_SLEPC_DIR}/include) list(APPEND EXTERNAL_INCLUDES ${ENV_SLEPC_DIR}/include)
endif(SLEPC_LIB) endif(SLEPC_LIB)
...@@ -687,8 +649,7 @@ if(ENABLE_OCC) ...@@ -687,8 +649,7 @@ if(ENABLE_OCC)
find_path(OCC_INC "BRep_Tool.hxx" PATHS ENV CASROOT PATH_SUFFIXES inc find_path(OCC_INC "BRep_Tool.hxx" PATHS ENV CASROOT PATH_SUFFIXES inc
include opencascade) include opencascade)
if(OCC_INC) if(OCC_INC)
set(HAVE_OCC TRUE) set_config_option(HAVE_OCC "OpenCascade")
list(APPEND CONFIG_OPTIONS "OpenCascade")
list(APPEND EXTERNAL_LIBRARIES ${OCC_LIBS}) list(APPEND EXTERNAL_LIBRARIES ${OCC_LIBS})
list(APPEND EXTERNAL_INCLUDES ${OCC_INC}) list(APPEND EXTERNAL_INCLUDES ${OCC_INC})
if(HAVE_64BIT_SIZE_T) if(HAVE_64BIT_SIZE_T)
...@@ -713,8 +674,7 @@ if(ENABLE_ACIS) ...@@ -713,8 +674,7 @@ if(ENABLE_ACIS)
if(ACIS_LIB) if(ACIS_LIB)
find_path(ACIS_INC "kernapi.hxx" PATH_SUFFIXES include) find_path(ACIS_INC "kernapi.hxx" PATH_SUFFIXES include)
if(ACIS_INC) if(ACIS_INC)
set(HAVE_ACIS TRUE) set_config_option(HAVE_ACIS "Acis")
list(APPEND CONFIG_OPTIONS "Acis")
list(APPEND EXTERNAL_LIBRARIES ${ACIS_LIB}) list(APPEND EXTERNAL_LIBRARIES ${ACIS_LIB})
list(APPEND EXTERNAL_INCLUDES ${ACIS_INC}) list(APPEND EXTERNAL_INCLUDES ${ACIS_INC})
endif(ACIS_INC) endif(ACIS_INC)
...@@ -725,8 +685,7 @@ endif(ENABLE_ACIS) ...@@ -725,8 +685,7 @@ endif(ENABLE_ACIS)
if(ENABLE_OSMESA) if(ENABLE_OSMESA)
find_library(OSMESA_LIB OSMesa) find_library(OSMESA_LIB OSMesa)
if(OSMESA_LIB) if(OSMESA_LIB)
set(HAVE_OSMESA TRUE) set_config_option(HAVE_OSMESA "OSMesa")
list(APPEND CONFIG_OPTIONS "OSMesa")
list(APPEND EXTERNAL_LIBRARIES ${OSMESA_LIB}) list(APPEND EXTERNAL_LIBRARIES ${OSMESA_LIB})
endif(OSMESA_LIB) endif(OSMESA_LIB)
endif(ENABLE_OSMESA) endif(ENABLE_OSMESA)
...@@ -736,8 +695,7 @@ if(HAVE_LUA AND ENABLE_READLINE) ...@@ -736,8 +695,7 @@ if(HAVE_LUA AND ENABLE_READLINE)
if(READLINE_LIB) if(READLINE_LIB)
find_path(READLINE_INC "readline.h" PATH_SUFFIXES src readline include) find_path(READLINE_INC "readline.h" PATH_SUFFIXES src readline include)
if(READLINE_INC) if(READLINE_INC)
set(HAVE_READLINE TRUE) set_config_option(HAVE_READLINE "Readline")
list(APPEND CONFIG_OPTIONS "Readline")
list(APPEND EXTERNAL_LIBRARIES ${READLINE_LIB}) list(APPEND EXTERNAL_LIBRARIES ${READLINE_LIB})
list(APPEND EXTERNAL_INCLUDES ${READLINE_INC}) list(APPEND EXTERNAL_INCLUDES ${READLINE_INC})
endif(READLINE_INC) endif(READLINE_INC)
...@@ -746,8 +704,7 @@ endif(HAVE_LUA AND ENABLE_READLINE) ...@@ -746,8 +704,7 @@ endif(HAVE_LUA AND ENABLE_READLINE)
check_function_exists(vsnprintf HAVE_VSNPRINTF) check_function_exists(vsnprintf HAVE_VSNPRINTF)
if(NOT HAVE_VSNPRINTF) if(NOT HAVE_VSNPRINTF)
set(HAVE_NO_VSNPRINTF TRUE) set_config_option(HAVE_NO_VSNPRINTF "NoVsnprintf")
list(APPEND CONFIG_OPTIONS "NoVsnprintf")
endif(NOT HAVE_VSNPRINTF) endif(NOT HAVE_VSNPRINTF)
check_include_file(sys/socket.h HAVE_SYS_SOCKET_H) check_include_file(sys/socket.h HAVE_SYS_SOCKET_H)
...@@ -757,15 +714,13 @@ endif(HAVE_SYS_SOCKET_H) ...@@ -757,15 +714,13 @@ endif(HAVE_SYS_SOCKET_H)
check_type_size(socklen_t SOCKLEN_T_SIZE) check_type_size(socklen_t SOCKLEN_T_SIZE)
if(NOT SOCKLEN_T_SIZE) if(NOT SOCKLEN_T_SIZE)
set(HAVE_NO_SOCKLEN_T TRUE) set_config_option(HAVE_NO_SOCKLEN_T "NoSocklenT")
list(APPEND CONFIG_OPTIONS "NoSocklenT")
endif(NOT SOCKLEN_T_SIZE) endif(NOT SOCKLEN_T_SIZE)
set(CMAKE_EXTRA_INCLUDE_FILES) set(CMAKE_EXTRA_INCLUDE_FILES)
check_include_file(dlfcn.h DLFCN_H) check_include_file(dlfcn.h DLFCN_H)
if(DLFCN_H) if(DLFCN_H)
set(HAVE_DLOPEN true) set_config_option(HAVE_DLOPEN "Dlopen")
list(APPEND CONFIG_OPTIONS "Dlopen")
list(APPEND EXTERNAL_LIBRARIES ${CMAKE_DL_LIB}) list(APPEND EXTERNAL_LIBRARIES ${CMAKE_DL_LIB})
endif(DLFCN_H) endif(DLFCN_H)
...@@ -867,10 +822,10 @@ set_target_properties(shared PROPERTIES OUTPUT_NAME Gmsh) ...@@ -867,10 +822,10 @@ set_target_properties(shared PROPERTIES OUTPUT_NAME Gmsh)
if(HAVE_LAPACK AND LAPACK_FLAGS) if(HAVE_LAPACK AND LAPACK_FLAGS)
set_target_properties(shared PROPERTIES LINK_FLAGS ${LAPACK_FLAGS}) set_target_properties(shared PROPERTIES LINK_FLAGS ${LAPACK_FLAGS})
endif(HAVE_LAPACK AND LAPACK_FLAGS) endif(HAVE_LAPACK AND LAPACK_FLAGS)
IF(MSVC AND ENABLE_MSVC_STATIC_RUNTIME) if(MSVC AND ENABLE_MSVC_STATIC_RUNTIME)
message("WARNING: By enabling ENABLE_MSVC_STATIC_RUNTIME, shared library wont link." message("WARNING: By enabling ENABLE_MSVC_STATIC_RUNTIME, shared library wont link."
"Change in msvc /MT flag to /MD in the shared project properties") "Change in msvc /MT flag to /MD in the shared project properties")
ENDIF(MSVC AND ENABLE_MSVC_STATIC_RUNTIME) endif(MSVC AND ENABLE_MSVC_STATIC_RUNTIME)
target_link_libraries(shared ${LINK_LIBRARIES}) target_link_libraries(shared ${LINK_LIBRARIES})
# binary targets # binary targets
...@@ -1095,4 +1050,3 @@ message("") ...@@ -1095,4 +1050,3 @@ message("")
mark_as_advanced(BISON FLEX GMP_LIB GMSH_EXTRA_VERSION HDF5_LIB MAKEINFO mark_as_advanced(BISON FLEX GMP_LIB GMSH_EXTRA_VERSION HDF5_LIB MAKEINFO
MED_LIB OCC_INC SZ_LIB TAUCS_LIB LUA_LIB ACIS_LIB TEXI2PDF MED_LIB OCC_INC SZ_LIB TAUCS_LIB LUA_LIB ACIS_LIB TEXI2PDF
READLINE_LIB) READLINE_LIB)
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#ifndef _GMSH_DEFINES_H_ #ifndef _GMSH_DEFINES_H_
#define _GMSH_DEFINES_H_ #define _GMSH_DEFINES_H_
// IO file formats // IO file formats (numbers should not be changed)
#define FORMAT_MSH 1 #define FORMAT_MSH 1
#define FORMAT_UNV 2 #define FORMAT_UNV 2
#define FORMAT_GREF 3 #define FORMAT_GREF 3
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
#define TYPE_POLYG 9 #define TYPE_POLYG 9
#define TYPE_POLYH 10 #define TYPE_POLYH 10
// Element types in .msh file format // Element types in .msh file format (numbers should not be changed)
#define MSH_LIN_2 1 #define MSH_LIN_2 1
#define MSH_TRI_3 2 #define MSH_TRI_3 2
#define MSH_QUA_4 3 #define MSH_QUA_4 3
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
#define MSH_TET_220 74 #define MSH_TET_220 74
#define MSH_TET_286 75 #define MSH_TET_286 75
#define MSH_NUM_TYPE 71 #define MSH_NUM_TYPE 75
// Geometric entities // Geometric entities
#define ENT_NONE 0 #define ENT_NONE 0
...@@ -142,13 +142,13 @@ ...@@ -142,13 +142,13 @@
#define ENT_VOLUME (1<<3) #define ENT_VOLUME (1<<3)
#define ENT_ALL (ENT_POINT | ENT_LINE | ENT_SURFACE | ENT_VOLUME) #define ENT_ALL (ENT_POINT | ENT_LINE | ENT_SURFACE | ENT_VOLUME)
// 2D mesh algorithms (numbers should not be changed) // 2D meshing algorithms (numbers should not be changed)
#define ALGO_2D_MESHADAPT 1 #define ALGO_2D_MESHADAPT 1
#define ALGO_2D_MESHADAPT_OLD 4 #define ALGO_2D_MESHADAPT_OLD 4
#define ALGO_2D_DELAUNAY 5 #define ALGO_2D_DELAUNAY 5
#define ALGO_2D_FRONTAL 6 #define ALGO_2D_FRONTAL 6
// 3D mesh algorithms (numbers should not be changed) // 3D meshing algorithms (numbers should not be changed)
#define ALGO_3D_DELAUNAY 1 #define ALGO_3D_DELAUNAY 1
#define ALGO_3D_FRONTAL 4 #define ALGO_3D_FRONTAL 4
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment