Skip to content

Commit

Permalink
Merge pull request #9 from ibaned/cmake
Browse files Browse the repository at this point in the history
Add a CMake build system
  • Loading branch information
dsbolin authored Nov 14, 2017
2 parents cb51c5b + fc84819 commit 567dbeb
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.1)

project(DEMSI)

set(CMAKE_CXX_FLAGS "-O3 -g --std=c++11")

set(LAMMPS_PREFIX "" CACHE PATH "Path where LAMMPS is installed")

find_path(LAMMPS_INCLUDE_DIR NAMES lammps.h PATHS "${LAMMPS_PREFIX}/include")
message("looking for lammps in ${LAMMPS_PREFIX}/lib")
find_library(LAMMPS_LIB NAMES lammps PATHS "${LAMMPS_PREFIX}/lib")

add_subdirectory(src)
2 changes: 1 addition & 1 deletion DEMSI-LAMMPS
9 changes: 9 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
add_executable(demsi
demsi.cpp
grid.cpp
lmp_instance.cpp
thermo.cpp
)

target_link_libraries(demsi PUBLIC "${LAMMPS_LIB}")
target_include_directories(demsi PUBLIC "${LAMMPS_INCLUDE_DIR}")
3 changes: 2 additions & 1 deletion src/grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

#include "grid.h"
#include "mpi.h"
#include <iostream>
#include <fstream>
#include <math.h>
#include <cmath>
#include <netcdfcpp.h>

#include <atom.h>
Expand Down

0 comments on commit 567dbeb

Please sign in to comment.