CMakeLists.txt 1.41 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.1)
8 9

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

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

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

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

23 24 25
# 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}")
26

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

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

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

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