[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/13/7113/1'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/13/7313/1'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/12/7312/2'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/15/7115/1'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/16/7316/3'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/15/7315/3'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/13/7113/2'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/11/7111/2'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/82/7182/1'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/83/7183/1'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/18/7318/1'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/84/7184/1'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/15/7315/2'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/12/7112/1'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/17/7317/1'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/17/7317/3'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/14/7314/2'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/83/7183/2'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/14/7314/3'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/18/7318/3'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/85/7185/2'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/15/7115/2'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/16/7316/2'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/14/7114/1'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/12/7312/1'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/18/7318/2'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/85/7185/1'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/13/7313/2'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/15/7315/1'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/12/7112/2'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/11/7111/1'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/17/7317/2'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/82/7182/2'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/14/7314/1'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/14/7114/2'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Changes to 'refs/changes/84/7184/2'

2014-09-29 Thread Bernhard Sessler

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Branch 'feature/cmake' - CMakeLists.txt src/CMakeLists.txt src/DllPlugInTester

2014-01-11 Thread Bernhard Sessler
 CMakeLists.txt |5 +
 src/CMakeLists.txt |1 +
 src/DllPlugInTester/CMakeLists.txt |   23 +++
 3 files changed, 29 insertions(+)

New commits:
commit 78b0923b6ae906753a843956a7b187df60dee595
Author: Bernhard Sessler bernhard.sess...@corscience.de
Date:   Thu Dec 12 13:27:40 2013 +0100

DllPluginTester: Add CMake build system

This patch will enable building the plugin tester executable

Change-Id: If14360b92dbc2d9698162b8fd0263421a061f90c
Signed-off-by: Bernhard Sessler bernhard.sess...@corscience.de
Reviewed-on: https://gerrit.libreoffice.org/7314
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3e6c407..b545035 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,6 +19,11 @@ option(BUILD_SHARED_LIBS   Build cppunit as shared 
or static library
 option(CPPUNIT_BUILD_APIDOCAdds a build target for generating the API 
documentation OFF)
 option(CPPUNIT_BUILD_QT_TESTRUNNER Build the Qt test runner library  
   OFF)
 option(CPPUNIT_BUILD_EXAMPLES  Build the examples shipped with cppunit   
   OFF)
+option(CPPUNIT_BUILD_TESTING   Enables testing with CTest and adds a 
'test' target  OFF)
+
+if(CPPUNIT_BUILD_TESTING)
+enable_testing()
+endif()
 
 if(BUILD_SHARED_LIBS AND WIN32)
 add_definitions(-DCPPUNIT_BUILD_DLL)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index cc89dcb..fea7014 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,4 +1,5 @@
 add_subdirectory(cppunit)
+add_subdirectory(DllPlugInTester)
 
 if(CPPUNIT_BUILD_QT_TESTRUNNER)
 add_subdirectory(qttestrunner)
diff --git a/src/DllPlugInTester/CMakeLists.txt 
b/src/DllPlugInTester/CMakeLists.txt
new file mode 100644
index 000..d15e0a0
--- /dev/null
+++ b/src/DllPlugInTester/CMakeLists.txt
@@ -0,0 +1,23 @@
+# Create plugin tester executable
+set(cppunit-plugintester_SOURCES
+CommandLineParser.cpp
+DllPlugInTester.cpp)
+
+add_executable(cppunit-plugintester ${cppunit-plugintester_SOURCES})
+target_link_libraries(cppunit-plugintester cppunit)
+
+install(TARGETS cppunit-plugintester
+RUNTIME DESTINATION bin COMPONENT misc)
+
+if(CPPUNIT_BUILD_TESTING)
+# Create plugin tester test executable
+set(cppunit-plugintester-test_SOURCES
+CommandLineParser.cpp
+CommandLineParserTest.cpp
+DllPlugInTesterTest.cpp)
+
+add_executable(cppunit-plugintester-test 
${cppunit-plugintester-test_SOURCES})
+target_link_libraries(cppunit-plugintester-test cppunit)
+
+add_test(NAME cppunit-plugintester-test COMMAND cppunit-plugintester-test)
+endif()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Branch 'feature/cmake' - CMakeLists.txt examples/CMakeLists.txt examples/cppunittest

2014-01-11 Thread Bernhard Sessler
 CMakeLists.txt  |1 
 examples/CMakeLists.txt |2 +
 examples/cppunittest/CMakeLists.txt |   53 
 3 files changed, 56 insertions(+)

New commits:
commit 5c300a093a72e808751ff69508f7e92889474d64
Author: Bernhard Sessler bernhard.sess...@corscience.de
Date:   Wed Jan 8 14:38:07 2014 +0100

examples/cppunittest: Add to CMake build system

This patch adds support for building the cppunittest executable
and plugin with the CMake build system

Change-Id: I4fe90657a4f74a1a96650ebdf176d2b2b8884c9c
Signed-off-by: Bernhard Sessler bernhard.sess...@corscience.de
Reviewed-on: https://gerrit.libreoffice.org/7315
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b545035..c57daea 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 2.8.7)
 
 # Add project specific CMake module path
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 0c26262..5bf007b 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_subdirectory(cppunittest)
+
 if(CPPUNIT_BUILD_QT_TESTRUNNER)
 add_subdirectory(qt)
 endif()
diff --git a/examples/cppunittest/CMakeLists.txt 
b/examples/cppunittest/CMakeLists.txt
new file mode 100644
index 000..f41d46e
--- /dev/null
+++ b/examples/cppunittest/CMakeLists.txt
@@ -0,0 +1,53 @@
+# Common source files
+set(cppunit-test-objlib_SOURCES
+assertion_traitsTest.cpp
+BaseTestCase.cpp
+CppUnitTestSuite.cpp
+ExceptionTestCaseDecoratorTest.cpp
+ExceptionTest.cpp
+HelperMacrosTest.cpp
+MessageTest.cpp
+MockTestCase.cpp
+MockTestListener.cpp
+OrthodoxTest.cpp
+RepeatedTestTest.cpp
+StringToolsTest.cpp
+SubclassedTestCase.cpp
+TestAssertTest.cpp
+TestCallerTest.cpp
+TestCaseTest.cpp
+TestDecoratorTest.cpp
+TestFailureTest.cpp
+TestPathTest.cpp
+TestResultCollectorTest.cpp
+TestResultTest.cpp
+TestSetUpTest.cpp
+TestSuiteTest.cpp
+TestTest.cpp
+TrackedTestCase.cpp
+XmlElementTest.cpp
+XmlOutputterTest.cpp
+XmlUniformiser.cpp
+XmlUniformiserTest.cpp
+)
+
+# Create a common object library
+add_library(cppunit-test-objlib OBJECT ${cppunit-test-objlib_SOURCES})
+
+# Create the test executable
+add_executable(cppunit-test-bin CppUnitTestMain.cpp 
$TARGET_OBJECTS:cppunit-test-objlib)
+target_link_libraries(cppunit-test-bin cppunit)
+if(CPPUNIT_BUILD_TESTING)
+add_test(NAME cppunit-test-bin COMMAND cppunit-test-bin)
+endif()
+
+# Create the test plugin
+add_library(cppunit-test-plugin MODULE CppUnitTestPlugIn.cpp 
$TARGET_OBJECTS:cppunit-test-objlib)
+target_link_libraries(cppunit-test-plugin cppunit)
+
+# Create install target
+install(TARGETS cppunit-test-bin
+DESTINATION share/${CPPUNIT_VERSION}/examples COMPONENT examples)
+
+install(TARGETS cppunit-test-plugin
+ DESTINATION share/${CPPUNIT_VERSION}/examples COMPONENT examples)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Branch 'feature/cmake' - examples/CMakeLists.txt examples/DumperPlugIn

2014-01-11 Thread Bernhard Sessler
 examples/CMakeLists.txt  |1 +
 examples/DumperPlugIn/CMakeLists.txt |   12 
 2 files changed, 13 insertions(+)

New commits:
commit 44ec3e03cba21acfbb44a975533547803c83ea97
Author: Bernhard Sessler bernhard.sess...@corscience.de
Date:   Wed Jan 8 14:49:13 2014 +0100

examples/DumperPlugIn: Build dumper plugin

With this patch the cppunit dumper plugin example will be built
when CPPUNIT_BUILD_EXAMPLES is ON.

Change-Id: If5265461d01eb8b6567784b68e4d047b001d52f4
Signed-off-by: Bernhard Sessler bernhard.sess...@corscience.de
Reviewed-on: https://gerrit.libreoffice.org/7316
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 5bf007b..72fa78c 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,4 +1,5 @@
 add_subdirectory(cppunittest)
+add_subdirectory(DumperPlugIn)
 
 if(CPPUNIT_BUILD_QT_TESTRUNNER)
 add_subdirectory(qt)
diff --git a/examples/DumperPlugIn/CMakeLists.txt 
b/examples/DumperPlugIn/CMakeLists.txt
new file mode 100644
index 000..e104e46
--- /dev/null
+++ b/examples/DumperPlugIn/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Common source files
+set(cppunit-dumper-plugin_SOURCES
+DumperListener.cpp
+DumperPlugIn.cpp
+)
+
+# Create the test plugin
+add_library(cppunit-dumper-plugin MODULE ${cppunit-dumper-plugin_SOURCES})
+target_link_libraries(cppunit-dumper-plugin cppunit)
+
+install(TARGETS cppunit-dumper-plugin
+DESTINATION share/${CPPUNIT_VERSION}/examples COMPONENT examples)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Branch 'feature/cmake' - 2 commits - examples/CMakeLists.txt examples/hierarchy examples/simple

2014-01-11 Thread Bernhard Sessler
 examples/CMakeLists.txt   |2 ++
 examples/hierarchy/CMakeLists.txt |   14 ++
 examples/simple/CMakeLists.txt|   18 ++
 3 files changed, 34 insertions(+)

New commits:
commit 5323c9fd752dad63c72cb45012b1f0fc93a15b7f
Author: Bernhard Sessler bernhard.sess...@corscience.de
Date:   Wed Jan 8 16:14:02 2014 +0100

examples/simple: Build simple example

In case CPPUNIT_BUILD_EXAMPLES is ON, the simple example executable
and plugin are now built.

Change-Id: Ia88a30805a7063de52b7d21b2f712dba9a65344f
Signed-off-by: Bernhard Sessler bernhard.sess...@corscience.de
Reviewed-on: https://gerrit.libreoffice.org/7318
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 4cdd84a..29e91e1 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,5 +1,6 @@
 add_subdirectory(cppunittest)
 add_subdirectory(hierarchy)
+add_subdirectory(simple)
 add_subdirectory(DumperPlugIn)
 
 if(CPPUNIT_BUILD_QT_TESTRUNNER)
diff --git a/examples/simple/CMakeLists.txt b/examples/simple/CMakeLists.txt
new file mode 100644
index 000..22f0508
--- /dev/null
+++ b/examples/simple/CMakeLists.txt
@@ -0,0 +1,18 @@
+set(cppunit-simple_SOURCES
+ExampleTestCase.cpp
+)
+
+# Create the test executable
+add_executable(cppunit-simple-bin Main.cpp ${cppunit-simple_SOURCES})
+target_link_libraries(cppunit-simple-bin cppunit)
+
+# Create the test plugin
+add_library(cppunit-simple-plugin MODULE SimplePlugIn.cpp 
${cppunit-simple_SOURCES})
+target_link_libraries(cppunit-simple-plugin cppunit)
+
+# Create install target
+install(TARGETS cppunit-simple-bin
+DESTINATION share/${CPPUNIT_VERSION}/examples COMPONENT examples)
+
+install(TARGETS cppunit-simple-plugin
+ DESTINATION share/${CPPUNIT_VERSION}/examples COMPONENT examples)
commit 3a04e47dc8571c3d6f69c8b75a9d58f2004dc0c5
Author: Bernhard Sessler bernhard.sess...@corscience.de
Date:   Wed Jan 8 15:56:23 2014 +0100

examples/hierarchy: Build hierarchy example

When CPPUNIT_BUILD_EXAMPLES is ON, the hierarchy example will now be
built with CMake.

Change-Id: I1c706c09dbdd450abadf77536ee7a6157bf36612
Signed-off-by: Bernhard Sessler bernhard.sess...@corscience.de
Reviewed-on: https://gerrit.libreoffice.org/7317
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 72fa78c..4cdd84a 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,4 +1,5 @@
 add_subdirectory(cppunittest)
+add_subdirectory(hierarchy)
 add_subdirectory(DumperPlugIn)
 
 if(CPPUNIT_BUILD_QT_TESTRUNNER)
diff --git a/examples/hierarchy/CMakeLists.txt 
b/examples/hierarchy/CMakeLists.txt
new file mode 100644
index 000..b6fbd44
--- /dev/null
+++ b/examples/hierarchy/CMakeLists.txt
@@ -0,0 +1,14 @@
+# Common source files
+set(cppunit-hierarchy-example-SOURCES
+BoardGame.cpp
+Chess.cpp
+main.cpp
+)
+
+# Create the test executable
+add_executable(cppunit-hierarchy-example ${cppunit-hierarchy-example-SOURCES})
+target_link_libraries(cppunit-hierarchy-example cppunit)
+
+# Create install target
+install(TARGETS cppunit-hierarchy-example
+DESTINATION share/${CPPUNIT_VERSION}/examples COMPONENT examples)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Branch 'feature/cmake' - doc/CMakeLists.txt

2014-01-11 Thread Bernhard Sessler
 doc/CMakeLists.txt |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit c51632874022063b5fdf1cd7557dc4bf2b7f727d
Author: Bernhard Sessler bernhard.sess...@corscience.de
Date:   Wed Jan 8 15:42:07 2014 +0100

doc: Fix installation path for API documentation

The documentation is now installed to
prefix/share/cppunit-version/doc when CPPUNIT_INSTALL_APIDOC
is ON.

Change-Id: If6d07763d0e2aedf67c2792a15757f8f59761ffa
Signed-off-by: Bernhard Sessler bernhard.sess...@corscience.de
Reviewed-on: https://gerrit.libreoffice.org/7313
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 08864b8..bb73a31 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -36,5 +36,6 @@ add_custom_target(apidoc ${_cppunit_apidoc_all}
 COMMENT Generating HTML documentation)
 
 if(CPPUNIT_INSTALL_APIDOC)
-install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cppunit DESTINATION 
share/doc)
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cppunit/
+DESTINATION share/${CPPUNIT_VERSION}/doc COMPONENT doc)
 endif()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Branch 'feature/cmake' - examples/qt

