-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
52 lines (39 loc) · 1.2 KB
/
Copy pathCMakeLists.txt
File metadata and controls
52 lines (39 loc) · 1.2 KB
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
cmake_minimum_required ( VERSION 3.20 )
project ( testprj )
set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/" )
set ( PRJ_INCLUDE_DIRS )
set ( PRJ_COMPILE_FEATURES )
set ( PRJ_LIBRARIES )
list ( APPEND PRJ_COMPILE_FEATURES cxx_std_20 )
find_package(Python3 COMPONENTS Interpreter Development)
find_package(NumPy)
if ( ${PYTHON_NUMPY_FOUND} )
include_directories(${PYTHON_NUMPY_INCLUDE_DIR})
else()
message(WARNING "Python3 NumPy not found, proceeding with -DWITHOUT_NUMPY."
" Some functions might not work.")
add_definitions(-DWITHOUT_NUMPY)
endif()
if ( ${Python3_FOUND} )
#include_directories(${Python3_INCLUDE_DIRS})
else()
message ( FATAL_ERROR "Python3 not found, please install it." )
endif()
list ( APPEND PRJ_INCLUDE_DIRS ${Python3_INCLUDE_DIRS} )
list ( APPEND PRJ_LIBRARIES ${Python3_LIBRARIES} )
message ( STATUS "PRJ_LIBRARIES = ${PRJ_LIBRARIES} " )
add_executable ( ${PROJECT_NAME}
main.cpp
)
target_include_directories ( ${PROJECT_NAME}
PRIVATE
${PRJ_INCLUDE_DIRS}
)
target_link_libraries( ${PROJECT_NAME}
PRIVATE
${PRJ_LIBRARIES}
)
target_compile_features ( ${PROJECT_NAME}
PRIVATE
${PRJ_COMPILE_FEATURES}
)