summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rwxr-xr-xCMakeLists.txt17
1 files changed, 15 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fda3bcf..c667871 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,11 +1,19 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(lthor C)
+SET(LIBTHOR_SRCS
+ libthor/thor_acm.c
+ libthor/thor.c
+ libthor/thor_raw_file.c
+ libthor/thor_tar.c
+ libthor/thor_usb.c
+)
+
SET(SRCS
lthor.c
)
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/.)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/libthor)
SET(VENDOR "samsung")
SET(PACKAGE ${PROJECT_NAME})
@@ -25,6 +33,7 @@ MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED
libarchive
+ libusb-1.0>=1.0.17
)
FOREACH(flag ${pkgs_CFLAGS})
@@ -45,12 +54,16 @@ ADD_DEFINITIONS("-DPACKAGE_VERSION=\"${PACKAGE_VERSION}\"")
#SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
IF(APPLE)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
+ INCLUDE_DIRECTORIES("/usr/include/machine")
ELSE()
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")
ENDIF()
+ADD_LIBRARY(libthor ${LIBTHOR_SRCS})
+
ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} libthor ${pkgs_LDFLAGS})
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})