2014-01-11 Thread Bernhard Sessler
 examples/qt/CMakeLists.txt |   13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

New commits:
commit 721a1ad7c779786a5a867a2ec24c23917c57ba05
Author: Bernhard Sessler bernhard.sess...@corscience.de
Date:   Wed Jan 8 15:37:51 2014 +0100

examples/qt: Rename executable and fix install path

To get a better structure into the generated libraries and
executables, the qt_example target is renamed to cppunit-qt-example
and will be installed to prefix/share/cppunit-version/examples

Change-Id: I818c33ec2b4de02e1745af51a9c00fb8357cb5ed
Signed-off-by: Bernhard Sessler bernhard.sess...@corscience.de
Reviewed-on: https://gerrit.libreoffice.org/7312
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/examples/qt/CMakeLists.txt b/examples/qt/CMakeLists.txt
index ea9d142..573465a 100644
--- a/examples/qt/CMakeLists.txt
+++ b/examples/qt/CMakeLists.txt
@@ -2,20 +2,19 @@
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
 # Common source files
-set(qt_example_SOURCES
+set(cppunit-qt-example_SOURCES
 ExampleTestCases.cpp
 Main.cpp
 )
 
 # Create the test runner executable
-add_executable(qt_example ${qt_example_SOURCES})
-target_link_libraries(qt_example cppunit-qttestrunner)
+add_executable(cppunit-qt-example ${cppunit-qt-example_SOURCES})
+target_link_libraries(cppunit-qt-example cppunit-qttestrunner)
 
 if(Qt5_POSITION_INDEPENDENT_CODE)
-set_target_properties(qt_example PROPERTIES POSITION_INDEPENDENT_CODE ON)
+set_target_properties(cppunit-qt-example PROPERTIES 
POSITION_INDEPENDENT_CODE ON)
 endif()
 
 # Create install target
-install(TARGETS qt_example
-RUNTIME DESTINATION bin
-COMPONENT examples)
+install(TARGETS cppunit-qt-example
+DESTINATION share/${CPPUNIT_VERSION}/examples COMPONENT examples)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Branch 'feature/cmake' - CMakeLists.txt examples/CMakeLists.txt examples/qt

2014-01-06 Thread Bernhard Sessler
 CMakeLists.txt |5 +
 examples/CMakeLists.txt|3 +++
 examples/qt/CMakeLists.txt |   21 +
 3 files changed, 29 insertions(+)

New commits:
commit 9d8fffbf39ece34d1d4fb315beac1f8967a12bbe
Author: Bernhard Sessler bernh...@burnsen.de
Date:   Sun Dec 22 15:22:28 2013 +0100

examples: Add Qt test runner example to CMake build system

The new CMake build option 'CPPUNIT_BUILD_EXAMPLES' (OFF by default)
decides whether to build the example programs or not.

Change-Id: I6694f224bcf9c0c5131c9a1810c6565ad91626b7
Signed-off-by: Bernhard Sessler bernh...@burnsen.de
Reviewed-on: https://gerrit.libreoffice.org/7185
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0427289..3e6c407 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,6 +18,7 @@ include(Versioning)
 option(BUILD_SHARED_LIBS   Build cppunit as shared or static library 
   ON)
 option(CPPUNIT_BUILD_APIDOCAdds a build target for generating the API 
documentation OFF)
 option(CPPUNIT_BUILD_QT_TESTRUNNER Build the Qt test runner library  
   OFF)
+option(CPPUNIT_BUILD_EXAMPLES  Build the examples shipped with cppunit   
   OFF)
 
 if(BUILD_SHARED_LIBS AND WIN32)
 add_definitions(-DCPPUNIT_BUILD_DLL)
@@ -35,6 +36,10 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
 add_subdirectory(include)
 add_subdirectory(src)
 
+if(CPPUNIT_BUILD_EXAMPLES)
+add_subdirectory(examples)
+endif()
+
 if(CPPUNIT_BUILD_APIDOC)
 add_subdirectory(doc)
 endif()
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
new file mode 100644
index 000..0c26262
--- /dev/null
+++ b/examples/CMakeLists.txt
@@ -0,0 +1,3 @@
+if(CPPUNIT_BUILD_QT_TESTRUNNER)
+add_subdirectory(qt)
+endif()
diff --git a/examples/qt/CMakeLists.txt b/examples/qt/CMakeLists.txt
new file mode 100644
index 000..ea9d142
--- /dev/null
+++ b/examples/qt/CMakeLists.txt
@@ -0,0 +1,21 @@
+# Include the current binary dir, so files produced by moc can be found
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+
+# Common source files
+set(qt_example_SOURCES
+ExampleTestCases.cpp
+Main.cpp
+)
+
+# Create the test runner executable
+add_executable(qt_example ${qt_example_SOURCES})
+target_link_libraries(qt_example cppunit-qttestrunner)
+
+if(Qt5_POSITION_INDEPENDENT_CODE)
+set_target_properties(qt_example PROPERTIES POSITION_INDEPENDENT_CODE ON)
+endif()
+
+# Create install target
+install(TARGETS qt_example
+RUNTIME DESTINATION bin
+COMPONENT examples)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Branch 'feature/cmake' - 2 commits - CMakeLists.txt cmake/SelectQtVersion.cmake examples/qt include/CMakeLists.txt src/CMakeLists.txt src/qttestrunner

2014-01-06 Thread Bernhard Sessler
 CMakeLists.txt   |   12 +-
 cmake/SelectQtVersion.cmake  |   43 +
 examples/qt/ExampleTestCases.cpp |   48 +--
 examples/qt/ExampleTestCases.h   |   32 --
 examples/qt/Main.cpp |   18 --
 examples/qt/qt_example.pro   |   67 +++
 include/CMakeLists.txt   |   12 ++
 src/CMakeLists.txt   |4 ++
 src/qttestrunner/CMakeLists.txt  |   43 +
 9 files changed, 175 insertions(+), 104 deletions(-)

New commits:
commit f9374cf4589f8128be6962238bbcaff4e16720cb
Author: Bernhard Sessler bernh...@burnsen.de
Date:   Sun Dec 22 15:16:50 2013 +0100

src/qttestrunner: Add CMake build system

This will allow building the qt test runner by using the CMake build
system. The new CMake option 'CPPUNIT_BUILD_QT_TESTRUNNER' (OFF by
default) can be used to build the test runner (switch these options
ON and OFF by running the CMake built-in 'edit_cache' build target,
e.g. using Linux / GNU make this would be 'make edit_cache', NMake
based build systems would run 'nmake edit_cache').

Change-Id: Ifead1e2cd9162c74b8a212daf93f4bbad9f6c1f3
Signed-off-by: Bernhard Sessler bernh...@burnsen.de
Reviewed-on: https://gerrit.libreoffice.org/7184
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 97baafe..0427289 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,9 @@ cmake_minimum_required(VERSION 2.8.7)
 
 # Add project specific CMake module path
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
 
 # Perform platform and compiler feature checks
 include(PlatformChecks)
@@ -12,13 +15,18 @@ include(PlatformChecks)
 include(Versioning)
 
 # Build options
-option(BUILD_SHARED_LIBSBuild cppunit as shared or static library
ON)
-option(CPPUNIT_BUILD_APIDOC Adds a build target for generating the API 
documentation OFF)
+option(BUILD_SHARED_LIBS   Build cppunit as shared or static library 
   ON)
+option(CPPUNIT_BUILD_APIDOCAdds a build target for generating the API 
documentation OFF)
+option(CPPUNIT_BUILD_QT_TESTRUNNER Build the Qt test runner library  
   OFF)
 
 if(BUILD_SHARED_LIBS AND WIN32)
 add_definitions(-DCPPUNIT_BUILD_DLL)
 endif()
 
+if(CPPUNIT_BUILD_QT_TESTRUNNER)
+include(SelectQtVersion)
+endif()
+
 # Include paths
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
 include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
diff --git a/cmake/SelectQtVersion.cmake b/cmake/SelectQtVersion.cmake
new file mode 100644
index 000..4cfb4d5
--- /dev/null
+++ b/cmake/SelectQtVersion.cmake
@@ -0,0 +1,43 @@
+##
+# Projectname - Redmine:Administration
+# Author  - Bernhard Sessler bernhard.sess...@corscience.de
+# Description - Depending on the variable WITH_QT5 search either for Qt5 or 
Qt4 libs
+#
+# (c) 2013, Corscience GmbH  Co. KG
+##
+
+if(NOT WITH_QT)
+set(WITH_QT 5)
+endif()
+
+# Find Qt5
+if(WITH_QT EQUAL 5)
+set(QT5_REQUIRED_MODULES Widgets)
+
+find_package(Qt5 REQUIRED COMPONENTS ${QT5_REQUIRED_MODULES})
+
+foreach(_submodule ${QT5_REQUIRED_MODULES})
+   include_directories(${Qt5${_submodule}_INCLUDE_DIRS})
+   list(APPEND QT_LIBRARIES ${Qt5${_submodule}_LIBRARIES})
+endforeach()
+
+set(QT_LIBRARIES_FOUND ${Qt5Widgets_FOUND})
+
+# Find Qt4
+elseif(WITH_QT EQUAL 4)
+set(QT4_REQUIRED_MODULES QtCore QtGui)
+
+find_package(Qt4 REQUIRED COMPONENTS ${QT4_REQUIRED_MODULES})
+include(${QT_USE_FILE})
+
+foreach(_submodule ${QT4_REQUIRED_MODULES})
+   string(TOUPPER _submodule _var)
+   list(APPEND QT_LIBRARIES ${QT_${_var}_LIBRARY})
+endforeach()
+
+set(QT_LIBRARIES_FOUND ${QT_QTGUI_FOUND})
+
+# Unsupported version
+else()
+message(SEND_ERROR Unsupported Qt version specified. Set WITH_QT to 
either 4 or 5)
+endif()
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 142eeda..4e30800 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -2,4 +2,14 @@
 configure_file(config-auto.h.in 
${CMAKE_CURRENT_BINARY_DIR}/cppunit/config-auto.h)
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cppunit/config-auto.h DESTINATION 
include/cppunit)
 
