[Libreoffice-commits] cppunit.git: Branch 'feature/cmake' - CMakeLists.txt examples/CMakeLists.txt examples/cppunittest
Bernhard Sessler
bernhard.sessler at corscience.de
Sat Jan 11 08:04:37 PST 2014
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.sessler at 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.sessler at corscience.de>
Reviewed-on: https://gerrit.libreoffice.org/7315
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard at 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 0000000..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)
More information about the Libreoffice-commits
mailing list