Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lammps
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
multiscale
lammps
Commits
c5861307
Commit
c5861307
authored
6 years ago
by
Christoph Junghans
Browse files
Options
Downloads
Patches
Plain Diff
cmake: add FindLAMMPS.cmake.in
parent
447a6c33
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmake/CMakeLists.txt
+7
-7
7 additions, 7 deletions
cmake/CMakeLists.txt
cmake/FindLAMMPS.cmake.in
+47
-0
47 additions, 0 deletions
cmake/FindLAMMPS.cmake.in
with
54 additions
and
7 deletions
cmake/CMakeLists.txt
+
7
−
7
View file @
c5861307
...
@@ -1041,13 +1041,13 @@ if(BUILD_LIB)
...
@@ -1041,13 +1041,13 @@ if(BUILD_LIB)
add_dependencies
(
lammps
${
LAMMPS_DEPS
}
)
add_dependencies
(
lammps
${
LAMMPS_DEPS
}
)
endif
()
endif
()
set_target_properties
(
lammps PROPERTIES OUTPUT_NAME lammps
${
LIB_SUFFIX
}
)
set_target_properties
(
lammps PROPERTIES OUTPUT_NAME lammps
${
LIB_SUFFIX
}
)
if
(
BUILD_SHARED_LIBS
)
set_target_properties
(
lammps PROPERTIES SOVERSION
${
SOVERSION
}
)
set_target_properties
(
lammps PROPERTIES SOVERSION
${
SOVERSION
}
)
install
(
TARGETS lammps LIBRARY DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
ARCHIVE DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
)
install
(
TARGETS lammps LIBRARY DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
ARCHIVE
DESTINATION
${
CMAKE_INSTALL_
LIBDIR
}
)
install
(
FILES
${
LAMMPS_SOURCE_DIR
}
/library.h
DESTINATION
${
CMAKE_INSTALL_
INCLUDEDIR
}
/lammps
)
install
(
FILES
${
LAMMPS_SOURCE_DIR
}
/library.h DESTINATION
${
CMAKE_INSTALL_INCLUDE
DIR
}
/lammps
)
configure_file
(
pkgconfig/liblammps.pc.in
${
CMAKE_CURRENT_BINARY_
DIR
}
/
lib
lammps
${
LIB_SUFFIX
}
.pc @ONLY
)
configure_file
(
pkgconfig/liblammps.pc.in
${
CMAKE_CURRENT_BINARY_DIR
}
/liblammps
${
LIB_SUFFIX
}
.pc
@ONLY
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/liblammps
${
LIB_SUFFIX
}
.pc
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/pkgconfig
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/
liblammps
${
LIB_SUFFIX
}
.
pc DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/pkgconfig
)
configure_file
(
FindLAMMPS.cmake.in
${
CMAKE_CURRENT_BINARY_DIR
}
/
FindLAMMPS
${
LIB_SUFFIX
}
.
cmake @ONLY
)
endif
(
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/FindLAMMPS
${
LIB_SUFFIX
}
.cmake DESTINATION
${
CMAKE_INSTALL_DATADIR
}
/cmake/Module
)
else
()
else
()
list
(
APPEND LMP_SOURCES
${
LIB_SOURCES
}
)
list
(
APPEND LMP_SOURCES
${
LIB_SOURCES
}
)
endif
()
endif
()
...
...
This diff is collapsed.
Click to expand it.
cmake/FindLAMMPS.cmake.in
0 → 100644
+
47
−
0
View file @
c5861307
# - Find liblammps
# Find the native liblammps headers and libraries.
#
# The following variables will set:
# LAMMPS_INCLUDE_DIRS - where to find lammps/library.h, etc.
# LAMMPS_LIBRARIES - List of libraries when using lammps.
# LAMMPS_VERSION - lammps library version
# LAMMPS_FOUND - True if liblammps found.
#
# In addition a LAMMPS::LAMMPS imported target is getting created.
#
# LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
# http://lammps.sandia.gov, Sandia National Laboratories
# Steve Plimpton, sjplimp@sandia.gov
#
# Copyright (2003) Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
# certain rights in this software. This software is distributed under
# the GNU General Public License.
#
# See the README file in the top-level LAMMPS directory.
#
find_package(PkgConfig)
pkg_check_modules(PC_LAMMPS liblammps@LIB_SUFFIX@)
find_path(LAMMPS_INCLUDE_DIR lammps/library.h HINTS ${PC_LAMMPS_INCLUDE_DIRS} @CMAKE_INSTALL_FULL_INCLUDEDIR@)
# TODO figure out library version from header
set(LAMMPS_VERSION 20180822)
find_library(LAMMPS_LIBRARY NAMES lammps@LIB_SUFFIX@ HINTS ${PC_LAMMPS_LIBRARY_DIRS} @CMAKE_INSTALL_FULL_LIBDIR@)
set(LAMMPS_INCLUDE_DIRS "${LAMMPS_INCLUDE_DIR}")
set(LAMMPS_LIBRARIES "${LAMMPS_LIBRARY}")
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LAMMPS_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(LAMMPS REQUIRED_VARS LAMMPS_LIBRARY LAMMPS_INCLUDE_DIR VERSION_VAR LAMMPS_VERSION)
mark_as_advanced(LAMMPS_INCLUDE_DIR LAMMPS_LIBRARY)
if(LAMMPS_FOUND AND NOT TARGET LAMMPS::LAMMPS)
add_library(LAMMPS::LAMMPS UNKNOWN IMPORTED)
set_target_properties(LAMMPS::LAMMPS PROPERTIES IMPORTED_LOCATION ${LAMMPS_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES ${LAMMPS_INCLUDE_DIR})
endif()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment