maa: add global maa.h and maa.hpp and stop using /usr/include/maa/
authorBrendan Le Foll <brendan.le.foll@intel.com>
Tue, 10 Jun 2014 15:33:32 +0000 (16:33 +0100)
committerBrendan Le Foll <brendan.le.foll@intel.com>
Tue, 10 Jun 2014 15:47:37 +0000 (16:47 +0100)
* pkg-config now only sees maa.h & maa.hpp
* usage of maa/*.{h,hpp} is still allowed
* examples updated to use maa.{h,hpp}

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
28 files changed:
Doxyfile.in
api/maa.h
api/maa.hpp [new file with mode: 0644]
api/maa/aio.h [moved from api/aio.h with 100% similarity]
api/maa/aio.hpp [moved from api/aio.hpp with 100% similarity]
api/maa/gpio.h [moved from api/gpio.h with 100% similarity]
api/maa/gpio.hpp [moved from api/gpio.hpp with 100% similarity]
api/maa/i2c.h [moved from api/i2c.h with 100% similarity]
api/maa/i2c.hpp [moved from api/i2c.hpp with 100% similarity]
api/maa/pwm.h [moved from api/pwm.h with 100% similarity]
api/maa/pwm.hpp [moved from api/pwm.hpp with 100% similarity]
api/maa/spi.h [moved from api/spi.h with 100% similarity]
api/maa/spi.hpp [moved from api/spi.hpp with 100% similarity]
examples/analogin_a0.c
examples/blink-io.c
examples/c++/AioA0.cpp
examples/c++/Blink-IO.cpp
examples/c++/I2c-compass.cpp
examples/c++/Pwm3-cycle.cpp
examples/c++/Spi-pot.cpp
examples/cycle-pwm3.c
examples/gpio_read6.c
examples/i2c_HMC5883L.c
examples/isr_pin6.c
examples/mmap-io2.c
examples/spi_mcp4261.c
src/CMakeLists.txt
src/maa.pc.cmake

index 7d6a0e7..e608095 100644 (file)
@@ -754,6 +754,7 @@ WARN_LOGFILE           =
 # Note: If this tag is empty the current directory is searched.
 
 INPUT                  = @CMAKE_CURRENT_SOURCE_DIR@/api/ \
+                         @CMAKE_CURRENT_SOURCE_DIR@/api/maa/ \
                          @CMAKE_CURRENT_SOURCE_DIR@/README.md \
                          @CMAKE_CURRENT_SOURCE_DIR@/docs/
 
index 19ba2d3..cb4a9a0 100644 (file)
--- a/api/maa.h
+++ b/api/maa.h
@@ -231,6 +231,12 @@ void maa_result_print(maa_result_t result);
  */
 maa_boolean_t maa_pin_mode_test(int pin, maa_pinmodes_t mode);
 
+#include "maa/pwm.h"
+#include "maa/aio.h"
+#include "maa/gpio.h"
+#include "maa/spi.h"
+#include "maa/i2c.h"
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/api/maa.hpp b/api/maa.hpp
new file mode 100644 (file)
index 0000000..91f977c
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Author: Brendan Le Foll <brendan.le.foll@intel.com>
+ * Copyright (c) 2014 Intel Corporation.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#pragma once
+
+#include "maa.h"
+#include "maa/pwm.hpp"
+#include "maa/aio.hpp"
+#include "maa/gpio.hpp"
+#include "maa/i2c.hpp"
+#include "maa/spi.hpp"
similarity index 100%
rename from api/aio.h
rename to api/maa/aio.h
similarity index 100%
rename from api/aio.hpp
rename to api/maa/aio.hpp
similarity index 100%
rename from api/gpio.h
rename to api/maa/gpio.h
similarity index 100%
rename from api/gpio.hpp
rename to api/maa/gpio.hpp
similarity index 100%
rename from api/i2c.h
rename to api/maa/i2c.h
similarity index 100%
rename from api/i2c.hpp
rename to api/maa/i2c.hpp
similarity index 100%
rename from api/pwm.h
rename to api/maa/pwm.h
similarity index 100%
rename from api/pwm.hpp
rename to api/maa/pwm.hpp
similarity index 100%
rename from api/spi.h
rename to api/maa/spi.h
similarity index 100%
rename from api/spi.hpp
rename to api/maa/spi.hpp
index a543bd2..6e1a138 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <unistd.h>
 //! [Interesting]
