-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
33 lines (25 loc) · 830 Bytes
/
CMakeLists.txt
File metadata and controls
33 lines (25 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Specify the minimum version
cmake_minimum_required ( VERSION 3.12 )
# Specify a project name
project(ExternalLibTrixi)
# Additional cmake modules (should contain FindLibTrixi.cmake)
list ( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../cmake" )
# Find MPI
find_package( MPI REQUIRED )
# Find LibTrixi
find_package( LibTrixi REQUIRED )
# Set sources
set ( TARGET_NAME trixi_controller_simple_c )
add_executable ( ${TARGET_NAME} ${CMAKE_SOURCE_DIR}/../trixi_controller_simple.c )
# Set libraries to link
target_link_libraries(
${TARGET_NAME}
PRIVATE MPI::MPI_C ${LIBTRIXI_LIBRARY}
)
# Set include directories
target_include_directories(
${TARGET_NAME}
PRIVATE ${LIBTRIXI_INCLUDE_DIR}
)
# Set compiler flag for position independent code
target_compile_options( ${TARGET_NAME} PRIVATE "-fPIC" )