summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
blob: 76f323a7c0bf6b4d05f283a3d7864b9ac2b57d9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
INCLUDE_DIRECTORIES( ${LIBXML2_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/libcnary/include )
 

SET(libplist_SRC
	plist.c
	hashtable.c
	bytearray.c
	ptrarray.c
	bplist.c
	base64.c
	xplist.c )

SET(libplist++_SRC
	Node.cpp
	Boolean.cpp
	Integer.cpp
	Real.cpp
	String.cpp
	Date.cpp
	Data.cpp
	Structure.cpp
	Array.cpp
	Dictionary.cpp
	)

SET(libcnary_object_files
  ${CMAKE_BINARY_DIR}/libcnary/CMakeFiles/libcnary.dir/iterator.c.o
  ${CMAKE_BINARY_DIR}/libcnary/CMakeFiles/libcnary.dir/list.c.o
  ${CMAKE_BINARY_DIR}/libcnary/CMakeFiles/libcnary.dir/node.c.o
  ${CMAKE_BINARY_DIR}/libcnary/CMakeFiles/libcnary.dir/node_iterator.c.o
  ${CMAKE_BINARY_DIR}/libcnary/CMakeFiles/libcnary.dir/node_list.c.o
)

SET_SOURCE_FILES_PROPERTIES(${libcnary_object_files} PROPERTIES EXTERNAL_OBJECT true GENERATED true)

ADD_LIBRARY( plist SHARED ${libplist_SRC} ${libcnary_object_files} )
TARGET_LINK_LIBRARIES( plist ${LIBXML2_LIBRARIES} )
SET_TARGET_PROPERTIES( plist PROPERTIES VERSION ${LIBPLIST_LIBVERSION} )
SET_TARGET_PROPERTIES( plist PROPERTIES SOVERSION ${LIBPLIST_SOVERSION} )
if(APPLE)
  SET_TARGET_PROPERTIES( plist PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
endif()

ADD_LIBRARY( plist++ SHARED ${libplist++_SRC} )
TARGET_LINK_LIBRARIES( plist++ plist )
SET_TARGET_PROPERTIES( plist++ PROPERTIES VERSION ${LIBPLIST_LIBVERSION} )
SET_TARGET_PROPERTIES( plist++ PROPERTIES SOVERSION ${LIBPLIST_SOVERSION} )
if(APPLE)
  SET_TARGET_PROPERTIES( plist++ PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
endif()

INSTALL(TARGETS plist plist++
 RUNTIME DESTINATION bin COMPONENT lib
 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT dev
 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT dev)