Skip to content

Commit

Permalink
resolved vmt#97 : added files to build with CMake.
Browse files Browse the repository at this point in the history
  • Loading branch information
hasherezade committed Feb 28, 2015
1 parent 56ff6c8 commit b086c24
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
23 changes: 23 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
cmake_minimum_required (VERSION 2.8)
project (udis86)

# modules:
set (M_LIBUDIS "libudis86")
set (M_UDCLI "udcli")

# modules paths:
set (LIBUDIS_DIR "${CMAKE_SOURCE_DIR}/${M_LIBUDIS}" CACHE PATH "libudis86 main path")
set (UDCLI_DIR "${CMAKE_SOURCE_DIR}/${M_UDCLI}" CACHE PATH "udcli main path")

# Add sub-directories
#
# libs
add_subdirectory (libudis86)
get_property (libudis86_location TARGET libudis86 PROPERTY LOCATION)
set (LIBUDIS_LIB ${libudis86_location} CACHE FILE "libudis86 library path")

# executables
add_subdirectory(udcli)

# dependencies
add_dependencies(udcli libudis86)
33 changes: 33 additions & 0 deletions libudis86/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
cmake_minimum_required (VERSION 2.8)

project (udis86)

set (ITAB_H "${CMAKE_CURRENT_LIST_DIR}/itab.h")
set (ITAB_C "${CMAKE_CURRENT_LIST_DIR}/itab.c")

if(NOT EXISTS ${ITAB_H} OR NOT EXISTS ${ITAB_C} )
message(FATAL_ERROR "You must generate files: ${ITAB_H}, ${ITAB_C} before you start.")
endif()

include_directories(../)

set (udis86_srcs
decode.c
itab.c
syn.c
syn-att.c
syn-intel.c
udis86.c
)

set (udis86_hdrs
../udis86.h
decode.h
itab.h
extern.h
syn.h
types.h
udint.h
)

add_library (libudis86 STATIC ${udis86_srcs} ${udis86_hdrs})
12 changes: 12 additions & 0 deletions udcli/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cmake_minimum_required (VERSION 2.8)

project (udcli)

include_directories(../)

set (udcli_srcs
udcli.c
)

add_executable (udcli ${udcli_srcs} )
target_link_libraries (udcli ${LIBUDIS_LIB})

0 comments on commit b086c24

Please sign in to comment.