Skip to content

Commit e438314

Browse files
author
Ignacio Laguna Peralta
committed
Adding sourc code of GDB wrapper in libompd directory
1 parent cc25dce commit e438314

30 files changed

+3729
-0
lines changed

libompd/gdb-wrapper/CMakeLists.txt

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
project (odb)
2+
3+
set (cppfiles
4+
InputOutputManager.cpp
5+
ChildProcess.cpp
6+
# ProcessSpawn.cpp
7+
StringParser.cpp
8+
CudaGdb.cpp
9+
Debug.cpp
10+
GdbProcess.cpp
11+
Callbacks.cpp
12+
OMPDCommand.cpp
13+
OMPDContext.cpp
14+
OutputString.cpp)
15+
16+
# Let's find GDB first.
17+
find_package(GDB REQUIRED)
18+
if (GDB_FOUND)
19+
MESSAGE( STATUS "GDB_PATH: " ${GDB_COMMAND} )
20+
add_definitions (-DGDB_PATH="${GDB_COMMAND}")
21+
endif (GDB_FOUND)
22+
23+
find_package(CudaGDB QUIET)
24+
if (CUDA_GDB_FOUND)
25+
MESSAGE( STATUS "CUDA_GDB_PATH: " ${CUDA_GDB_COMMAND} )
26+
add_definitions (-DCUDA_GDB_PATH="${CUDA_GDB_COMMAND}")
27+
endif (CUDA_GDB_FOUND)
28+
29+
add_executable (odb-bin ${cppfiles} odb.cpp)
30+
set_target_properties (odb-bin PROPERTIES OUTPUT_NAME odb)
31+
add_library (odb ${cppfiles})
32+
33+
if (ODB_LINUX)
34+
target_link_libraries (odb-bin dl)
35+
target_link_libraries (odb dl)
36+
endif (ODB_LINUX)
37+
38+
include_directories (
39+
${CMAKE_CURRENT_SOURCE_DIR}
40+
# ${CMAKE_CURRENT_SOURCE_DIR}/../src/
41+
${CMAKE_BINARY_DIR}/include
42+
)
43+
44+
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
45+
46+
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
47+
add_definitions (-DDEBUG)
48+
endif (CMAKE_BUILD_TYPE STREQUAL "Debug")
49+
50+
# Find readline library
51+
find_package(Readline REQUIRED)
52+
include_directories(${Readline_INCLUDE_DIRS})
53+
set(LIBS ${LIBS} ${Readline_LIBRARY})
54+
55+
target_link_libraries(odb-bin ${LIBS})
56+
57+
install(TARGETS odb odb-bin
58+
LIBRARY DESTINATION lib
59+
ARCHIVE DESTINATION lib/static
60+
RUNTIME DESTINATION bin )

0 commit comments

Comments
 (0)