Skip to content

Commit

Permalink
Add examples directory and add ParseAPI CFG example as a target.
Browse files Browse the repository at this point in the history
  • Loading branch information
wrwilliams committed Dec 20, 2017
1 parent 401c667 commit 784b6ee
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -60,6 +60,7 @@ add_subdirectory (parseAPI)
add_subdirectory (proccontrol)
add_subdirectory (stackwalk)
add_subdirectory (patchAPI)
add_subdirectory(examples)
if(${SYMREADER} MATCHES symtabAPI)
add_subdirectory (dyninstAPI)
add_subdirectory (dynC_API)
Expand Down
3 changes: 2 additions & 1 deletion cmake/shared.cmake
Expand Up @@ -126,13 +126,14 @@ set_directory_properties(PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)

set (BUILD_SHARED_LIBS ON)

set (INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables")
set (INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
set (INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files")
set (INSTALL_CMAKE_DIR lib/cmake/${PROJECT_NAME} CACHE PATH "Installation directory for CMake files")
set (INSTALL_DOC_DIR share/doc CACHE PATH "Installation directory for manuals")

# Make the above absolute paths if necessary
foreach (p LIB INCLUDE CMAKE)
foreach (p BIN LIB INCLUDE CMAKE)
set (var INSTALL_${p}_DIR)
if (NOT IS_ABSOLUTE "${${var}}")
set (${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
Expand Down
14 changes: 14 additions & 0 deletions examples/CMakeLists.txt
@@ -0,0 +1,14 @@


#add_executable(unstrip)
add_executable(cfg_to_dot ../parseAPI/doc/example.cc)
add_dependencies(cfg_to_dot parseAPI symtabAPI)
target_link_libraries(cfg_to_dot parseAPI symtabAPI
)
#add_executable(retee)

install (TARGETS cfg_to_dot
RUNTIME DESTINATION ${INSTALL_BIN_DIR}
LIBRARY DESTINATION ${INSTALL_LIB_DIR}
ARCHIVE DESTINATION ${INSTALL_LIB_DIR}
PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDE_DIR})

0 comments on commit 784b6ee

Please sign in to comment.