You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2020/04/02 19:28:35 UTC
[plc4x] 03/03: - Added an empty PLC4C module which uses CMake to
build and uses Unity to unit-test
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit 144caf5551a3c4b50206dfde61ef9cddcae83fcf
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Thu Apr 2 21:28:08 2020 +0200
- Added an empty PLC4C module which uses CMake to build and uses Unity to unit-test
---
sandbox/plc4c/CMakeLists.txt | 78 ++++++
sandbox/plc4c/api/CMakeLists.txt | 32 +++
sandbox/plc4c/api/src/main/c/Adder.c | 25 ++
sandbox/plc4c/api/src/main/include/Adder.h | 25 ++
sandbox/plc4c/api/src/test/c/AdderTest.c | 40 ++++
sandbox/plc4c/drivers/CMakeLists.txt | 21 ++
sandbox/plc4c/drivers/modbus/CMakeLists.txt | 23 ++
sandbox/plc4c/drivers/s7/CMakeLists.txt | 23 ++
sandbox/plc4c/examples/CMakeLists.txt | 20 ++
sandbox/plc4c/examples/hello-world/CMakeLists.txt | 25 ++
.../examples/hello-world/src/main/c/HelloWorld.c | 30 +++
.../hello-world/src/main/include/HelloWorld.h | 25 ++
sandbox/plc4c/integrations/CMakeLists.txt | 20 ++
.../integrations/apache-mynewt/CMakeLists.txt | 23 ++
sandbox/plc4c/pom.xml | 266 +++++++++++++++++++++
sandbox/plc4c/spi/CMakeLists.txt | 23 ++
sandbox/plc4c/transports/CMakeLists.txt | 21 ++
sandbox/plc4c/transports/serial/CMakeLists.txt | 23 ++
sandbox/plc4c/transports/tcp/CMakeLists.txt | 23 ++
sandbox/pom.xml | 10 +-
20 files changed, 775 insertions(+), 1 deletion(-)
diff --git a/sandbox/plc4c/CMakeLists.txt b/sandbox/plc4c/CMakeLists.txt
new file mode 100644
index 0000000..fb6da71
--- /dev/null
+++ b/sandbox/plc4c/CMakeLists.txt
@@ -0,0 +1,78 @@
+#[[
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+]]
+
+cmake_minimum_required(VERSION 3.16)
+
+# Set the name of this project
+project(PLC4C)
+
+# Set the C language level to C11
+set(CMAKE_C_STANDARD 11)
+
+# Save the root directory
+set(PLC4C_ROOT_DIR ${CMAKE_SOURCE_DIR})
+
+# Our link to the maven lifecycle
+set(BUILD_PHASE compile CACHE STRING "Phase of the Maven build we are executing cmake")
+
+# Access the Unity version the maven build is providing us with.
+set(UNITY_VERSION 0 CACHE STRING "Version of the used Unity test framework")
+
+# Depending on the phase of the build we are currently running, initialize
+# The test system.
+if(BUILD_PHASE STREQUAL compile)
+ # Nothing really to do here ... just need it to check the known values.
+elseif(BUILD_PHASE STREQUAL test-compile)
+ # Initialize the test subsystem as well as the Unity library sources
+ include(CTest)
+
+ # Make the Unity sources available to the build as "Unity" library
+ add_subdirectory(target/dependency/Unity-${UNITY_VERSION})
+
+ #add_library(Unity STATIC
+ # target/dependency/Unity-${UNITY_VERSION}/src/unity.c
+ #)
+ #target_include_directories(Unity PUBLIC
+ # target/dependency/Unity-${UNITY_VERSION}/src
+ #)
+else()
+ # Output an error
+ message(FATAL_ERROR "Given BUILD_PHASE unknown. Known values are 'compile' and 'test-compile'")
+endif()
+
+set(DEBUG_OUTPUT OFF CACHE BOOL "Enable outputting of debug information")
+if(DEBUG_OUTPUT)
+ # Trace all CMAKE Variables
+ get_cmake_property(_variableNames VARIABLES)
+ list (SORT _variableNames)
+ foreach (_variableName ${_variableNames})
+ message(STATUS "${_variableName}=${${_variableName}}")
+ endforeach()
+endif()
+
+#[[
+ Build all the modules of PLC4C
+]]
+# Core stuff
+add_subdirectory(api)
+#add_subdirectory(spi)
+#add_subdirectory(transports)
+#add_subdirectory(drivers)
+#add_subdirectory(integrations)
+add_subdirectory(examples)
\ No newline at end of file
diff --git a/sandbox/plc4c/api/CMakeLists.txt b/sandbox/plc4c/api/CMakeLists.txt
new file mode 100644
index 0000000..5d6486b
--- /dev/null
+++ b/sandbox/plc4c/api/CMakeLists.txt
@@ -0,0 +1,32 @@
+#[[
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+]]
+
+include_directories("src/main/include")
+file(GLOB sources "src/main/c/*.c")
+add_library(plc4c-api ${sources})
+
+if(BUILD_PHASE STREQUAL test-compile)
+ file(GLOB testSources "src/test/c/*.c")
+ add_executable(plc4c-api-test ${testSources})
+ target_link_libraries (plc4c-api-test
+ plc4c-api
+ unity
+ )
+ add_test(NAME plc4c-api-test COMMAND plc4c-api-test)
+endif()
diff --git a/sandbox/plc4c/api/src/main/c/Adder.c b/sandbox/plc4c/api/src/main/c/Adder.c
new file mode 100644
index 0000000..54bc690
--- /dev/null
+++ b/sandbox/plc4c/api/src/main/c/Adder.c
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#include<stdio.h>
+
+#include "Adder.h"
+
+int add(int a, int b) {
+ return a + b;
+}
\ No newline at end of file
diff --git a/sandbox/plc4c/api/src/main/include/Adder.h b/sandbox/plc4c/api/src/main/include/Adder.h
new file mode 100644
index 0000000..680fddb
--- /dev/null
+++ b/sandbox/plc4c/api/src/main/include/Adder.h
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef _ADDER_H_
+#define _ADDER_H_
+
+int add(int, int);
+
+#endif
\ No newline at end of file
diff --git a/sandbox/plc4c/api/src/test/c/AdderTest.c b/sandbox/plc4c/api/src/test/c/AdderTest.c
new file mode 100644
index 0000000..e3edb01
--- /dev/null
+++ b/sandbox/plc4c/api/src/test/c/AdderTest.c
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#include <unity.h>
+#include "Adder.h"
+
+void setUp(void) {
+}
+
+void tearDown(void) {
+}
+
+void test_add(void)
+{
+ TEST_ASSERT_EQUAL_HEX8(2, add(1, 1));
+}
+
+int main(void)
+{
+ UNITY_BEGIN();
+
+ RUN_TEST(test_add);
+
+ return UNITY_END();
+}
\ No newline at end of file
diff --git a/sandbox/plc4c/drivers/CMakeLists.txt b/sandbox/plc4c/drivers/CMakeLists.txt
new file mode 100644
index 0000000..cf842f4
--- /dev/null
+++ b/sandbox/plc4c/drivers/CMakeLists.txt
@@ -0,0 +1,21 @@
+#[[
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+]]
+
+add_subdirectory(modbus)
+add_subdirectory(s7)
diff --git a/sandbox/plc4c/drivers/modbus/CMakeLists.txt b/sandbox/plc4c/drivers/modbus/CMakeLists.txt
new file mode 100644
index 0000000..3c61e0a
--- /dev/null
+++ b/sandbox/plc4c/drivers/modbus/CMakeLists.txt
@@ -0,0 +1,23 @@
+#[[
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+]]
+
+add_library(plc4c-drivers-modbus
+ )
+
+target_link_libraries (plc4c-drivers-modbus ${CMAKE_DL_LIBS})
\ No newline at end of file
diff --git a/sandbox/plc4c/drivers/s7/CMakeLists.txt b/sandbox/plc4c/drivers/s7/CMakeLists.txt
new file mode 100644
index 0000000..6e1b386
--- /dev/null
+++ b/sandbox/plc4c/drivers/s7/CMakeLists.txt
@@ -0,0 +1,23 @@
+#[[
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+]]
+
+add_library(plc4c-drivers-s7
+ )
+
+target_link_libraries (plc4c-drivers-s7 ${CMAKE_DL_LIBS})
\ No newline at end of file
diff --git a/sandbox/plc4c/examples/CMakeLists.txt b/sandbox/plc4c/examples/CMakeLists.txt
new file mode 100644
index 0000000..27addc0
--- /dev/null
+++ b/sandbox/plc4c/examples/CMakeLists.txt
@@ -0,0 +1,20 @@
+#[[
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+]]
+
+add_subdirectory(hello-world)
diff --git a/sandbox/plc4c/examples/hello-world/CMakeLists.txt b/sandbox/plc4c/examples/hello-world/CMakeLists.txt
new file mode 100644
index 0000000..1f41690
--- /dev/null
+++ b/sandbox/plc4c/examples/hello-world/CMakeLists.txt
@@ -0,0 +1,25 @@
+#[[
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+]]
+
+include_directories("src/main/include")
+file(GLOB sources "src/main/c/*.c")
+
+add_executable(plc4c-examples-hello-world ${sources})
+
+target_link_libraries (plc4c-examples-hello-world ${CMAKE_DL_LIBS})
\ No newline at end of file
diff --git a/sandbox/plc4c/examples/hello-world/src/main/c/HelloWorld.c b/sandbox/plc4c/examples/hello-world/src/main/c/HelloWorld.c
new file mode 100644
index 0000000..2fc8fe7
--- /dev/null
+++ b/sandbox/plc4c/examples/hello-world/src/main/c/HelloWorld.c
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#include<stdio.h>
+
+#include "HelloWorld.h"
+
+int add(int a, int b) {
+ return a + b;
+}
+
+int main() {
+ printf("Hello World\n");
+ return 0;
+}
\ No newline at end of file
diff --git a/sandbox/plc4c/examples/hello-world/src/main/include/HelloWorld.h b/sandbox/plc4c/examples/hello-world/src/main/include/HelloWorld.h
new file mode 100644
index 0000000..e9125a4
--- /dev/null
+++ b/sandbox/plc4c/examples/hello-world/src/main/include/HelloWorld.h
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef _HELLO_WORLD_H_
+#define _HELLO_WORLD_H_
+
+int add(int, int);
+
+#endif
\ No newline at end of file
diff --git a/sandbox/plc4c/integrations/CMakeLists.txt b/sandbox/plc4c/integrations/CMakeLists.txt
new file mode 100644
index 0000000..7d33ecd
--- /dev/null
+++ b/sandbox/plc4c/integrations/CMakeLists.txt
@@ -0,0 +1,20 @@
+#[[
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+]]
+
+add_subdirectory(apache-mynewt)
diff --git a/sandbox/plc4c/integrations/apache-mynewt/CMakeLists.txt b/sandbox/plc4c/integrations/apache-mynewt/CMakeLists.txt
new file mode 100644
index 0000000..e697a19
--- /dev/null
+++ b/sandbox/plc4c/integrations/apache-mynewt/CMakeLists.txt
@@ -0,0 +1,23 @@
+#[[
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+]]
+
+add_library(plc4c-integrations-apache-mynewt
+ )
+
+target_link_libraries (plc4c-integrations-apache-mynewt ${CMAKE_DL_LIBS})
\ No newline at end of file
diff --git a/sandbox/plc4c/pom.xml b/sandbox/plc4c/pom.xml
new file mode 100644
index 0000000..cbcad64
--- /dev/null
+++ b/sandbox/plc4c/pom.xml
@@ -0,0 +1,266 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.plc4x.sandbox</groupId>
+ <artifactId>plc4x-sandbox</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>plc4c</artifactId>
+ <packaging>pom</packaging>
+
+ <name>Sandbox: PLC4C</name>
+ <description>Implementation of the protocol adapters for usage as C library.</description>
+
+ <properties>
+ <unity.version>2.5.0</unity.version>
+ <!-- Tell Sonar where to find the c++ sources -->
+ <sonar.sources></sonar.sources>
+ <option.with-proxies>OFF</option.with-proxies>
+ </properties>
+
+ <!--
+ Notes:
+ - It turns out that the default version of CMake the cmake-maven-plugin uses is too
+ old to detect the recent boost version. So we need to manually download a newer version
+ and tell the plugin to use that instead.
+ - As downloading and building boost takes quite some time, we only do this, if no
+ target/lib/boost is found.
+ -->
+
+ <profiles>
+ <!-- Profile for linux -->
+ <profile>
+ <id>os-unix</id>
+ <activation>
+ <os>
+ <family>unix</family>
+ </os>
+ </activation>
+ <!-- Make the cmake executable executable -->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>make-cmake-executable</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ <configuration>
+ <basedir>${cmake.root-dir}</basedir>
+ <executable>chmod</executable>
+ <arguments>
+ <argument>+x</argument>
+ <argument>cmake</argument>
+ </arguments>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <!-- Profile for mac -->
+ <profile>
+ <id>os-mac</id>
+ <activation>
+ <os>
+ <family>mac</family>
+ </os>
+ </activation>
+ <!-- Make the cmake executable executable -->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>make-cmake-executable</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ <configuration>
+ <basedir>${cmake.root}</basedir>
+ <executable>chmod</executable>
+ <arguments>
+ <argument>+x</argument>
+ <argument>cmake</argument>
+ </arguments>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <artifactId>download-maven-plugin</artifactId>
+ <executions>
+ <!-- First download the cmake binaries -->
+ <execution>
+ <id>get-cmake</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+ <url>${cmake.url}</url>
+ <unpack>true</unpack>
+ <outputDirectory>${project.build.directory}</outputDirectory>
+ </configuration>
+ </execution>
+ <!--
+ Get additional stuff we need for the build.
+ -->
+ <execution>
+ <id>get-unity</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+ <url>https://github.com/ThrowTheSwitch/Unity/archive/v${unity.version}.zip</url>
+ <unpack>true</unpack>
+ <outputDirectory>${project.build.directory}/dependency</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!--
+ Do the actual build.
+ -->
+ <plugin>
+ <groupId>com.googlecode.cmake-maven-project</groupId>
+ <artifactId>cmake-maven-plugin</artifactId>
+ <executions>
+ <!-- Generate the configuration for the main compilation -->
+ <execution>
+ <id>cmake-generate-compile</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ <!-- Compile the main code -->
+ <execution>
+ <id>cmake-execute-compile</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ <!-- Generate the configuration for the test compilation -->
+ <execution>
+ <id>cmake-generate-test-compile</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <options>
+ <option>-DUNITY_VERSION:STRING=${unity.version}</option>
+ <option>-DBUILD_PHASE=test-compile</option>
+ </options>
+ </configuration>
+ </execution>
+ <!-- Compile the test code -->
+ <execution>
+ <id>cmake-execute-test-compile</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <!--
+ We need to use a newer version of cmake, so disable downloading
+ and tell the plugin where to find that version.
+ -->
+ <downloadBinaries>false</downloadBinaries>
+ <cmakeDir>${cmake.root}</cmakeDir>
+ <!--
+ Actually the path to the CMakeList.txt file which then again
+ tells to tool where to find the sources.
+ -->
+ <sourcePath>${project.basedir}</sourcePath>
+ <!--
+ Path to where the build configuration is generated
+ (This directory is then used in the compile step to actually perform the build)
+ -->
+ <targetPath>${project.build.directory}/build</targetPath>
+ <!--
+ Name of the generator the compile step will be executing.
+ -->
+ <generator>${cmake.generator}</generator>
+ <!-- The directory where the "generate" step generated the build configuration -->
+ <projectDirectory>${project.build.directory}/build</projectDirectory>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>run-tests</id>
+ <phase>test</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ <configuration>
+ <basedir>${project.build.directory}/build</basedir>
+ <executable>${cmake.root}/ctest</executable>
+ <arguments>
+ <argument>--extra-verbose</argument>
+ </arguments>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin> </plugins>
+ </build>
+
+ <!-- This dependency is just to ensure thrift is built first -->
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.plc4x</groupId>
+ <artifactId>plc4x-tools-thrift</artifactId>
+ <version>${project.version}</version>
+ <type>zip</type>
+ <classifier>compiler-${os.classifier}</classifier>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+</project>
\ No newline at end of file
diff --git a/sandbox/plc4c/spi/CMakeLists.txt b/sandbox/plc4c/spi/CMakeLists.txt
new file mode 100644
index 0000000..1b625e4
--- /dev/null
+++ b/sandbox/plc4c/spi/CMakeLists.txt
@@ -0,0 +1,23 @@
+#[[
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+]]
+
+add_library(plc4c-spi
+ )
+
+target_link_libraries (plc4c-spi ${CMAKE_DL_LIBS})
\ No newline at end of file
diff --git a/sandbox/plc4c/transports/CMakeLists.txt b/sandbox/plc4c/transports/CMakeLists.txt
new file mode 100644
index 0000000..d9eebd8
--- /dev/null
+++ b/sandbox/plc4c/transports/CMakeLists.txt
@@ -0,0 +1,21 @@
+#[[
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+]]
+
+add_subdirectory(serial)
+add_subdirectory(tcp)
\ No newline at end of file
diff --git a/sandbox/plc4c/transports/serial/CMakeLists.txt b/sandbox/plc4c/transports/serial/CMakeLists.txt
new file mode 100644
index 0000000..51e5502
--- /dev/null
+++ b/sandbox/plc4c/transports/serial/CMakeLists.txt
@@ -0,0 +1,23 @@
+#[[
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+]]
+
+add_library(plc4c-transpots-serial
+ )
+
+target_link_libraries (plc4c-transpots-serial ${CMAKE_DL_LIBS})
\ No newline at end of file
diff --git a/sandbox/plc4c/transports/tcp/CMakeLists.txt b/sandbox/plc4c/transports/tcp/CMakeLists.txt
new file mode 100644
index 0000000..1833687
--- /dev/null
+++ b/sandbox/plc4c/transports/tcp/CMakeLists.txt
@@ -0,0 +1,23 @@
+#[[
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+]]
+
+add_library(plc4c-transpots-tcp
+ )
+
+target_link_libraries (plc4c-transpots-tcp ${CMAKE_DL_LIBS})
\ No newline at end of file
diff --git a/sandbox/pom.xml b/sandbox/pom.xml
index b65517f..0e88e59 100644
--- a/sandbox/pom.xml
+++ b/sandbox/pom.xml
@@ -62,7 +62,15 @@
</dependencies>
<profiles>
- <!-- Build PLC4X including the CPP modules -->
+ <!-- Build PLC4X including the C modules -->
+ <profile>
+ <id>with-c</id>
+ <modules>
+ <module>plc4c</module>
+ </modules>
+ </profile>
+
+ <!-- Build PLC4X including the C++ modules -->
<profile>
<id>with-cpp</id>
<modules>