Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CodeVault
hpc-kernels
unstructured_grids
Commits
cd172d6e
Commit
cd172d6e
authored
Oct 05, 2016
by
Thomas Steinreiter
Browse files
added FindLibMesh.cmake find module
parent
dabfa867
Changes
1
Hide whitespace changes
Inline
Side-by-side
libmesh/CMakeLists.txt
View file @
cd172d6e
# Packages are optional: if they are not present, certain code samples are not compiled
# Packages are optional: if they are not present, certain code samples are not compiled
cmake_minimum_required
(
VERSION 2.8.10 FATAL_ERROR
)
cmake_minimum_required
(
VERSION 2.8.10 FATAL_ERROR
)
find_package
(
MPI
)
# Built-in in CMake
find_package
(
MPI
REQUIRED
)
# Built-in in CMake
find_package
(
Threads
)
find_package
(
Threads
REQUIRED
)
include
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../cmake/common.cmake
)
include
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../cmake/common.cmake
)
set
(
LIBMESH_INCLUDE_PATH /usr/local/include CACHE PATH
"path to libMesh include directory"
)
find_package
(
LibMesh REQUIRED
)
set
(
LIBMESH_LIBRARY_PATH /usr/local/lib CACHE PATH
"path to libMesh library directory"
)
set
(
LIBMESH_LIBRARY mesh_opt CACHE FILEPATH
"name of libmesh library"
)
# ==================================================================================================
# ==================================================================================================
...
@@ -18,11 +16,9 @@ endif()
...
@@ -18,11 +16,9 @@ endif()
set
(
NAME
${
DWARF_PREFIX
}
_libmesh
)
set
(
NAME
${
DWARF_PREFIX
}
_libmesh
)
#TODO: check for libmesh too
if
(
MPI_FOUND AND LIBMESH_FOUND
)
if
(
MPI_FOUND
)
enable_language
(
CXX
)
enable_language
(
CXX
)
include_directories
(
${
MPI_INCLUDE_PATH
}
${
LIBMESH_INCLUDE_PATH
}
)
include_directories
(
${
LIBMESH_INCLUDE_DIRS
}
${
MPI_INCLUDE_PATH
}
)
link_directories
(
${
LIBMESH_LIBRARY_PATH
}
)
add_executable
(
${
NAME
}
fem_system_ex4.cpp heatsystem.cpp
)
add_executable
(
${
NAME
}
fem_system_ex4.cpp heatsystem.cpp
)
set
(
CMAKE_BUILD_TYPE RelWithDebInfo
)
set
(
CMAKE_BUILD_TYPE RelWithDebInfo
)
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"GNU"
)
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"GNU"
)
...
@@ -31,12 +27,11 @@ if (MPI_FOUND)
...
@@ -31,12 +27,11 @@ if (MPI_FOUND)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-xHost -std=c++14"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-xHost -std=c++14"
)
endif
()
endif
()
set_target_properties
(
${
NAME
}
PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED YES
)
set_target_properties
(
${
NAME
}
PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED YES
)
target_link_libraries
(
${
NAME
}
${
LIBMESH_LIBRAR
Y
}
${
MPI_LIBRARIES
}
${
CMAKE_THREAD_LIBS_INIT
}
)
target_link_libraries
(
${
NAME
}
${
LIBMESH_LIBRAR
IES
}
${
MPI_
CXX_
LIBRARIES
}
${
CMAKE_THREAD_LIBS_INIT
}
)
install
(
TARGETS
${
NAME
}
DESTINATION bin
)
install
(
TARGETS
${
NAME
}
DESTINATION bin
)
message
(
"** Enabling '
${
NAME
}
': with MPI"
)
message
(
"** Enabling '
${
NAME
}
': with
LibMesh and
MPI"
)
else
()
else
()
message
(
"## Skipping '
${
NAME
}
': MPI support missing"
)
message
(
"## Skipping '
${
NAME
}
': LibMesh or MPI support missing"
)
# dummy_install(${NAME} "MPI")
endif
()
endif
()
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
${
C_FLAGS
}
"
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
${
C_FLAGS
}
"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment