CMakeLists.txt 1.4 KB
Newer Older
1
2
3
project(AdaptiveMesh)


Kirill Terekhov's avatar
Kirill Terekhov committed
4
5
6
7
add_library(AdaptiveMeshLib amesh.cpp amesh.h)
add_executable(AdaptiveMesh main.cpp)
add_executable(AdaptiveMeshCube main_cube.cpp)
add_executable(AdaptiveMeshSphere main_sphere.cpp)
8
9

target_link_libraries(AdaptiveMesh inmost AdaptiveMeshLib)
Kirill Terekhov's avatar
Kirill Terekhov committed
10
11
target_link_libraries(AdaptiveMeshCube inmost AdaptiveMeshLib)
target_link_libraries(AdaptiveMeshSphere inmost AdaptiveMeshLib)
12
13
14
15

if(USE_MPI)
  message("linking AdaptiveMesh with MPI")
  target_link_libraries(AdaptiveMesh ${MPI_LIBRARIES}) 
Kirill Terekhov's avatar
Kirill Terekhov committed
16
17
  target_link_libraries(AdaptiveMeshCube ${MPI_LIBRARIES}) 
  target_link_libraries(AdaptiveMeshSphere ${MPI_LIBRARIES}) 
18
19
  if(MPI_LINK_FLAGS)
    set_target_properties(AdaptiveMesh PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
Kirill Terekhov's avatar
Kirill Terekhov committed
20
21
    set_target_properties(AdaptiveMeshCube PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
    set_target_properties(AdaptiveMeshSphere PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
22
23
24
  endif() 
endif(USE_MPI)

25
set_property(TARGET AdaptiveMeshLib PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/amesh.h")
26
27
28
29
30

install(TARGETS AdaptiveMeshLib EXPORT inmost-targets 
        LIBRARY DESTINATION lib 
        ARCHIVE DESTINATION lib
        PUBLIC_HEADER DESTINATION include)
Kirill Terekhov's avatar
Kirill Terekhov committed
31
32
33
install(TARGETS AdaptiveMesh EXPORT inmost-targets RUNTIME DESTINATION bin)
install(TARGETS AdaptiveMeshCube EXPORT inmost-targets RUNTIME DESTINATION bin)
install(TARGETS AdaptiveMeshSphere EXPORT inmost-targets RUNTIME DESTINATION bin)