-
Notifications
You must be signed in to change notification settings - Fork 356
/
FindDSDP.cmake
46 lines (40 loc) · 1.08 KB
/
FindDSDP.cmake
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
message(STATUS "Looking for dsdp")
find_path(DSDP_INCLUDE_DIR
dsdp5.h
HINTS $ENV{DSDP}/include /usr/include/dsdp
)
if(DSDP_INCLUDE_DIR)
message(STATUS "Found dsdp include directory: ${DSDP_INCLUDE_DIR}")
else()
message(STATUS "Could not find dsdp include dir")
endif()
# libraries
set(DSDP_LIBS_LIST
dsdp
)
set(DSDP_LIBRARIES)
foreach(LIB ${DSDP_LIBS_LIST})
find_library(DSDP_LIB_${LIB}
NAMES ${LIB}
HINTS $ENV{DSDP}/lib)
if(DSDP_LIB_${LIB})
# message(STATUS "Found ${LIB}: ${DSDP_LIB_${LIB}}")
set(DSDP_LIBRARIES ${DSDP_LIBRARIES} ${DSDP_LIB_${LIB}})
# else()
# message(STATUS "Could not find lib${LIB}")
endif()
endforeach()
if(DSDP_LIBRARIES)
set(DSDP_LIBRARIES ${DSDP_LIBRARIES})
message(STATUS "Found dsdp libraries ${DSDP_LIBRARIES}")
set(DSDP_FOUND_LIBS TRUE)
else()
set(DSDP_FOUND_LIBS FALSE)
message(STATUS "Could not find dsdp libraries ${DSDP_LIBRARIES}")
endif()
if(DSDP_INCLUDE_DIR AND DSDP_FOUND_LIBS)
set(DSDP_FOUND TRUE)
else()
set(DSDP_FOUND FALSE)
message(STATUS "DSDP: Cound not find dsdp. Try setting DSDP env var.")
endif()