-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
56 lines (47 loc) · 1.03 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
cmake_minimum_required(VERSION 3.16..)
project(hopfield)
set (CMAKE_CXX_STANDARD 14)
set (CMAKE_CXX_FLAGS -O3)
find_package(OpenMP)
if (OpenMP_CXX_FOUND)
endif()
include_directories(
include/
interfaces/
tests/)
set(FILES
main.cpp
src/device.cpp
src/memory.cpp
src/model.cpp
src/reader.cpp
src/writer.cpp
src/stopwatch.cpp
)
if(APPLE)
add_executable(hopfield
${FILES}
src/matrix_helper.cpp
)
add_library(mtlpp
src/mtlpp.mm
)
target_compile_options(mtlpp PRIVATE -x objective-c++)
target_link_libraries(hopfield PUBLIC
"-framework Metal"
"-framework MetalKit"
"-framework Cocoa"
"-framework CoreFoundation"
"-fobjc-link-runtime"
mtlpp
)
else()
find_package(Threads)
add_executable(hopfield
${FILES}
)
target_link_libraries(hopfield PUBLIC ${CMAKE_THREAD_LIBS_INIT})
endif()
if(OpenMP_CXX_FOUND)
target_link_libraries(hopfield PUBLIC OpenMP::OpenMP_CXX)
endif()