-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
51 lines (36 loc) · 1.18 KB
/
Copy pathCMakeLists.txt
File metadata and controls
51 lines (36 loc) · 1.18 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
cmake_minimum_required ( VERSION 3.20 )
project ( testprj )
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)
GET_TARGET_PROPERTY(_lib Python3::Python IMPORTED_IMPLIB)
MESSAGE(STATUS "Python3::Python ${_lib}")
GET_TARGET_PROPERTY(_lib Python3::Python IMPORTED_IMPLIB_DEBUG)
MESSAGE(STATUS "Python3::Python (Debug) ${_lib}")
GET_TARGET_PROPERTY(_lib Python3::Python IMPORTED_IMPLIB_RELEASE)
MESSAGE(STATUS "Python3::Python (Release) ${_lib}")
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}
)