Author: veithm
Date: Fri Apr 26 15:06:25 2013
New Revision: 1476247
URL: http://svn.apache.org/r1476247
Log:
ETCH-270 Passing through Capu include and library dirs in ant build
Integrating CAPU v0.9.0, disabling unit tests by default
Change-Id: Ia1f13174803092618a226744f97823af70990b0b
Modified:
etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/vf_cpp.vm
etch/trunk/binding-cpp/runtime/CMakeLists.txt
etch/trunk/binding-cpp/runtime/FindCapu.cmake
etch/trunk/binding-cpp/runtime/build.xml
etch/trunk/binding-cpp/runtime/include/common/EtchList.h
etch/trunk/binding-cpp/runtime/src/main/support/EtchRuntime.cpp
etch/trunk/binding-cpp/runtime/src/test/common/EtchListTest.cpp
Modified:
etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/vf_cpp.vm
URL:
http://svn.apache.org/viewvc/etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/vf_cpp.vm?rev=1476247&r1=1476246&r2=1476247&view=diff
==============================================================================
---
etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/vf_cpp.vm
(original)
+++
etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/vf_cpp.vm
Fri Apr 26 15:06:25 2013
@@ -348,7 +348,7 @@ status_t $vf::InitValueFactory(EtchRunti
{
status_t status;
SRuntimesMutex.lock();
- if (SRuntimes.find(runtime->getId()) != -1) {
+ if (SRuntimes.find(runtime->getId()) != SRuntimes.end()) {
//runtime is already in list
return ETCH_OK;
}
Modified: etch/trunk/binding-cpp/runtime/CMakeLists.txt
URL:
http://svn.apache.org/viewvc/etch/trunk/binding-cpp/runtime/CMakeLists.txt?rev=1476247&r1=1476246&r2=1476247&view=diff
==============================================================================
--- etch/trunk/binding-cpp/runtime/CMakeLists.txt (original)
+++ etch/trunk/binding-cpp/runtime/CMakeLists.txt Fri Apr 26 15:06:25 2013
@@ -68,9 +68,10 @@ add_subdirectory (src/main)
add_subdirectory (src/test)
#install capu headers and library
-INSTALL(DIRECTORY ${LIBCAPU_INCLUDE_DIR}/capu DESTINATION
"${ETCH_INSTALL_DIR}/include")
-INSTALL(DIRECTORY ${LIBCAPU_LIBRARY_DIR} DESTINATION
"${ETCH_INSTALL_DIR}/lib/${ETCH_TARGET_PLATFORM}")
+INSTALL(DIRECTORY ${LIBCAPU_INCLUDE_DIR}/capu DESTINATION
"${ETCH_INSTALL_DIR}/include")
+
+INSTALL(DIRECTORY ${LIBCAPU_LIBRARY_DIR}/ DESTINATION
"${ETCH_INSTALL_DIR}/lib/${ETCH_TARGET_PLATFORM}/${CMAKE_BUILD_TYPE}"
FILES_MATCHING PATTERN "*capu*" PERMISSIONS OWNER_EXECUTE OWNER_WRITE
OWNER_READ GROUP_EXECUTE GROUP_READ)
IF (NOT ${LIBCAPU_BINARY_DIR} STREQUAL "")
- INSTALL(DIRECTORY ${LIBCAPU_BINARY_DIR} DESTINATION
"${ETCH_INSTALL_DIR}/bin/${ETCH_TARGET_PLATFORM}" FILES_MATCHING PATTERN
"capuTest*" PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE
GROUP_READ)
+ INSTALL(DIRECTORY ${LIBCAPU_BINARY_DIR} DESTINATION
"${ETCH_INSTALL_DIR}/bin/${ETCH_TARGET_PLATFORM}/${CMAKE_BUILD_TYPE}"
FILES_MATCHING PATTERN "capuTest*" PERMISSIONS OWNER_EXECUTE OWNER_WRITE
OWNER_READ GROUP_EXECUTE GROUP_READ)
ENDIF()
Modified: etch/trunk/binding-cpp/runtime/FindCapu.cmake
URL:
http://svn.apache.org/viewvc/etch/trunk/binding-cpp/runtime/FindCapu.cmake?rev=1476247&r1=1476246&r2=1476247&view=diff
==============================================================================
--- etch/trunk/binding-cpp/runtime/FindCapu.cmake (original)
+++ etch/trunk/binding-cpp/runtime/FindCapu.cmake Fri Apr 26 15:06:25 2013
@@ -25,9 +25,12 @@ IF (NOT DEFINED CMAKE_BUILD_TYPE)
MESSAGE(FATAL_ERROR "CMAKE_BUILD_TYPE not set")
ENDIF()
-IF (NOT DEFINED CAPU_INCLUDE_DIR OR NOT DEFINED CAPU_LIBRARY_DIR)
+IF ("${CAPU_INCLUDE_DIR}" STREQUAL "" AND "${CAPU_LIBRARY_DIR}" STREQUAL "")
include(ExternalProject)
+ MESSAGE(STATUS "using ${CAPU_INCLUDE_DIR} as CAPU include directory")
+ MESSAGE(STATUS "using ${CAPU_LIBRARY_DIR} as CAPU library directory")
+
IF ("${LOCAL_CAPU_SOURCE_DIR}" STREQUAL "")
#download capu from foreign repository
SET(CAPU_PROJECT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/3rd/capu")
@@ -35,13 +38,14 @@ IF (NOT DEFINED CAPU_INCLUDE_DIR OR NOT
ExternalProject_Add(
Capu
- URL https://github.com/bmwcarit/capu/archive/v0.8.1.zip
+ URL https://github.com/bmwcarit/capu/archive/v0.9.0.zip
SOURCE_DIR "${CAPU_PROJECT_DIR}"
BINARY_DIR "${CAPU_CMAKE_BUILD_DIR}"
INSTALL_DIR "${CAPU_PROJECT_DIR}/deliverable"
UPDATE_COMMAND ""
CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE:PATH=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
+
-DCONFIG_BUILD_UNITTESTS:BOOLEAN=${CONFIG_BUILD_UNITTESTS}
INSTALL 1
)
ELSE()
@@ -60,11 +64,11 @@ IF (NOT DEFINED CAPU_INCLUDE_DIR OR NOT
)
ENDIF()
- SET(CAPU_DELIVERABLE_DIR ${CAPU_PROJECT_DIR}/deliverable/Capu)
+ SET(CAPU_DELIVERABLE_DIR
${CAPU_PROJECT_DIR}/deliverable/${TARGET_OS}_${TARGET_ARCH}/${CMAKE_BUILD_TYPE})
- SET(LIBCAPU_INCLUDE_DIR ${CAPU_DELIVERABLE_DIR}/include/Capu)
- SET(LIBCAPU_LIBRARY_DIR
${CAPU_DELIVERABLE_DIR}/lib/${TARGET_OS}_${TARGET_ARCH}/${CMAKE_BUILD_TYPE})
- SET(LIBCAPU_BINARY_DIR
${CAPU_DELIVERABLE_DIR}/bin/${TARGET_OS}_${TARGET_ARCH}/${CMAKE_BUILD_TYPE})
+ SET(LIBCAPU_INCLUDE_DIR ${CAPU_DELIVERABLE_DIR}/include)
+ SET(LIBCAPU_LIBRARY_DIR ${CAPU_DELIVERABLE_DIR}/lib)
+ SET(LIBCAPU_BINARY_DIR ${CAPU_DELIVERABLE_DIR}/bin)
ELSE()
SET(LIBCAPU_INCLUDE_DIR ${CAPU_INCLUDE_DIR})
SET(LIBCAPU_LIBRARY_DIR ${CAPU_LIBRARY_DIR})
Modified: etch/trunk/binding-cpp/runtime/build.xml
URL:
http://svn.apache.org/viewvc/etch/trunk/binding-cpp/runtime/build.xml?rev=1476247&r1=1476246&r2=1476247&view=diff
==============================================================================
--- etch/trunk/binding-cpp/runtime/build.xml (original)
+++ etch/trunk/binding-cpp/runtime/build.xml Fri Apr 26 15:06:25 2013
@@ -125,6 +125,37 @@
<property name="cmake.toolchainfile"
value="${defaultCMakeToolchainDir}/${platform}.toolchain"/>
</else>
</if>
+
+ <if>
+ <isset property="CAPU_INCLUDE_DIR"/>
+ <then>
+ <property name="use.capu.include.dir"
value="${CAPU_INCLUDE_DIR}"/>
+ </then>
+ <else>
+ <property name="use.capu.include.dir" value=""/>
+ </else>
+ </if>
+
+ <if>
+ <isset property="CAPU_LIBRARY_DIR"/>
+ <then>
+ <property name="use.capu.library.dir"
value="${CAPU_LIBRARY_DIR}"/>
+ </then>
+ <else>
+ <property name="use.capu.library.dir" value=""/>
+ </else>
+ </if>
+
+ <if>
+ <isset property="LOCAL_CAPU_SOURCE_DIR"/>
+ <then>
+ <property name="use.capu.local.source.dir"
value="${LOCAL_CAPU_SOURCE_DIR}"/>
+ </then>
+ <else>
+ <property name="use.capu.local.source.dir" value=""/>
+ </else>
+ </if>
+
<if>
<isset property="target.platforms.${platform}.generator"/>
<then>
@@ -133,8 +164,9 @@
<echo>Configuring CMake build</echo>
<echo>Using generator: ${cmake.generator}</echo>
<echo>Using toolchain file: ${cmake.toolchainfile}</echo>
+
<mkdir dir="${target}/${platform}/${Etch.build.target}"/>
-
+
<!-- CMake configuration -->
<exec dir="${target}/${platform}/${Etch.build.target}"
executable="cmake" failonerror="true">
<arg value="-G${cmake.generator}"/>
@@ -143,6 +175,10 @@
<arg
value="-DETCH_INSTALL_DIR:PATH=${Etch.dist}/binding-cpp"/>
<arg value="-DETCH_TARGET_PLATFORM:STRING=${platform}"/>
<arg
value="-DCMAKE_BUILD_TYPE:STRING=${Etch.build.target}"/>
+ <arg
value="-DCAPU_INCLUDE_DIR:PATH=${use.capu.include.dir}"/>
+ <arg
value="-DCAPU_LIBRARY_DIR:PATH=${use.capu.library.dir}"/>
+ <arg
value="-DLOCAL_CAPU_SOURCE_DIR:PATH=${use.capu.local.source.dir}"/>
+ <arg value="-DCONFIG_BUILD_UNITTESTS:BOOLEAN=0"/>
<arg value="${basedir}"/>
</exec>
@@ -157,7 +193,7 @@
<echo>Configuring CMake build</echo>
<echo>Using default generator</echo>
<echo>Using toolchain file: ${cmake.toolchainfile}</echo>
-
+
<mkdir dir="${target}/${platform}/${Etch.build.target}"/>
<!-- CMake configuration -->
@@ -167,6 +203,10 @@
<arg
value="-DETCH_INSTALL_DIR:PATH=${Etch.dist}/binding-cpp"/>
<arg value="-DETCH_TARGET_PLATFORM:STRING=${platform}"/>
<arg
value="-DCMAKE_BUILD_TYPE:STRING=${Etch.build.target}"/>
+ <arg
value="-DCAPU_INCLUDE_DIR:PATH=${use.capu.include.dir}"/>
+ <arg
value="-DCAPU_LIBRARY_DIR:PATH=${use.capu.library.dir}"/>
+ <arg
value="-DLOCAL_CAPU_SOURCE_DIR:PATH=${use.capu.local.source.dir}"/>
+ <arg value="-DCONFIG_BUILD_UNITTESTS:BOOLEAN=0"/>
<arg value="${basedir}"/>
</exec>
Modified: etch/trunk/binding-cpp/runtime/include/common/EtchList.h
URL:
http://svn.apache.org/viewvc/etch/trunk/binding-cpp/runtime/include/common/EtchList.h?rev=1476247&r1=1476246&r2=1476247&view=diff
==============================================================================
--- etch/trunk/binding-cpp/runtime/include/common/EtchList.h (original)
+++ etch/trunk/binding-cpp/runtime/include/common/EtchList.h Fri Apr 26
15:06:25 2013
@@ -161,10 +161,10 @@ public:
* if you are using an object you need to overload == operator
*
* @param element the value that will be searched
- * @return -1 if the value either does not exist or given value is NULL
- * otherwise index of value on linked list
+ * @return Iterator to the searched element if the element is found
+ * otherwise Iterator to the end of the list
*/
- capu::int32_t find(const T &element) const;
+ Iterator find(const T &element) const;
/**
*
@@ -244,8 +244,8 @@ capu::bool_t EtchList<T, A, C>::contains
}
template<class T, class A, class C>
-capu::int32_t EtchList<T, A, C>::find(const T &element) const {
- return mList.find(element);
+typename EtchList<T, A, C>::Iterator EtchList<T, A, C>::find(const T &element)
const {
+ return EtchListIterator(mList.find(element), mList.end());
}
template<class T, class A, class C>
Modified: etch/trunk/binding-cpp/runtime/src/main/support/EtchRuntime.cpp
URL:
http://svn.apache.org/viewvc/etch/trunk/binding-cpp/runtime/src/main/support/EtchRuntime.cpp?rev=1476247&r1=1476246&r2=1476247&view=diff
==============================================================================
--- etch/trunk/binding-cpp/runtime/src/main/support/EtchRuntime.cpp (original)
+++ etch/trunk/binding-cpp/runtime/src/main/support/EtchRuntime.cpp Fri Apr 26
15:06:25 2013
@@ -54,9 +54,9 @@ status_t EtchRuntime::registerListener(E
status_t EtchRuntime::unregisterListener(EtchRuntimeListener* listener) {
status_t status;
mMutex.lock();
- capu::int_t index = mListeners.find(listener);
- if(index != -1) {
- mListeners.erase(index);
+ capu::List<EtchRuntimeListener*>::Iterator it = mListeners.find(listener);
+ if(it != mListeners.end()) {
+ mListeners.erase(it);
status = ETCH_OK;
} else {
status = ETCH_ERROR;
Modified: etch/trunk/binding-cpp/runtime/src/test/common/EtchListTest.cpp
URL:
http://svn.apache.org/viewvc/etch/trunk/binding-cpp/runtime/src/test/common/EtchListTest.cpp?rev=1476247&r1=1476246&r2=1476247&view=diff
==============================================================================
--- etch/trunk/binding-cpp/runtime/src/test/common/EtchListTest.cpp (original)
+++ etch/trunk/binding-cpp/runtime/src/test/common/EtchListTest.cpp Fri Apr 26
15:06:25 2013
@@ -226,13 +226,13 @@ TEST(EtchList, find) {
list->add(data3);
//find the elements
- result = list->find(data1);
+ result = list->find(data1).currentIndex();
EXPECT_EQ(0, result);
- result = list->find(data2);
+ result = list->find(data2).currentIndex();
EXPECT_EQ(1, result);
- result = list->find(data3);
+ result = list->find(data3).currentIndex();
EXPECT_EQ(2, result);
delete list;