-install(DIRECTORY cppunit DESTINATION include FILES_MATCHING PATTERN *.h)
+install(DIRECTORY cppunit
+DESTINATION include
+FILES_MATCHING  PATTERN *.h
+PATTERN ui/qt EXCLUDE
+PATTERN ui/mfc EXCLUDE)
+
+if(CPPUNIT_BUILD_QT_TESTRUNNER)
+install(DIRECTORY cppunit/ui/qt
+DESTINATION include/cppunit/ui

[Libreoffice-commits] cppunit.git: Branch 'feature/cmake' - cmake/CheckCXXSourcefileCompiles.cmake cmake/CheckCXXTypeExists.cmake cmake/CheckCXXTypeExists.cpp.in cmake/have_casts.cpp cmake/have_namesp

2013-12-17 Thread Bernhard Sessler
 CMakeLists.txt |   27 ++
 cmake/CheckCXXSourcefileCompiles.cmake |   80 
 cmake/CheckCXXTypeExists.cmake |   32 
 cmake/CheckCXXTypeExists.cpp.in|6 +
 cmake/PlatformChecks.cmake |  120 ++
 cmake/Versioning.cmake |   29 +++
 cmake/have_casts.cpp   |6 +
 cmake/have_namespaces.cpp  |   13 +++
 cmake/have_rtti.cpp|9 ++
 cmake/string_compare_signature.cpp |   11 ++
 include/CMakeLists.txt |5 +
 include/config-auto.h.in   |  128 +
 include/cppunit/TestAssert.h   |2 
 src/CMakeLists.txt |1 
 src/cppunit/CMakeLists.txt |   86 ++
 15 files changed, 554 insertions(+), 1 deletion(-)

New commits:
commit 5bccf02b2c4fd4fc3366d600f0eadbaa9f1d0b47
Author: Bernhard Sessler bernhard.sess...@corscience.de
Date:   Fri Nov 29 08:44:04 2013 +0100

Add CMake build system for cppunit library

Change-Id: I2a4b0c1469509a7239b425ca133efd0d979f1d82
Signed-off-by: Bernhard Sessler bernhard.sess...@corscience.de
Reviewed-on: https://gerrit.libreoffice.org/7111
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 000..7b386ce
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,27 @@
+# Project setup
+project(cppunit C CXX)
+cmake_minimum_required(VERSION 2.8.7)
+
+# Add project specific CMake module path
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+
+# Perform platform and compiler feature checks
+include(PlatformChecks)
+
+# Versioning
+include(Versioning)
+
+# Build options
+option(BUILD_SHARED_LIBS Build cppunit as shared or static library ON)
+
+if(BUILD_SHARED_LIBS)
+add_definitions(-DCPPUNIT_BUILD_DLL)
+endif()
+
+# Include paths
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
+include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
+
+# Subdirectories
+add_subdirectory(include)
+add_subdirectory(src)
diff --git a/cmake/CheckCXXSourcefileCompiles.cmake 
b/cmake/CheckCXXSourcefileCompiles.cmake
new file mode 100644
index 000..254c1f3
--- /dev/null
+++ b/cmake/CheckCXXSourcefileCompiles.cmake
@@ -0,0 +1,80 @@
+# - Check if given C++ source in the specified file compiles and links into an 
executable
+# CHECK_CXX_SOURCEFILE_COMPILES(file var [FAIL_REGEX fail-regex])
+#  file   - source file to try to compile, must define 'main'
+#  var- variable to store whether the source code compiled
+#  fail-regex - fail if test output matches this regex
+# The following variables may be set before calling this macro to
+# modify the way the check is run:
+#
+#  CMAKE_REQUIRED_FLAGS = string of compile command line flags
+#  CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+#  CMAKE_REQUIRED_INCLUDES = list of include directories
+#  CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+
+macro(CHECK_CXX_SOURCEFILE_COMPILES SOURCEFILE VAR)
+  if(${VAR} MATCHES ^${VAR}$)
+set(_FAIL_REGEX)
+set(_key)
+foreach(arg ${ARGN})
+  if(${arg} MATCHES ^(FAIL_REGEX)$)
+set(_key ${arg})
+  elseif(_key)
+list(APPEND _${_key} ${arg})
+  else()
+message(FATAL_ERROR Unknown argument:\n  ${arg}\n)
+  endif()
+endforeach()
+
+if(NOT EXISTS ${SOURCEFILE})
+message(FATAL_ERROR Could not find file ${SOURCEFILE})
+endif()
+
+set(MACRO_CHECK_FUNCTION_DEFINITIONS
+  -D${VAR} ${CMAKE_REQUIRED_FLAGS})
+if(CMAKE_REQUIRED_LIBRARIES)
+  set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
+LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
+else()
+  set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
+endif()
+if(CMAKE_REQUIRED_INCLUDES)
+  set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
+-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES})
+else()
+  set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
+endif()
+
+message(STATUS Performing Test ${VAR})
+try_compile(${VAR}
+  ${CMAKE_CURRENT_BINARY_DIR}
+  ${SOURCEFILE}
+  COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+  ${CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES}
+  CMAKE_FLAGS 
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
+  ${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}
+  OUTPUT_VARIABLE OUTPUT)
+
+foreach(_regex ${_FAIL_REGEX})
+  if(${OUTPUT} MATCHES ${_regex})
+set(${VAR} 0)
+  endif()
+endforeach()
+
+if(${VAR})
+  set(${VAR} 1 CACHE INTERNAL Test ${VAR})
+  message(STATUS Performing Test ${VAR} - Success)
+  file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+Performing C++ SOURCE FILE Test ${VAR} succeded with the following 
output:\n

