forked from openmeeg/findmkl_cmake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
42 lines (31 loc) · 1.21 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
cmake_minimum_required (VERSION 3.2)
project (CMakeHelloWorld VERSION 1.0)
# Find the BLAS stuff
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(BLA_DEFINITIONS)
if ("$ENV{MKLROOT}" STREQUAL "")
message(FATAL_ERROR "MKLROOT is not set. Please source the Intel MKL mklvars.sh file.")
endif()
# user defined options for MKL
option(MKL_USE_parallel "Use MKL parallel" True)
option(MKL_USE_sdl "Single Dynamic Library or static/dynamic" False)
set(MKL_USE_interface "lp64" CACHE STRING "for Intel(R)64 compatible arch: ilp64/lp64 or for ia32 arch: cdecl/stdcall")
if (BLA_VENDOR MATCHES "_seq")
set(MKL_USE_parallel OFF)
else()
set(MKL_USE_parallel ON)
endif()
find_package(MKL REQUIRED)
if (MKL_FOUND)
set(BLA_INCLUDE_DIR ${MKL_INCLUDE_DIR})
set(BLAS_LIBRARIES ${MKL_LIBRARIES})
set(BLA_DEFINITIONS USE_MKL)
endif()
message(STATUS "BLAS Libraries: ${BLAS_LIBRARIES}")
# include the subdirectory containing our libs
add_subdirectory(Hello_lib)
# indicate the entry point for the executable
add_executable(hello HelloWorld.cpp)
# Indicate which libraries to include during the link process.
target_link_libraries(hello Hello_lib::Hello_lib)
# install (TARGETS CMakeHelloWorld DESTINATION bin)