Skip to content

Commit 7544abb

Browse files
committed
Initial CMake version of build system.
Convert spec file to cmake.
1 parent 691ed3b commit 7544abb

File tree

6 files changed

+138
-10
lines changed

6 files changed

+138
-10
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.so*
2+
cmake_install.cmake
3+
CMakeFiles
4+
CMakeCache.txt
5+
Makefile

CMakeLists.txt

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
cmake_minimum_required( VERSION 2.6 )
3+
project( xrootd-cmstfc )
4+
5+
set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )
6+
7+
find_package( Xrootd REQUIRED )
8+
find_package( XercesC REQUIRED )
9+
find_package( Pcre REQUIRED )
10+
11+
if( CMAKE_COMPILER_IS_GNUCXX )
12+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror" )
13+
endif()
14+
15+
if( CMAKE_COMPILER_IS_GNUCC )
16+
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror" )
17+
endif()
18+
19+
include_directories( "${PROJECT_SOURCE_DIR}" "${XROOTD_INCLUDES}"
20+
"${XERCES_INCLUDES}" "${PCRE_INCLUDES}" )
21+
22+
add_library( XrdCmsTfc MODULE src/XrdCmsTfc.cc src/XrdCmsTfc.hh )
23+
target_link_libraries(XrdCmsTfc ${XROOTD_UTILS} ${XERCES_LIB} ${PCRE_LIB})
24+
25+
if (NOT DEFINED CMAKE_INSTALL_LIBDIR)
26+
SET(CMAKE_INSTALL_LIBDIR "lib")
27+
endif()
28+
29+
install(
30+
TARGETS XrdCmsTfc
31+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} )
32+
33+
install(
34+
FILES ${CMAKE_SOURCE_DIR}/src/XrdCmsTfc.hh
35+
DESTINATION include )
36+
37+
set_target_properties(
38+
XrdCmsTfc
39+
PROPERTIES
40+
VERSION "0.0.1"
41+
SOVERSION "0"
42+
LINK_INTERFACE_LIBRARIES "" )
43+

cmake/FindPcre.cmake

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
FIND_PATH(PCRE_INCLUDES pcre.h
3+
HINTS
4+
${PCRE_INCLUDE_DIR}
5+
$ENV{PCRE_INCLUDE_DIR}
6+
/usr
7+
PATH_SUFFIXES include
8+
)
9+
10+
FIND_LIBRARY(PCRE_LIB pcre
11+
HINTS
12+
${PCRE_LIB_DIR}
13+
$ENV{PCRE_LIB_DIR}
14+
/usr
15+
PATH_SUFFIXES lib
16+
)
17+
18+
INCLUDE(FindPackageHandleStandardArgs)
19+
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Pcre DEFAULT_MSG PCRE_LIB PCRE_INCLUDES)
20+

cmake/FindXercesC.cmake

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
FIND_PATH(XERCES_INCLUDES xercesc/dom/DOM.hpp
3+
HINTS
4+
${XERCES_INCLUDE_DIR}
5+
$ENV{XERCES_INCLUDE_DIR}
6+
/usr
7+
PATH_SUFFIXES include
8+
)
9+
10+
FIND_LIBRARY(XERCES_LIB xerces-c
11+
HINTS
12+
${XERCES_LIB_DIR}
13+
$ENV{XERCES_LIB_DIR}
14+
/usr
15+
PATH_SUFFIXES lib
16+
)
17+
18+
INCLUDE(FindPackageHandleStandardArgs)
19+
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XercesC DEFAULT_MSG XERCES_LIB XERCES_INCLUDES)
20+

cmake/FindXrootd.cmake

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
FIND_PATH(XROOTD_INCLUDES XrdVersion.hh
3+
HINTS
4+
${XROOTD_DIR}
5+
$ENV{XROOTD_DIR}
6+
/usr
7+
/opt/xrootd/
8+
PATH_SUFFIXES include/xrootd
9+
PATHS /opt/xrootd
10+
)
11+
12+
FIND_LIBRARY(XROOTD_UTILS XrdUtils
13+
HINTS
14+
${XROOTD_DIR}
15+
$ENV{XROOTD_DIR}
16+
/usr
17+
/opt/xrootd/
18+
PATH_SUFFIXES lib
19+
)
20+
21+
INCLUDE(FindPackageHandleStandardArgs)
22+
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Xrootd DEFAULT_MSG XROOTD_UTILS XROOTD_INCLUDES)
23+

spec/xrootd-cmstfc.spec

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,57 @@
11

22
Name: xrootd-cmstfc
3-
Version: 1.4.3
3+
Version: 1.5
44
Release: 1
55
Summary: CMS TFC plugin for xrootd
66

77
Group: System Environment/Daemons
88
License: BSD
9-
URL: svn://t2.unl.edu/brian/XrdCmsTfc
10-
Source0: %{name}-%{version}.tar.gz
9+
URL: https://github.com/bbockelm/xrootd-cmstfc
10+
# Generated from:
11+
# git-archive master | gzip -7 > ~/rpmbuild/SOURCES/xrootd-lcmaps.tar.gz
12+
Source0: %{name}.tar.gz
1113
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
12-
BuildRequires: xrootd-devel xerces-c-devel pcre-devel
14+
BuildRequires: xrootd-libs-devel xerces-c-devel pcre-devel
1315
Requires: /usr/bin/xrootd pcre xerces-c
1416

17+
%package devel
18+
Summary: Development headers and libraries for Xrootd CMSTFC plugin
19+
Group: System Environment/Development
20+
1521
%description
1622
%{summary}
1723

24+
%description devel
25+
%{summary}
26+
1827
%prep
19-
%setup -q
28+
%setup -q -c -n %{name}-%{version}
2029

2130
%build
22-
%configure --with-xrootd-incdir=/usr/include/xrootd
23-
make
31+
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .
32+
make VERBOSE=1 %{?_smp_mflags}
2433

2534
%install
2635
rm -rf $RPM_BUILD_ROOT
27-
%makeinstall
36+
make install DESTDIR=$RPM_BUILD_ROOT
2837

2938
%clean
3039
rm -rf $RPM_BUILD_ROOT
3140

3241
%files
3342
%defattr(-,root,root,-)
34-
%{_libdir}/libXrdCmsTfc*
35-
%{_includedir}/xrootd/XrdCmsTfc/XrdCmsTfc.hh
43+
%{_libdir}/libXrdCmsTfc.so.*
44+
45+
%files devel
46+
%defattr(-,root,root,-)
47+
%{_libdir}/libXrdCmsTfc.so
48+
%{_includedir}/XrdCmsTfc.hh
3649

3750
%changelog
51+
* Mon Oct 22 2012 Brian Bockelman <[email protected]> - 1.5-1
52+
- Switch to cmake.
53+
- Rebuild against Xrootd 3.3.
54+
3855
* Wed May 18 2011 Brian Bockelman <[email protected]> 1.4.3-1
3956
- Apply path matching only at the beginning of the path.
4057

0 commit comments

Comments
 (0)