forked from dthierry/k_aug
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
67 lines (50 loc) · 2.16 KB
/
CMakeLists.txt
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
cmake_minimum_required(VERSION 3.5)
project(k_aug C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_FLAGS "-g -Wall -ansi -pedantic-errors -Wall -W")
#set( PROJECT_LINK_LIBS amplsolver.a )
set(k_aug_version_mayor 1)
set(k_aug_version_minor 0)
set(USE_PARDISO 0)
set(USE_MC30 0)
set(PRINT_VERBOSE 0)
configure_file("${PROJECT_SOURCE_DIR}/src/common/config_kaug.h.in"
"${PROJECT_BINARY_DIR}/config_kaug.h")
include_directories(${PROJECT_BINARY_DIR} thirdparty/asl/solvers
thirdparty/mumps/MUMPS/include thirdparty/mumps/MUMPS/libseq)
link_directories(thirdparty/asl/solvers thirdparty/metis/metis/build/Linux-x86_64/libmetis thirdparty/scotch/scotch/lib
thirdparty/mumps/MUMPS/lib thirdparty/openblas/OpenBLAS thirdparty/mumps/MUMPS/PORD/lib thirdparty/mumps/MUMPS/libseq
)
if (USE_MC30)
link_directories(thirdparty/hsl/mc30/mc30/src)
message("INCLUDE LINK DIRECTORIES MC30 ${USE_MC30}")
else(USE_MC30)
link_directories(thirdparty/hsl/mc19/mc19/src)
endif(USE_MC30)
if (USE_MC30)
file(GLOB SOURCES "src/k_aug/*.c" "src/matrix/*.c" "src/interfaces/mumps/*.c" "src/HSL/*.c")
message("INCLUDE LINK DIRECTORIES MC30 ${USE_MC30}")
else(USE_MC30)
file(GLOB SOURCES "src/k_aug/*.c" "src/matrix/*.c" "src/interfaces/mumps/*.c" "src/interfaces/hsl/*.c")
endif(USE_MC30)
add_executable(k_aug ${SOURCES})
if (USE_MC30)
target_link_libraries(k_aug amplsolver m dl openblas gfortran dmumps mumps_common pthread esmumps scotch scotcherr
metis pord mpiseq mc30 gfortran)
message("LINKING MC30 ${USE_MC30}")
else(USE_MC30)
target_link_libraries(k_aug amplsolver m dl openblas gfortran dmumps mumps_common pthread esmumps scotch scotcherr
metis pord mpiseq mc19 gfortran)
endif(USE_MC30)
set_target_properties( k_aug
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)
message("${USE_MC30}")
get_cmake_property(_variableNames VARIABLES)
list (SORT _variableNames)
foreach (_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()