Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

CMake Cleanup

Removed unneeded printf
  • Loading branch information...
commit 8e9a35d710a68ce0fe2571fcfd033213b5198082 1 parent efe8d9a
Kyle Machulis authored

Showing 3 changed files with 29 additions and 19 deletions. Show diff stats Hide diff stats

  1. +26 13 CMakeLists.txt
  2. +3 5 src/CMakeLists.txt
  3. +0 1  src/omron_libusb.c
39 CMakeLists.txt
@@ -6,13 +6,17 @@
6 6 CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
7 7
8 8 #See if we've got our cmake modules checked out. If not, advise to do so.
  9 +
  10 +# Does it exist next to the repo? This is usually where it is for development.
9 11 IF(EXISTS "${CMAKE_SOURCE_DIR}/../compily_buildd/cmake")
10 12 SET(BUILDSYS_CMAKE_DIR "${CMAKE_SOURCE_DIR}/../compily_buildd/cmake")
11 13 MESSAGE(STATUS "Using outside compily_buildd directory ${BUILDSYS_CMAKE_DIR}")
  14 +# Does it exist as a submodule or local directory?
12 15 ELSEIF(EXISTS "${CMAKE_SOURCE_DIR}/compily_buildd/cmake")
13 16 SET(BUILDSYS_CMAKE_DIR "${CMAKE_SOURCE_DIR}/compily_buildd/cmake")
14 17 MESSAGE(STATUS "Using compily_buildd git submodule ${BUILDSYS_CMAKE_DIR}")
15   -ELSE(EXISTS "${CMAKE_SOURCE_DIR}/compily_buildd/cmake")
  18 +# Ah well.
  19 +ELSE()
16 20 MESSAGE(FATAL_ERROR
17 21 "Cannot find compily_buildd directory for np labs project compilation functions.\n"
18 22 "Make sure you've either put the compily_buildd directory in the same root as your repository directory, or that you've used the compily_buildd submodule (git submodule update --init).\n"
@@ -25,7 +29,6 @@ LIST(APPEND CMAKE_MODULE_PATH ${BUILDSYS_CMAKE_DIR})
25 29 INCLUDE( ${BUILDSYS_CMAKE_DIR}/BuildSysCMakeLib.cmake )
26 30
27 31 #setting link directory policy
28   -
29 32 IF(COMMAND cmake_policy)
30 33 CMAKE_POLICY(SET CMP0003 NEW)
31 34 ENDIF(COMMAND cmake_policy)
@@ -37,12 +40,16 @@ ENDIF(COMMAND cmake_policy)
37 40 #Project declaration
38 41
39 42 PROJECT(LIBOMRON)
  43 +
  44 +# Project initialization
40 45 INITIALIZE_BUILD()
41 46
42 47 #Common Options
43 48
44   -#OPTION_LIBRARY_BUILD_STATIC(OFF)
  49 +OPTION_LIBRARY_BUILD_STATIC(ON)
45 50 OPTION_LIBRARY_BUILD_SHARED(ON)
  51 +OPTION_LIBRARY_BUILD_FRAMEWORK(OFF)
  52 +OPTION_BUILD_RPATH(ON)
46 53
47 54 ######################################################################################
48 55 # Project specific globals
@@ -50,31 +57,37 @@ OPTION_LIBRARY_BUILD_SHARED(ON)
50 57
51 58 #library definitions
52 59
53   -SET(LIBOMRON_MAJOR_VERSION 0)
54   -SET(LIBOMRON_MINOR_VERSION 5)
  60 +SET(LIBOMRON_MAJOR_VERSION 1)
  61 +SET(LIBOMRON_MINOR_VERSION 0)
55 62 SET(LIBOMRON_BUILD_VERSION 0)
56 63
57 64 SET(LIBOMRON_VERSION ${LIBOMRON_MAJOR_VERSION}.${LIBOMRON_MINOR_VERSION}.${LIBOMRON_BUILD_VERSION})
58 65
59   -#library name definitions
  66 +CREATE_LIBRARY_LINK_NAME("omron")
60 67
61   -SET(LIBOMRON_LIBRARY "${LIBRARY_OUTPUT_PATH}/libomron.a")
  68 +# Just set our include and linking directories globally
  69 +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
  70 +LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lib)
  71 +
  72 +#library name definitions
62 73 SET(LIBOMRON_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/include")
  74 +SET(LIBOMRON_REQUIRED_LIBS)
63 75
64 76 IF(WIN32)
65 77 SET(WDK_PATH CACHE PATH "Path to WDK Installation")
66 78 INCLUDE_DIRECTORIES(${WDK_PATH}/inc/api ${WDK_PATH}/inc/crt ${WDK_PATH}/inc)
67 79 LINK_DIRECTORIES(${WDK_PATH}/lib/wxp/i386)
68   - LIST(APPEND LIBS hid setupapi)
  80 + LIST(APPEND LIBOMRON_REQUIRED_LIBS hid setupapi)
69 81 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/win)
70 82 ELSEIF(UNIX)
71   -# ELSEIF(UNIX)
72   -# LIST(APPEND ${LIBS} m)
  83 + FIND_PACKAGE(libusb-1.0 REQUIRED)
  84 + IF(LIBUSB_1_FOUND)
  85 + INCLUDE_DIRECTORIES(${LIBUSB_1_INCLUDE_DIRS})
  86 + LIST(APPEND LIBOMRON_REQUIRED_LIBS ${LIBUSB_1_LIBRARIES})
  87 + ENDIF(LIBUSB_1_FOUND)
73 88 ENDIF(WIN32)
74 89
75   -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
76   -LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lib)
77   -
  90 +ADD_SUBDIRECTORY(include)
78 91 ADD_SUBDIRECTORY(src)
79 92 ADD_SUBDIRECTORY(examples)
80 93 ADD_SUBDIRECTORY(swig)
8 src/CMakeLists.txt
@@ -7,11 +7,9 @@ SET(LIBRARY_SRCS
7 7 )
8 8
9 9 IF(WIN32)
10   - LIST(APPEND LIBRARY_SRCS omron_win32.c)
  10 + LIST(APPEND LIBRARY_SRCS omron_win32.c ${LIBOMRON_INCLUDE_FILES})
11 11 ELSEIF(UNIX)
12   - LIST(APPEND LIBRARY_SRCS omron_libusb.c)
13   -# ELSEIF(UNIX)
14   -# LIST(APPEND LIBRARY_SRCS omron_usbfs.c)
  12 + LIST(APPEND LIBRARY_SRCS omron_libusb.c ${LIBOMRON_INCLUDE_FILES})
15 13 ENDIF(WIN32)
16 14
17 15 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
@@ -20,7 +18,7 @@ BUILDSYS_BUILD_LIB(
20 18 NAME omron
21 19 SOURCES "${LIBRARY_SRCS}"
22 20 CXX_FLAGS FALSE
23   - LINK_LIBS "${LIBS}"
  21 + LINK_LIBS "${LIBOMRON_REQUIRED_LIBS}"
24 22 LINK_FLAGS FALSE
25 23 DEPENDS FALSE
26 24 SHOULD_INSTALL TRUE
1  src/omron_libusb.c
@@ -166,7 +166,6 @@ int omron_read_data(omron_device* dev, uint8_t* input_report)
166 166 {
167 167 int trans;
168 168 int ret = libusb_bulk_transfer(dev->device._device, OMRON_IN_ENDPT, input_report, 8, &trans, 1000);
169   - printf("%d\n", ret);
170 169 return ret;
171 170 }
172 171

0 comments on commit 8e9a35d

Please sign in to comment.
Something went wrong with that request. Please try again.