[Libreoffice-commits] cppunit.git: Branch 'feature/cmake' - cmake/ExportTargets.cmake CMakeLists.txt cppunitConfig.cmake.in cppunitConfigVersion.cmake.in src/cppunit

2013-12-17 Thread Bernhard Sessler
 CMakeLists.txt|5 -
 cmake/ExportTargets.cmake |   21 +
 cppunitConfig.cmake.in|   27 +++
 cppunitConfigVersion.cmake.in |   10 ++
 src/cppunit/CMakeLists.txt|1 +
 5 files changed, 63 insertions(+), 1 deletion(-)

New commits:
commit 0c417c4a933ec390da1f315079abbfacd2be3806
Author: Bernhard Sessler bernhard.sess...@corscience.de
Date:   Wed Dec 4 12:45:19 2013 +0100

cmake: Use target export feature

This eliminates the need for a Findcppunit.cmake script in projects
needing the cppunit library. The project configuration files are
installed along with the library itself and provide information about
where to find the library and how to use it.
A prominent example of this method are the Qt5 libraries, which are
shipping CMake project configuration files by default.

Change-Id: I9db4f07d4a56361215eb68d9080955fede8eb205
Signed-off-by: Bernhard Sessler bernhard.sess...@corscience.de
Reviewed-on: https://gerrit.libreoffice.org/7112
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7b386ce..a43fe1b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,7 +14,7 @@ include(Versioning)
 # Build options
 option(BUILD_SHARED_LIBS Build cppunit as shared or static library ON)
 
-if(BUILD_SHARED_LIBS)
+if(BUILD_SHARED_LIBS AND WIN32)
 add_definitions(-DCPPUNIT_BUILD_DLL)
 endif()
 
@@ -25,3 +25,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
 # Subdirectories
 add_subdirectory(include)
 add_subdirectory(src)
