CMakeLists.txt 1.45 KB
Newer Older
1 2 3 4 5 6
######################################################
# This CMakeLists.txt is used to generate an executable
# that uses Nektar++.  Customization points for your
# projects are marked below.
######################################################

7 8
# Require at least CMake 3.1 for CMAKE_CXX_STANDARD.
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
9 10

# TODO - Put the name of your project here.
11
PROJECT(ExampleSolver)
12

13
# Finds Nektar++. This may introduce other dependencies, such as Boost.
14
FIND_PACKAGE(Nektar++ REQUIRED)
15 16 17 18 19 20

# Require C++11
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)

# Add various definitions from Nektar++ CMake file.
21 22 23
ADD_DEFINITIONS(${NEKTAR++_DEFINITIONS})
INCLUDE_DIRECTORIES(${NEKTAR++_INCLUDE_DIRS} ${NEKTAR++_TP_INCLUDE_DIRS})

24 25 26
# If your libraries are in a non-standard link location, you might need to add
# the link directory to the RPATH.
SET(CMAKE_INSTALL_RPATH "${NEKTAR++_LIBRARY_DIRS}")
27

28 29 30 31
# Set a default install location
IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
    SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/dist CACHE PATH "" FORCE)
ENDIF()
32

33 34 35 36 37
# Add a sample executable based on a driver and equation system.
ADD_EXECUTABLE(ExampleSolver
    ExampleSolver.cpp
    EquationSystems/Laplace.cpp
    )
38

39 40
# If your executable needs to link to any other libraries, add them here.
TARGET_LINK_LIBRARIES(ExampleSolver
41 42 43
    ${NEKTAR++_LIBRARIES}
    ${NEKTAR++_TP_LIBRARIES}
    )
44 45

INSTALL(TARGETS ExampleSolver DESTINATION ${CMAKE_BINARY_DIR}/dist)