-#include "aio.h"
+#include "maa/aio.h"
 
 int main ()
 {
index 9b2e6a0..ec74b7c 100644 (file)
@@ -28,7 +28,7 @@
 #include <signal.h>
 #include <stdlib.h>
 
-#include "gpio.h"
+#include "maa.h"
 
 #define DEFAULT_IOPIN 8
 
index cfa3af6..47c46ef 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 //! [Interesting]
-#include "aio.hpp"
+#include "maa.hpp"
 
 int main ()
 {
index c39af75..70b7023 100644 (file)
@@ -29,7 +29,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 
-#include "gpio.hpp"
+#include "maa.hpp"
 #define DEFAULT_IOPIN 8
 
 static int iopin;
index d30c518..f742981 100644 (file)
@@ -26,7 +26,7 @@
 #include <unistd.h>
 #include <signal.h>
 
-#include "i2c.hpp"
+#include "maa.hpp"
 #include "math.h"
 
 #define MAX_BUFFER_LENGTH 6
index af8f497..1972634 100644 (file)
@@ -25,7 +25,7 @@
 #include <unistd.h>
 #include <signal.h>
 
-#include "pwm.hpp"
+#include "maa.hpp"
 
 int running = 0;
 
index 57a1264..878bdad 100644 (file)
@@ -26,7 +26,7 @@
 #include <signal.h>
 #include <stdint.h>
 
-#include "spi.hpp"
+#include "maa.hpp"
 
 int running = 0;
 
index b99d82b..e21a6a6 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <unistd.h>
 
-#include "pwm.h"
+#include "maa.h"
 
 int
 main ()
index baca2e3..c21aeab 100644 (file)
@@ -25,7 +25,7 @@
 #include "stdio.h"
 #include "unistd.h"
 
-#include "gpio.h"
+#include "maa.h"
 
 int
 main(int argc, char **argv)
index d21b452..c2f6531 100644 (file)
@@ -22,7 +22,7 @@
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "i2c.h"
+#include "maa.h"
 #include "math.h"
 
 #define MAX_BUFFER_LENGTH 6
index 4d5ec57..9f64ae9 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <unistd.h>
 
-#include "gpio.h"
+#include "maa.h"
 
 static volatile int counter = 0;
 static volatile int oldcounter = 0;
index f1516ee..3bd22b1 100644 (file)
@@ -25,7 +25,7 @@
 #include "stdio.h"
 #include <unistd.h>
 
-#include "gpio.h"
+#include "maa.h"
 
 int
 main(int argc, char **argv)
index b66322d..165e679 100644 (file)
@@ -22,7 +22,7 @@
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "spi.h"
+#include "maa.h"
 #include <unistd.h>
 #include <stdint.h>
 
index 0a6bd77..8271ea4 100644 (file)
@@ -1,5 +1,6 @@
 include_directories(
   ${PROJECT_SOURCE_DIR}/api
+  ${PROJECT_SOURCE_DIR}/api/maa
   ${PROJECT_SOURCE_DIR}/include
 )
 
@@ -16,6 +17,11 @@ set (maa_LIB_SRCS
   ${CMAKE_CURRENT_BINARY_DIR}/version.c
 )
 
+set (maa_LIB_GLOB_HEADERS
+  ${PROJECT_SOURCE_DIR}/api/maa.h
+  ${PROJECT_SOURCE_DIR}/api/maa.hpp
+)
+
 add_library (maa SHARED ${maa_LIB_SRCS})
 target_link_libraries (maa ${CMAKE_THREAD_LIBS_INIT})
 
@@ -25,7 +31,8 @@ set_target_properties(
    SOVERSION ${maa_VERSION_MAJOR}
    VERSION ${maa_VERSION_STRING}
 )
-install (DIRECTORY ${PROJECT_SOURCE_DIR}/api/ DESTINATION include/maa)
+install (FILES ${maa_LIB_GLOB_HEADERS} DESTINATION include/)
+install (DIRECTORY ${PROJECT_SOURCE_DIR}/api/maa DESTINATION include/maa)
 
 macro (maa_CREATE_INSTALL_PKGCONFIG generated_file install_location)
   configure_file (${generated_file}.cmake ${CMAKE_CURRENT_BINARY_DIR}/${generated_file} @ONLY)
index d23be50..82e8fb6 100644 (file)
@@ -8,4 +8,4 @@ Description: Low Level Skeleton Library for Communication
 Version: @maa_VERSION_STRING@
 
 Libs: -L${libdir} -lmaa
-Cflags: -I${includedir}/maa
+Cflags: -I${includedir}