+
+# Export targets
+include(ExportTargets)
diff --git a/cmake/ExportTargets.cmake b/cmake/ExportTargets.cmake
new file mode 100644
index 000..4affeb4
--- /dev/null
+++ b/cmake/ExportTargets.cmake
@@ -0,0 +1,21 @@
+# Export targets
+if(WIN32 AND NOT CYGWIN)
+set(INSTALL_CMAKE_DIR CMake)
+else()
+set(INSTALL_CMAKE_DIR lib/cmake/cppunit)
+endif()
+
+file(RELATIVE_PATH CONF_REL_INCLUDE_DIR
+${CMAKE_INSTALL_PREFIX}/${INSTALL_CMAKE_DIR}
+${CMAKE_INSTALL_PREFIX}/include)
+configure_file(cppunitConfig.cmake.in
+${PROJECT_BINARY_DIR}/cppunitConfig.cmake @ONLY)
+configure_file(cppunitConfigVersion.cmake.in
+${PROJECT_BINARY_DIR}/cppunitConfigVersion.cmake @ONLY)
+
+install(FILES
+${PROJECT_BINARY_DIR}/cppunitConfig.cmake
+${PROJECT_BINARY_DIR}/cppunitConfigVersion.cmake
+DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT dev)
+
+install(EXPORT cppunitLibraryDepends DESTINATION ${INSTALL_CMAKE_DIR})
diff --git a/cppunitConfig.cmake.in b/cppunitConfig.cmake.in
new file mode 100644
index 000..a83550a
--- /dev/null
+++ b/cppunitConfig.cmake.in
@@ -0,0 +1,27 @@
+# - CMake config file for cppunit
+# It defines the following variables
+#  CPPUNIT_INCLUDE_DIRS - include directories for cppunit
+#  CPPUNIT_LIBRARY  - the cppunit base library
+#  CPPUNIT_LIBRARIES- all of the cppunit libraries to link against
+#  CPPUNIT_FOUND- the cppunit library has been found
+
+if(NOT TARGET cppunit AND NOT cppunit_BINARY_DIR)
+# Compute paths
+get_filename_component(CPPUNIT_CMAKE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
+get_filename_component(CPPUNIT_INCLUDE_DIR
+${CPPUNIT_CMAKE_DIR}/@CONF_REL_INCLUDE_DIR@
+ABSOLUTE)
+
+# Add the targets and dependencies
+include(${CPPUNIT_CMAKE_DIR}/cppunitLibraryDepends.cmake)
+
+get_target_property(_cppunit_lib_type cppunit TYPE)
+if(${_cppunit_lib_type} EQUAL SHARED_LIBRARY AND WIN32)
+add_definitions(-DCPPUNIT_DLL)
+endif()
+
+set(CPPUNIT_FOUND TRUE)
+set(CPPUNIT_LIBRARY cppunit)
+set(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY})
+message(STATUS Found cppunit - version: @CPPUNIT_VERSION@)
+endif()
diff --git a/cppunitConfigVersion.cmake.in b/cppunitConfigVersion.cmake.in
new file mode 100644
index 000..eb9fb87
--- /dev/null
+++ b/cppunitConfigVersion.cmake.in
@@ -0,0 +1,10 @@
+set(PACKAGE_VERSION @CPPUNIT_VERSION@)
+
+if(${PACKAGE_VERSION} VERSION_LESS ${PACKAGE_FIND_VERSION})
+set(PACKAGE_VERSION_COMPATIBLE FALSE)
+else()
+set(PACKAGE_VERSION_COMPATIBLE TRUE)
+if(${PACKAGE_VERSION} VERSION_EQUAL ${PACKAGE_FIND_VERSION})
+set(PACKAGE_VERSION_EXACT TRUE)
+endif()
+endif()
diff --git a/src/cppunit/CMakeLists.txt b/src/cppunit/CMakeLists.txt
index 27a1e18..6dbb6dd 100644
--- a/src/cppunit/CMakeLists.txt
+++ b/src/cppunit/CMakeLists.txt
@@ -81,6 +81,7 @@ endif()
 
 # Create install target
 install(TARGETS cppunit
+EXPORT cppunitLibraryDepends
 LIBRARY DESTINATION lib
 ARCHIVE DESTINATION lib
 RUNTIME DESTINATION bin)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] cppunit.git: Branch 'feature/cmake' - 2 commits - cmake/have_default_template_args.cpp CMakeLists.txt cmake/PlatformChecks.cmake doc/CMakeLists.txt doc/Doxyfile.in include/config

2013-12-17 Thread Bernhard Sessler
 CMakeLists.txt|7 
 cmake/PlatformChecks.cmake|6 
 cmake/have_default_template_args.cpp  |   16 
 doc/CMakeLists.txt|   40 ++
 doc/Doxyfile.in   |  558 +-
 include/config-auto.h.in  |3 
 include/cppunit/Portability.h |   22 -
 include/cppunit/config/config-bcb5.h  |   47 --
 include/cppunit/config/config-evc4.h  |   57 ---
 include/cppunit/config/config-msvc6.h |   64 ---
 10 files changed, 362 insertions(+), 458 deletions(-)

New commits:
commit 8a91ac7749d7d2bb4e9b5790dc7474d82f88bee2
Author: Bernhard Sessler bernhard.sess...@corscience.de
Date:   Wed Dec 4 16:37:58 2013 +0100

doc: Add support for generating the API documentation

Change-Id: I06db2d8a32f32c28047c7cf883f945d9bb7eb779
Signed-off-by: Bernhard Sessler bernhard.sess...@corscience.de
Reviewed-on: https://gerrit.libreoffice.org/7114
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a43fe1b..97baafe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,8 @@ include(PlatformChecks)
 include(Versioning)
 
 # Build options
-option(BUILD_SHARED_LIBS Build cppunit as shared or static library ON)
+option(BUILD_SHARED_LIBSBuild cppunit as shared or static library
ON)
+option(CPPUNIT_BUILD_APIDOC Adds a build target for generating the API 
documentation OFF)
 
 if(BUILD_SHARED_LIBS AND WIN32)
 add_definitions(-DCPPUNIT_BUILD_DLL)
@@ -26,5 +27,9 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
 add_subdirectory(include)
 add_subdirectory(src)
 
+if(CPPUNIT_BUILD_APIDOC)
+add_subdirectory(doc)
+endif()
+
 # Export targets
 include(ExportTargets)
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644
index 000..08864b8
--- /dev/null
+++ b/doc/CMakeLists.txt
@@ -0,0 +1,40 @@
+# Find required executables
+find_package(LATEX)
+find_package(Doxygen REQUIRED)
+
+# Add build options
+option(CPPUNIT_BUILD_APIDOC_ALWAYS Always builds the documentation when 
buildingOFF)
+option(CPPUNIT_INSTALL_APIDOC  Installs the doxygen-generated 
documentation OFF)
+if(LATEX_COMPILER)
+option(CPPUNIT_BUILD_APIDOC_LATEX Generate LaTex API documentation   
   OFF)
+endif()
+
+if(CPPUNIT_BUILD_APIDOC_LATEX)
+set(_CPPUNIT_GENERATE_LATEX YES CACHE INTERNAL Variable for Doxyfile)
+else()
+set(_CPPUNIT_GENERATE_LATEX NO CACHE INTERNAL Variable for Doxyfile)
+endif()
+
+if(DOXYGEN_DOT_FOUND)
+set(_CPPUNIT_USE_DOT YES CACHE INTERNAL Variable for using the Graphviz 
dot tool)
+else()
+set(_CPPUNIT_USE_DOT NO CACHE INTERNAL Variable for using the Graphviz 
dot tool)
+endif()
+
+# Setup config files
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
+   ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
+
+if(CPPUNIT_BUILD_APIDOC_ALWAYS)
+set(_cppunit_apidoc_all ALL)
+endif()
+
+add_custom_target(apidoc ${_cppunit_apidoc_all}
+COMMAND ${DOXYGEN_EXECUTABLE}
+${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
+WORKING_DIRECTORY   ${cppunit_SOURCE_DIR}
+COMMENT Generating HTML documentation)
+
+if(CPPUNIT_INSTALL_APIDOC)
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cppunit DESTINATION 
share/doc)
+endif()
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
index 4398a64..f33e683 100644
--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -11,201 +11,201 @@
 # General configuration options
 #---
 
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
-# by quotes) that should identify the project. 
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
 
 PROJECT_NAME  = CppUnit
 
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
-# This could be handy for archiving the generated documentation or 
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
 # if some version control system is used.
 
-PROJECT_NUMBER= Version @VERSION@
+PROJECT_NUMBER= Version @CPPUNIT_VERSION@
 
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
-# base path where the generated documentation will be put. 
-# If a relative path is entered, it will be relative to the location 
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
 # where doxygen was started. If left blank the current directory will be used.
 
-OUTPUT_DIRECTORY  = .
+OUTPUT_DIRECTORY  = @CMAKE_CURRENT_BINARY_DIR

