test installed, instead of local, version of include files

This commit is contained in:
Brad Bell 2013-01-04 18:19:01 -07:00
commit 45c401c220

View file

@ -65,8 +65,15 @@ as a single web page, in both HTML and XML, can be found at that web site.
%setup -q
includedir=%{buildroot}%{_includedir}
# Replace cppad_SOURCE_DIR by the system include directory so that
# installed files, instead of local files, are used for testing.
sed \
-e "s|\(INCLUDE_DIRECTORIES(\).*{cppad_SOURCE_DIR}|\1 SYSTEM $includedir|" \
-i.stamp CMakeLists.txt
# This patch should not longer be necessary when %%{version} >= 20130000.2
sed -e '/TARGET_LINK_LIBRARIES/d' -i.stamp speed/example/CMakeLists.txt
sed -e '/TARGET_LINK_LIBRARIES/d' \
-i.stamp speed/example/CMakeLists.txt
# change example/example.cpp to print out machine epsilon
cat << EOF > example.sed
@ -92,9 +99,12 @@ make %{?_smp_mflags}
%install
rm -rf %{buildroot}
make check
make install DESTDIR=%{buildroot}
# use the installed include files to compile and run the tests
%check
make check
%clean
# cleanup
rm -rf %{buildroot}