-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
103 lines (79 loc) · 2.55 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
cmake_minimum_required(VERSION 3.15)
project(ProcessMonitor)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Find Python
find_package(Python COMPONENTS Interpreter Development REQUIRED)
# Set explicit path for pybind11
set(pybind11_DIR "C:/Users/fcbsa/OneDrive/Documents/ProcessMonitorAppCppPython/ProcessMonitor/ProcessMonitorPythonVenv/Lib/site-packages/pybind11/share/cmake/pybind11")
# Find pybind11
find_package(pybind11 CONFIG REQUIRED)
# Add source files
set(SOURCES
cpp/src/process_info.cpp
cpp/src/process_manager.cpp
cpp/src/bindings.cpp
)
# Create the Python module
pybind11_add_module(process_monitor ${SOURCES})
# Include directories
target_include_directories(process_monitor PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/cpp/include
)
# Windows-specific libraries
if(WIN32)
target_link_libraries(process_monitor PRIVATE pdh psapi)
endif()
# cmake_minimum_required(VERSION 3.15)
# project(ProcessMonitor)
# set(CMAKE_CXX_STANDARD 17)
# set(CMAKE_CXX_STANDARD_REQUIRED ON)
# # Add this block to help find pybind11
# execute_process(
# COMMAND "${Python_EXECUTABLE}" -c "import pybind11; print(pybind11.get_cmake_dir())"
# OUTPUT_VARIABLE pybind11_DIR
# OUTPUT_STRIP_TRAILING_WHITESPACE
# )
# set(pybind11_DIR "${pybind11_DIR}")
# # Find Python and pybind11
# find_package(Python COMPONENTS Interpreter Development REQUIRED)
# find_package(pybind11 CONFIG REQUIRED)
# # Add source files
# set(SOURCES
# cpp/src/process_info.cpp
# cpp/src/process_manager.cpp
# cpp/src/bindings.cpp
# )
# # Create the Python module
# pybind11_add_module(process_monitor ${SOURCES})
# # Include directories
# target_include_directories(process_monitor PRIVATE
# ${CMAKE_CURRENT_SOURCE_DIR}/cpp/include
# )
# # Windows-specific libraries
# if(WIN32)
# target_link_libraries(process_monitor PRIVATE pdh psapi)
# endif()
# cmake_minimum_required(VERSION 3.15)
# project(ProcessMonitor)
# set(CMAKE_CXX_STANDARD 17)
# set(CMAKE_CXX_STANDARD_REQUIRED ON)
# # Find Python and pybind11
# find_package(Python COMPONENTS Interpreter Development REQUIRED)
# find_package(pybind11 CONFIG REQUIRED)
# # Add source files
# set(SOURCES
# cpp/src/process_info.cpp
# cpp/src/process_manager.cpp
# cpp/src/bindings.cpp
# )
# # Create the Python module
# pybind11_add_module(process_monitor ${SOURCES})
# # Include directories
# target_include_directories(process_monitor PRIVATE
# ${CMAKE_CURRENT_SOURCE_DIR}/cpp/include
# )
# # Windows-specific libraries
# if(WIN32)
# target_link_libraries(process_monitor PRIVATE pdh psapi)
# endif()