src/CMakeLists.txt

Sun, 29 Dec 2019 20:21:35 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 29 Dec 2019 20:21:35 +0100
changeset 384
9b81a555c059
parent 377
2099a3aff61e
child 390
d345541018fa
permissions
-rw-r--r--

fixes build on FreeBSD and macOS

375
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
1 set(sources
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
2 allocator.c
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
3 array.c
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
4 avl.c
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
5 buffer.c
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
6 list.c
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
7 logging.c
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
8 map.c
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
9 mempool.c
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
10 properties.c
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
11 stack.c
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
12 string.c
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
13 test.c
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
14 ucx.c
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
15 utils.c
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
16 )
377
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
17 set(headers
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
18 ucx/allocator.h
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
19 ucx/array.h
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
20 ucx/avl.h
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
21 ucx/buffer.h
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
22 ucx/list.h
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
23 ucx/logging.h
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
24 ucx/map.h
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
25 ucx/mempool.h
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
26 ucx/properties.h
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
27 ucx/stack.h
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
28 ucx/string.h
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
29 ucx/test.h
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
30 ucx/ucx.h
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
31 ucx/utils.h
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
32 )
375
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
33
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
34 add_library(ucx SHARED ${sources})
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
35 add_library(ucx_static STATIC ${sources})
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
36
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
37 target_include_directories(ucx PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
38 target_include_directories(ucx_static PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
39
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
40 set_target_properties(ucx PROPERTIES SOVERSION 3 VERSION 3.1.0)
460c0258bb5b adds proper cmake build targets
Mike Becker <universe@uap-core.de>
parents:
diff changeset
41 set_target_properties(ucx_static PROPERTIES VERSION ${CMAKE_PROJECT_VERSION})
377
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
42
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
43 # it is sufficient to specify the headers for one of the targets
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
44 set_target_properties(ucx PROPERTIES PUBLIC_HEADER "${headers}")
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
45
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
46 include(GNUInstallDirs)
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
47 install(TARGETS ucx ucx_static
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
48 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
49 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
2099a3aff61e adds install target for cmake builds
Mike Becker <universe@uap-core.de>
parents: 375
diff changeset
50 PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ucx)

mercurial