2 #//===----------------------------------------------------------------------===//
4 #// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 #// See https://llvm.org/LICENSE.txt for license information.
6 #// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 #//===----------------------------------------------------------------------===//
11 set (CMAKE_MODULE_PATH
12 "${CMAKE_SOURCE_DIR}/libompd/"
16 include_directories (${OMPD_INCLUDE_PATH})
17 include_directories (${LIBOMP_INCLUDE_DIR})
18 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python-module/ompd/__init__.py
19 DEPENDS ompdModule.c ompdAPITests.c ompd/frame_filter.py ompd/__init__.py ompd/ompd_address_space.py ompd/ompd_callbacks.py ompd/ompd_handles.py ompd/ompd.py
20 COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/ompd ${CMAKE_CURRENT_BINARY_DIR}/python-module/ompd/
21 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
23 add_custom_target(ompd_gdb_plugin ALL
24 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/python-module/ompd/__init__.py
25 COMMENT "Building the OMPD GDB plugin")
27 add_library (ompdModule MODULE ompdModule.c ompdAPITests.c)
31 ${Python3_INCLUDE_DIRS}
33 target_link_libraries (ompdModule ${Python3_LIBRARIES})
34 target_link_libraries (ompdModule ${CMAKE_DL_LIBS})
36 set_target_properties (ompdModule PROPERTIES PREFIX "")
37 set_target_properties (ompdModule PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/python-module/ompd/")
39 install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/python-module/ompd DESTINATION share/gdb/python/ PATTERN ompdModule.so PERMISSIONS OWNER_READ WORLD_READ GROUP_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)