[Libreoffice-commits] cppunit.git: Branch 'feature/cmake' - cmake/PlatformChecks.cmake include/config-auto.h.in src/cppunit

2013-12-17 Thread Bernhard Sessler
 cmake/PlatformChecks.cmake|2 ++
 include/config-auto.h.in  |3 +++
 src/cppunit/PlugInManager.cpp |   15 ++-
 3 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit f8cd3430163bde5e8ade2a2245437710b2ec048d
Author: Bernhard Sessler bernhard.sess...@corscience.de
Date:   Thu Dec 12 10:17:31 2013 +0100

src: Fix build with Borland C++ compiler

Change-Id: I0a182186c396f2e45bec76c83506f765f2462b3c
Signed-off-by: Bernhard Sessler bernhard.sess...@corscience.de
Reviewed-on: https://gerrit.libreoffice.org/7115
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/cmake/PlatformChecks.cmake b/cmake/PlatformChecks.cmake
index 5d20bfe..d446586 100644
--- a/cmake/PlatformChecks.cmake
+++ b/cmake/PlatformChecks.cmake
@@ -121,6 +121,8 @@ if(CPPUNIT_HAVE_TYPEINFO)
   CPPUNIT_HAVE_RTTI)
 endif()
 
+set(CPPUNIT_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P} CACHE INTERNAL Size of a 
void pointer)
+
 if(_unsupported_compiler)
 message(FATAL_ERROR Your compiler does not support all features required 
to build cppunit!)
 endif()
diff --git a/include/config-auto.h.in b/include/config-auto.h.in
index 7d7c0ae..1f877ee 100644
--- a/include/config-auto.h.in
+++ b/include/config-auto.h.in
@@ -87,6 +87,9 @@
 /* Define if you have the unistd.h header file. */
 #cmakedefine CPPUNIT_HAVE_UNISTD_H 1
 
+/* The size of a void pointer */
+#cmakedefine CPPUNIT_SIZEOF_VOID_P @CPPUNIT_SIZEOF_VOID_P@
+
 /* Name of package */
 #cmakedefine CPPUNIT_PACKAGE @CPPUNIT_PACKAGE@
 
diff --git a/src/cppunit/PlugInManager.cpp b/src/cppunit/PlugInManager.cpp
index 4f8b371..aec7713 100644
--- a/src/cppunit/PlugInManager.cpp
+++ b/src/cppunit/PlugInManager.cpp
@@ -1,6 +1,10 @@
 #include cppunit/config/SourcePrefix.h
 #include cppunit/XmlOutputterHook.h
-#include stdint.h
+#include cppunit/config-auto.h
+
+#ifdef CPPUNIT_HAVE_STDINT_H
+#include stdint.h
+#endif
 
 #if !defined(CPPUNIT_NO_TESTPLUGIN)
 #include cppunit/extensions/TestFactoryRegistry.h
@@ -8,6 +12,15 @@
 #include cppunit/plugin/TestPlugIn.h
 #include cppunit/plugin/DynamicLibraryManager.h
 
+#if !defined(CPPUNIT_HAVE_STDINT_H)
+#   if (CPPUNIT_SIZEOF_VOID_P == 4)
+typedef unsigned long int uintptr_t;
+#   elif (CPPUNIT_SIZEOF_VOID_P == 8)
+typedef unsigned long long uintptr_t;
+#   else
+#   error Unsupported compiler
+#   endif
+#endif
 
 CPPUNIT_NS_BEGIN
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[PATCH 2/5] cmake: Use target export feature

2013-12-16 Thread Bernhard Sessler
This eliminates the need for a Findcppunit.cmake script in projects
needing the cppunit library. The project configuration files are
installed along with the library itself and provide information about
where to find the library and how to use it.
A prominent example of this method are the Qt5 libraries, which are
shipping CMake project configuration files by default.

Signed-off-by: Bernhard Sessler bernhard.sess...@corscience.de
---
 CMakeLists.txt|  5 -
 cmake/ExportTargets.cmake | 40 +
 cppunitConfig.cmake.in| 46 +++
 cppunitConfigVersion.cmake.in | 29 +++
 src/cppunit/CMakeLists.txt|  1 +
 5 files changed, 120 insertions(+), 1 deletion(-)
 create mode 100644 cmake/ExportTargets.cmake
 create mode 100644 cppunitConfig.cmake.in
 create mode 100644 cppunitConfigVersion.cmake.in

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c61228f..3b011b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,7 +32,7 @@ include(Versioning)
 # Build options
 option(BUILD_SHARED_LIBS Build cppunit as shared or static library ON)
 
-if(BUILD_SHARED_LIBS)
+if(BUILD_SHARED_LIBS AND WIN32)
 add_definitions(-DCPPUNIT_BUILD_DLL)
 endif()
 
@@ -43,3 +43,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
 # Subdirectories
 add_subdirectory(include)
 add_subdirectory(src)
