forked from erwincoumans/warp_cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
47 lines (34 loc) · 1.57 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
cmake_minimum_required(VERSION 3.12)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # For LLVM tooling
# set(CMAKE_BUILD_RPATH_USE_ORIGIN ON)
if (NOT EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
endif()
if(DEFINED WARP_PATH)
message(STATUS "WARP_PATH is defined with value: ${WARP_PATH}")
else()
set(WARP_PATH "D:/dev/warp_cpp/third_party/warp")
message(STATUS "WARP_PATH is not defined, using hard-coded path: ${WARP_PATH}")
endif()
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
cmake_policy(SET CMP0017 NEW)
cmake_policy(SET CMP0042 NEW)
cmake_policy(SET CMP0057 NEW)
endif(COMMAND cmake_policy)
#this line has to appear before 'PROJECT' in order to be able to disable incremental linking
SET(MSVC_INCREMENTAL_DEFAULT ON)
PROJECT(warp_cpp)
add_executable(example_add_float_array_cpu example_add_float_array_cpu.cpp )
target_link_libraries(example_add_float_array_cpu ${CMAKE_DL_LIBS})
target_compile_definitions(example_add_float_array_cpu PRIVATE -DWARP_PATH )
target_include_directories(example_add_float_array_cpu PRIVATE ${WARP_PATH} . )
# target_compile_definitions(example_add_float_array_cpu PRIVATE . )
add_executable(example_add_float_array_cuda example_add_float_array_cuda.cpp )
target_link_libraries(example_add_float_array_cuda ${CMAKE_DL_LIBS})
target_include_directories(example_add_float_array_cuda PRIVATE ${WARP_PATH} . )
# target_compile_definitions(example_add_float_array_cuda PRIVATE . )