source: trunk/bindings/cpp/CMakeLists.txt @ 1822

Revision 1816, 2.8 KB checked in by Freddie Akeroyd, 4 months ago (diff)

More mods for NXvalidate building. Refs #327

Line 
1## Process this file with cmake
2#====================================================================
3#  NeXus - Neutron & X-ray Common Data Format
4
5#  CMakeLists for building the NeXus library and applications.
6#
7#  Copyright (C) 2011 Stephen Rankin
8
9#  This library is free software; you can redistribute it and/or
10#  modify it under the terms of the GNU Lesser General Public
11#  License as published by the Free Software Foundation; either
12#  version 2 of the License, or (at your option) any later version.
13#
14#  This library is distributed in the hope that it will be useful,
15#  but WITHOUT ANY WARRANTY; without even the implied warranty of
16#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17#  Lesser General Public License for more details.
18#
19#  You should have received a copy of the GNU Lesser General Public
20#  License along with this library; if not, write to the Free
21#  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22#  MA  02111-1307  USA
23#             
24#  For further information, see <http://www.nexusformat.org>
25#
26#
27#====================================================================
28
29add_definitions(-DIN_NEXUS_CPP_LIBRARY=1 ${NX_CPP})
30
31#Make NeXus CPP Bindings Static Library
32
33set (HEADERS NeXusFile.hpp NeXusException.hpp NeXusStream.hpp)
34set (SOURCES NeXusFile.hpp NeXusFile.cpp NeXusException.hpp NeXusException.cpp NeXusStream.hpp NeXusStream.cpp)
35
36set_property(SOURCE ${SOURCES} APPEND PROPERTY COMPILE_FLAGS ${NX_CFLAGS})
37
38add_library (NeXus_CPP_Static_Library STATIC ${HEADERS} ${SOURCES})
39
40set_target_properties(NeXus_CPP_Static_Library PROPERTIES OUTPUT_NAME NeXusCPPStatic)
41
42target_link_libraries(NeXus_CPP_Static_Library NeXus_Static_Library
43                                        ${READLINE_LINK} ${M_LINK} ${DL_LINK} ${PTHREAD_LINK} ${DF_LINK}
44                      ${TERMCAP_LINK} ${HISTORY_LINK} ${JPEG_LIBRARIES} ${ZLIB_LIBRARIES})
45
46#Make NeXus CPP Bindings Shared Library
47
48add_library (NeXus_CPP_Shared_Library SHARED ${HEADERS} ${SOURCES})
49
50#Note - library version needs to be got from somewhere?
51# may want to use DEBUG_OUTPUT_NAME and RELEASE_OUTPUT_NAME
52# of define CMAKE_DEBUG_POSTFIX globally
53set_target_properties(NeXus_CPP_Shared_Library PROPERTIES OUTPUT_NAME NeXusCPP
54                      VERSION 1.0 SOVERSION 4)
55
56target_link_libraries(NeXus_CPP_Shared_Library NeXus_Shared_Library
57                       ${READLINE_LINK} ${M_LINK} ${DL_LINK} ${PTHREAD_LINK} ${DF_LINK}
58                      ${TERMCAP_LINK} ${HISTORY_LINK} ${JPEG_LIBRARIES} ${ZLIB_LIBRARIES})
59
60install (TARGETS NeXus_CPP_Static_Library NeXus_CPP_Shared_Library
61         RUNTIME DESTINATION bin COMPONENT Runtime
62         LIBRARY DESTINATION lib COMPONENT Runtime
63         ARCHIVE DESTINATION lib/nexus COMPONENT Development)
64
65if(WIN32)
66install_pdb (NeXus_CPP_Shared_Library)
67endif()
68
69
70
Note: See TracBrowser for help on using the repository browser.