+
+# Export targets
+include(ExportTargets)
diff --git a/cmake/ExportTargets.cmake b/cmake/ExportTargets.cmake
new file mode 100644
index 000..7282aab
--- /dev/null
+++ b/cmake/ExportTargets.cmake
@@ -0,0 +1,40 @@
+#=
+# CppUnit - The C++ Unit Test Library
+# Copyright (c) 2013 - The Document Foundation
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#=
+
+# Export targets
+if(WIN32 AND NOT CYGWIN)
+set(INSTALL_CMAKE_DIR CMake)
+else()
+set(INSTALL_CMAKE_DIR lib/cmake/cppunit)
+endif()
+
+file(RELATIVE_PATH CONF_REL_INCLUDE_DIR
+${CMAKE_INSTALL_PREFIX}/${INSTALL_CMAKE_DIR}
+${CMAKE_INSTALL_PREFIX}/include)
+configure_file(cppunitConfig.cmake.in
+${PROJECT_BINARY_DIR}/cppunitConfig.cmake @ONLY)
+configure_file(cppunitConfigVersion.cmake.in
+${PROJECT_BINARY_DIR}/cppunitConfigVersion.cmake @ONLY)
+
+install(FILES
+${PROJECT_BINARY_DIR}/cppunitConfig.cmake
+${PROJECT_BINARY_DIR}/cppunitConfigVersion.cmake
+DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT dev)
+
+install(EXPORT cppunitLibraryDepends DESTINATION ${INSTALL_CMAKE_DIR})
diff --git a/cppunitConfig.cmake.in b/cppunitConfig.cmake.in
new file mode 100644
index 000..23e7cae
--- /dev/null
+++ b/cppunitConfig.cmake.in
@@ -0,0 +1,46 @@
+#=
+# CppUnit - The C++ Unit Test Library
+# Copyright (c) 2013 - The Document Foundation
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#=
+#
+# - CMake config file for cppunit
+# It defines the following variables
+#  CPPUNIT_INCLUDE_DIRS - include directories for cppunit
+#  CPPUNIT_LIBRARY  - the cppunit base library
+#  CPPUNIT_LIBRARIES- all of the cppunit libraries to link against
+#  CPPUNIT_FOUND- the cppunit library has been found
+
+if(NOT TARGET cppunit AND NOT cppunit_BINARY_DIR)
+# Compute paths
+get_filename_component(CPPUNIT_CMAKE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH

[PATCH 4/5] doc: Add support for generating the API documentation

2013-12-16 Thread Bernhard Sessler
Signed-off-by: Bernhard Sessler bernhard.sess...@corscience.de
---
 CMakeLists.txt |   7 +-
 doc/CMakeLists.txt |  59 ++
 doc/Doxyfile.in| 558 +++--
 3 files changed, 346 insertions(+), 278 deletions(-)
 create mode 100644 doc/CMakeLists.txt

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3b011b4..b6b40a6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,7 +30,8 @@ include(PlatformChecks)
 include(Versioning)
 
 # Build options
-option(BUILD_SHARED_LIBS Build cppunit as shared or static library ON)
+option(BUILD_SHARED_LIBSBuild cppunit as shared or static library
ON)
+option(CPPUNIT_BUILD_APIDOC Adds a build target for generating the API 
documentation OFF)
 
 if(BUILD_SHARED_LIBS AND WIN32)
 add_definitions(-DCPPUNIT_BUILD_DLL)
@@ -44,5 +45,9 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
 add_subdirectory(include)
 add_subdirectory(src)
 
+if(CPPUNIT_BUILD_APIDOC)
+add_subdirectory(doc)
+endif()
+
 # Export targets
 include(ExportTargets)
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644
index 000..238716b
--- /dev/null
+++ b/doc/CMakeLists.txt
@@ -0,0 +1,59 @@
+#=
+# CppUnit - The C++ Unit Test Library
+# Copyright (c) 2013 - The Document Foundation
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#=
+
+# doxygen targets
+find_package(LATEX)
+find_package(Doxygen REQUIRED)
+
+# Add build options
+option(CPPUNIT_BUILD_APIDOC_ALWAYS Always builds the documentation when 
buildingOFF)
+option(CPPUNIT_INSTALL_APIDOC  Installs the doxygen-generated 
documentation OFF)
+if(LATEX_COMPILER)
+option(CPPUNIT_BUILD_APIDOC_LATEX Generate LaTex API documentation   
   OFF)
+endif()
+
+if(CPPUNIT_BUILD_APIDOC_LATEX)
+set(_CPPUNIT_GENERATE_LATEX YES CACHE INTERNAL Variable for Doxyfile)
+else()
+set(_CPPUNIT_GENERATE_LATEX NO CACHE INTERNAL Variable for Doxyfile)
+endif()
+
+if(DOXYGEN_DOT_FOUND)
+set(_CPPUNIT_USE_DOT YES CACHE INTERNAL Variable for using the Graphviz 
dot tool)
+else()
+set(_CPPUNIT_USE_DOT NO CACHE INTERNAL Variable for using the Graphviz 
dot tool)
+endif()
+
+# Setup config files
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
+   ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
+
+if(CPPUNIT_BUILD_APIDOC_ALWAYS)
+set(_cppunit_apidoc_all ALL)
+endif()
+
+add_custom_target(apidoc ${_cppunit_apidoc_all}
+COMMAND ${DOXYGEN_EXECUTABLE}
+${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
+WORKING_DIRECTORY   ${cppunit_SOURCE_DIR}
+COMMENT Generating HTML documentation)
+
+if(CPPUNIT_INSTALL_APIDOC)
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cppunit DESTINATION 
share/doc)
+endif()
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
index 4398a64..f33e683 100644
--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -11,201 +11,201 @@
 # General configuration options
 #---
 
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
-# by quotes) that should identify the project. 
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
 
 PROJECT_NAME  = CppUnit
 
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
-# This could be handy for archiving the generated documentation or 
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
 # if some version control system is used.
 
-PROJECT_NUMBER= Version @VERSION@
+PROJECT_NUMBER= Version @CPPUNIT_VERSION@
 
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
-# base path where the generated documentation will be put. 
-# If a relative path is entered, it will be relative to the location 
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered

[PATCH 1/5] Add CMake build system for cppunit library

2013-12-16 Thread Bernhard Sessler
Signed-off-by: Bernhard Sessler bernhard.sess...@corscience.de
---
 CMakeLists.txt |  45 ++
 cmake/CheckCXXSourcefileCompiles.cmake |  99 ++
 cmake/CheckCXXTypeExists.cmake |  35 
 cmake/CheckCXXTypeExists.cpp.in|   6 ++
 cmake/PlatformChecks.cmake | 139 +++
 cmake/Versioning.cmake |  47 +++
 cmake/have_casts.cpp   |  25 ++
 cmake/have_namespaces.cpp  |  32 +++
 cmake/have_rtti.cpp|  28 +++
 cmake/string_compare_signature.cpp |  30 +++
 include/CMakeLists.txt |  23 ++
 include/config-auto.h.in   | 147 +
 include/cppunit/TestAssert.h   |   2 +-
 src/CMakeLists.txt |  20 +
 src/cppunit/CMakeLists.txt | 105 +++
 15 files changed, 782 insertions(+), 1 deletion(-)
 create mode 100644 CMakeLists.txt
 create mode 100644 cmake/CheckCXXSourcefileCompiles.cmake
 create mode 100644 cmake/CheckCXXTypeExists.cmake
 create mode 100644 cmake/CheckCXXTypeExists.cpp.in
 create mode 100644 cmake/PlatformChecks.cmake
 create mode 100644 cmake/Versioning.cmake
 create mode 100644 cmake/have_casts.cpp
 create mode 100644 cmake/have_namespaces.cpp
 create mode 100644 cmake/have_rtti.cpp
 create mode 100644 cmake/string_compare_signature.cpp
 create mode 100644 include/CMakeLists.txt
 create mode 100644 include/config-auto.h.in
 create mode 100644 src/CMakeLists.txt
 create mode 100644 src/cppunit/CMakeLists.txt

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 000..c61228f
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,45 @@
+#=
+# CppUnit - The C++ Unit Test Library
+# Copyright (c) 2013 - The Document Foundation
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#=
+
+project(cppunit C CXX)
+cmake_minimum_required(VERSION 2.8.7)
+
+# Add project specific CMake module path
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+
+# Perform platform and compiler feature checks
+include(PlatformChecks)
+
+# Versioning
+include(Versioning)
+
+# Build options
+option(BUILD_SHARED_LIBS Build cppunit as shared or static library ON)
+
+if(BUILD_SHARED_LIBS)
+add_definitions(-DCPPUNIT_BUILD_DLL)
+endif()
+
+# Include paths
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
+include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
+
+# Subdirectories
+add_subdirectory(include)
+add_subdirectory(src)
diff --git a/cmake/CheckCXXSourcefileCompiles.cmake 
b/cmake/CheckCXXSourcefileCompiles.cmake
new file mode 100644
index 000..9e7a351
--- /dev/null
+++ b/cmake/CheckCXXSourcefileCompiles.cmake
@@ -0,0 +1,99 @@
+# - Check if given C++ source in the specified file compiles and links into an 
executable
+# CHECK_CXX_SOURCEFILE_COMPILES(file var [FAIL_REGEX fail-regex])
+#  file   - source file to try to compile, must define 'main'
+#  var- variable to store whether the source code compiled
+#  fail-regex - fail if test output matches this regex
+# The following variables may be set before calling this macro to
+# modify the way the check is run:
+#
+#  CMAKE_REQUIRED_FLAGS = string of compile command line flags
+#  CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+#  CMAKE_REQUIRED_INCLUDES = list of include directories
+#  CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+#
+# Original implementation by:
+#=
+# Copyright 2005-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the License);
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=
+#
+# This macro overwrites the original macro shipped with the CMake distribution 
in a way

[PATCH 5/5] src: Fix build with Borland C++ compiler

2013-12-16 Thread Bernhard Sessler
Signed-off-by: Bernhard Sessler bernhard.sess...@corscience.de
---
 src/cppunit/PlugInManager.cpp | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/cppunit/PlugInManager.cpp b/src/cppunit/PlugInManager.cpp
index 4f8b371..0ebe4c5 100644
--- a/src/cppunit/PlugInManager.cpp
+++ b/src/cppunit/PlugInManager.cpp
@@ -1,6 +1,10 @@
 #include cppunit/config/SourcePrefix.h
 #include cppunit/XmlOutputterHook.h
-#include stdint.h
+#include cppunit/config-auto.h
+
+#ifdef CPPUNIT_HAVE_STDINT_H
+#include stdint.h
+#endif
 
 #if !defined(CPPUNIT_NO_TESTPLUGIN)
 #include cppunit/extensions/TestFactoryRegistry.h
@@ -8,6 +12,9 @@
 #include cppunit/plugin/TestPlugIn.h
 #include cppunit/plugin/DynamicLibraryManager.h
 
+#ifndef CPPUNIT_HAVE_STDINT_H
+typedef unsigned int* uintptr_t;
+#endif
 
 CPPUNIT_NS_BEGIN
 
-- 
1.8.3.2

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH 0/5] Add CMake build system

2013-12-16 Thread Bernhard Sessler
This patchset introduces a CMake based build system for building
the CppUnit libraries on different platforms and compilers.
The following compilers/platforms were tested:

