Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolved #97 : added files to build with CMake #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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})