-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
39 lines (28 loc) · 1.04 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
cmake_minimum_required(VERSION 3.10)
# set the project name
project(lbfgsb Fortran)
find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)
# shared library for L-BFGS-B
set(liblbfgsb_src "")
add_subdirectory (src)
add_library(lbfgsb SHARED ${liblbfgsb_src})
if(BLAS_FOUND)
target_link_libraries(lbfgsb PRIVATE ${BLAS_LIBRARIES})
endif(BLAS_FOUND)
if(LAPACK_FOUND)
target_link_libraries(lbfgsb PRIVATE ${LAPACK_LIBRARIES})
endif(LAPACK_FOUND)
# example executables
add_executable(driver1_f77 drivers/driver1.f)
add_executable(driver1_f90 drivers/driver1.f90)
add_executable(driver2_f77 drivers/driver2.f)
add_executable(driver2_f90 drivers/driver2.f90)
add_executable(driver3_f77 drivers/driver3.f)
add_executable(driver3_f90 drivers/driver3.f90)
target_link_libraries(driver1_f77 PRIVATE lbfgsb)
target_link_libraries(driver1_f90 PRIVATE lbfgsb)
target_link_libraries(driver2_f77 PRIVATE lbfgsb)
target_link_libraries(driver2_f90 PRIVATE lbfgsb)
target_link_libraries(driver3_f77 PRIVATE lbfgsb)
target_link_libraries(driver3_f90 PRIVATE lbfgsb)