- Windows 7 (x86_64):
* MinGW 4.8.1
* MSVC Professional 2013
* MSVC Express 2012
* Borland C++ Compiler 5.5.1
- Windows XP:
* MSVC Express 2010
-Linux (Ubuntu 13.10 amd64)
* GCC 4.8.0

Please note that currently only the cppunit _library_ and nothing
else is built. Support for the examples and platform specific test
runners is currently in development.

Bernhard Sessler (5):
  Add CMake build system for cppunit library
  cmake: Use target export feature
  include: Let the build system handle detecting the features
  doc: Add support for generating the API documentation
  src: Fix build with Borland C++ compiler

 CMakeLists.txt |  53 
 cmake/CheckCXXSourcefileCompiles.cmake |  99 ++
 cmake/CheckCXXTypeExists.cmake |  35 +++
 cmake/CheckCXXTypeExists.cpp.in|   6 +
 cmake/ExportTargets.cmake  |  40 +++
 cmake/PlatformChecks.cmake | 145 +
 cmake/Versioning.cmake |  47 +++
 cmake/have_casts.cpp   |  25 ++
 cmake/have_default_template_args.cpp   |  35 +++
 cmake/have_namespaces.cpp  |  32 ++
 cmake/have_rtti.cpp|  28 ++
 cmake/string_compare_signature.cpp |  30 ++
 cppunitConfig.cmake.in |  46 +++
 cppunitConfigVersion.cmake.in  |  29 ++
 doc/CMakeLists.txt |  59 
 doc/Doxyfile.in| 558 +
 include/CMakeLists.txt |  23 ++
 include/config-auto.h.in   | 150 +
 include/cppunit/Portability.h  |  22 +-
 include/cppunit/TestAssert.h   |   2 +-
 include/cppunit/config/config-bcb5.h   |  47 ---
 include/cppunit/config/config-evc4.h   |  57 
 include/cppunit/config/config-msvc6.h  |  64 
 src/CMakeLists.txt |  20 ++
 src/cppunit/CMakeLists.txt | 106 +++
 src/cppunit/PlugInManager.cpp  |   9 +-
 26 files changed, 1308 insertions(+), 459 deletions(-)
 create mode 100644 CMakeLists.txt
 create mode 100644 cmake/CheckCXXSourcefileCompiles.cmake
 create mode 100644 cmake/CheckCXXTypeExists.cmake
 create mode 100644 cmake/CheckCXXTypeExists.cpp.in
 create mode 100644 cmake/ExportTargets.cmake
 create mode 100644 cmake/PlatformChecks.cmake
 create mode 100644 cmake/Versioning.cmake
 create mode 100644 cmake/have_casts.cpp
 create mode 100644 cmake/have_default_template_args.cpp
 create mode 100644 cmake/have_namespaces.cpp
 create mode 100644 cmake/have_rtti.cpp
 create mode 100644 cmake/string_compare_signature.cpp
 create mode 100644 cppunitConfig.cmake.in
 create mode 100644 cppunitConfigVersion.cmake.in
 create mode 100644 doc/CMakeLists.txt
 create mode 100644 include/CMakeLists.txt
 create mode 100644 include/config-auto.h.in
 delete mode 100644 include/cppunit/config/config-bcb5.h
 create mode 100644 src/CMakeLists.txt
 create mode 100644 src/cppunit/CMakeLists.txt

-- 
1.8.3.2

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH 3/5] include: Let the build system handle detecting the features

2013-12-16 Thread Bernhard Sessler
This includes a cleanup of the specialized configuration header
files, as supported features are detected during the configuration
stage and do not need to be hard coded into the headers for different
platforms.

Signed-off-by: Bernhard Sessler bernhard.sess...@corscience.de
---
 cmake/PlatformChecks.cmake|  6 
 cmake/have_default_template_args.cpp  | 35 +++
 include/config-auto.h.in  |  3 ++
 include/cppunit/Portability.h | 22 ++--
 include/cppunit/config/config-bcb5.h  | 47 -
 include/cppunit/config/config-evc4.h  | 57 ---
 include/cppunit/config/config-msvc6.h | 64 ---
 7 files changed, 54 insertions(+), 180 deletions(-)
 create mode 100644 cmake/have_default_template_args.cpp
 delete mode 100644 include/cppunit/config/config-bcb5.h

diff --git a/cmake/PlatformChecks.cmake b/cmake/PlatformChecks.cmake
index 657bf3b..e6ff590 100644
--- a/cmake/PlatformChecks.cmake
+++ b/cmake/PlatformChecks.cmake
@@ -123,6 +123,12 @@ 
check_cxx_sourcefile_compiles(${PROJECT_SOURCE_DIR}/cmake/have_casts.cpp
   CPPUNIT_HAVE_CPP_CAST)
 
check_cxx_sourcefile_compiles(${PROJECT_SOURCE_DIR}/cmake/string_compare_signature.cpp
   CPPUNIT_FUNC_STRING_COMPARE_SIZE_FIRST)
+check_cxx_sourcefile_compiles(${PROJECT_SOURCE_DIR}/cmake/have_default_template_args.cpp
+  CPPUNIT_HAVE_DEFAULT_TEMPLATE_ARGS)
+
+if(NOT CPPUNIT_HAVE_DEFAULT_TEMPLATE_ARGS)
+set(CPPUNIT_STD_NEED_ALLOCATOR 1 CACHE INTERNAL Default template 
parameters not supported)
+endif()
 
 if(NOT CPPUNIT_FUNC_STRING_COMPARE_SIZE_FIRST)
 set(CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST 1
diff --git a/cmake/have_default_template_args.cpp 
b/cmake/have_default_template_args.cpp
new file mode 100644
index 000..465c391
--- /dev/null
+++ b/cmake/have_default_template_args.cpp
@@ -0,0 +1,35 @@
+//=
+// CppUnit - The C++ Unit Test Library
+// Copyright (c) 2013 - The Document Foundation
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//=
+
+// Check whether the compiler supports default arguments for template 
parameters
+templatetypename T=int
+class Foo
+{
+public:
+T bar(T param)
+{
+return param;
+}
+};
+
+int main()
+{
+Foo f;
+return f.bar(0);
+}
diff --git a/include/config-auto.h.in b/include/config-auto.h.in
index 309e291..ad5b8d3 100644
--- a/include/config-auto.h.in
+++ b/include/config-auto.h.in
@@ -73,6 +73,9 @@
 /* define if the compiler supports C++ style casts */
 #cmakedefine CPPUNIT_HAVE_CPP_CAST 1
 
+/* define if the compiler does not support default arguments for template 
parameters */
+#cmakedefine CPPUNIT_STD_NEED_ALLOCATOR 1
+
 /* Define if you have the shl_load function. */
 #cmakedefine CPPUNIT_HAVE_SHL_LOAD 1
 
diff --git a/include/cppunit/Portability.h b/include/cppunit/Portability.h
index a21f1a2..7d32c97 100644
--- a/include/cppunit/Portability.h
+++ b/include/cppunit/Portability.h
@@ -5,24 +5,23 @@
 # define WIN32 1
 #endif
 
+/* include automatically generated configuration */
+#include cppunit/config-auto.h
+
 /* include platform specific config */
-#if defined(__BORLANDC__)
-#  include cppunit/config/config-bcb5.h
-#elif defined (_MSC_VER)
+#if defined (_MSC_VER)
 #  if _MSC_VER == 1200  defined(_WIN32_WCE) //evc4
 #include cppunit/config/config-evc4.h
 #  else
 #include cppunit/config/config-msvc6.h
 #  endif
-#else
-#include cppunit/config-auto.h
 #endif
 
 // Version number of package
-#ifndef CPPUNIT_VERSION 
+#ifndef CPPUNIT_VERSION
 #define CPPUNIT_VERSION  1.13.0
 #endif
- 
+
 #include cppunit/config/CppUnitApi.h// define CPPUNIT_API  
CPPUNIT_NEED_DLL_DECL
 #include cppunit/config/SelectDllLoader.h
 
@@ -44,7 +43,7 @@
 # define CPPUNIT_ENABLE_CU_TEST_MACROS0
 #endif
 
-/* Define to 1 if the preprocessor expands (#foo) to foo (quotes incl.) 
+/* Define to 1 if the preprocessor expands (#foo) to foo (quotes incl.)
I don't think there is any C preprocess that does NOT support this! */
 #if !defined