build: allow conditional building of cynara-tests, turn it on in spec 45/27045/3
authorRafal Krypa <r.krypa@samsung.com>
Wed, 3 Sep 2014 14:04:26 +0000 (16:04 +0200)
committerLukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Thu, 4 Sep 2014 18:16:33 +0000 (11:16 -0700)
Change cmake to build cynara-tests only when enabled and enable it in spec
file. This will enable cynara build outside of Tizen (without tests).
Current setup for cynara-tests build depends on Tizen-specific packaging of
gmock package. This dependency cannot be met outside of Tizen, which would
break the whole build.
It is not easy to apply a proper fix to have cynara-tests built outside of
Tizen. Gmock is not meant to be used as dependency in such way.
Most certainly we will have to handle gmock dependency differently in
upstream and in Tizen.

Change-Id: Id9fc8142979d1a2061c1c72c610520479d9e61a2
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
CMakeLists.txt
packaging/cynara.spec

index 18b0dee..8c10a18 100644 (file)
@@ -88,6 +88,9 @@ SET(TARGET_LIB_CREDS_SOCKET "cynara-creds-socket")
 SET(TARGET_LIB_SESSION "cynara-session")
 
 ADD_SUBDIRECTORY(src)
-ADD_SUBDIRECTORY(test)
 ADD_SUBDIRECTORY(pkgconfig)
 ADD_SUBDIRECTORY(systemd)
+
+IF (BUILD_TESTS)
+ADD_SUBDIRECTORY(test)
+ENDIF()
index a297c4f..ce6fe5c 100644 (file)
@@ -209,6 +209,7 @@ export CXXFLAGS="$CXXFLAGS -DCYNARA_STATE_PATH=\\\"%{state_path}\\\""
 export LDFLAGS+="-Wl,--rpath=%{_libdir}"
 
 %cmake . \
+        -DBUILD_TESTS=ON \
         -DCMAKE_BUILD_TYPE=%{?build_type} \
         -DCMAKE_VERBOSE_MAKEFILE=ON
 make %{?jobs:-j%jobs}