author | Tero Marttila <terom@fixme.fi> |
Sun, 08 Mar 2009 02:48:29 +0200 | |
changeset 62 | 07c14d83c698 |
parent 61 | 9f7ecf7bf699 |
permissions | -rw-r--r-- |
62 | 1 |
# dependancies |
2 |
find_package (LibEvent REQUIRED) |
|
3 |
find_package (LibPQ REQUIRED) |
|
4 |
||
57
527d23bf6441
move to CMake from old crufty Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
5 |
# add our include path |
61 | 6 |
include_directories (${LibEvent_INCLUDE_DIRS}) |
57
527d23bf6441
move to CMake from old crufty Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
7 |
|
527d23bf6441
move to CMake from old crufty Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
8 |
# define our source code modules |
527d23bf6441
move to CMake from old crufty Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
9 |
set (LIB_SOURCES "lib/log.c") |
527d23bf6441
move to CMake from old crufty Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
10 |
set (EVPQ_SOURCES evpq.c) |
527d23bf6441
move to CMake from old crufty Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
11 |
set (EVSQL_SOURCES core.c util.c) |
527d23bf6441
move to CMake from old crufty Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
12 |
|
527d23bf6441
move to CMake from old crufty Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
13 |
# XXX: silly cmake does silly things when you SET with only one arg |
58
02e539965ef4
merge new-evsql into new structure
Tero Marttila <terom@fixme.fi>
parents:
57
diff
changeset
|
14 |
set (EVSQL_SOURCES lib/log.c evpq.c core.c query.c result.c util.c) |
61 | 15 |
set (EVSQL_LIBRARIES ${LibEvent_LIBRARIES} ${LibPQ_LIBRARIES}) |
16 |
||
62 | 17 |
# compiler flags |
61 | 18 |
set (CFLAGS "-Wall -Wextra") |
57
527d23bf6441
move to CMake from old crufty Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
19 |
|
527d23bf6441
move to CMake from old crufty Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
20 |
# add our library |
60 | 21 |
add_library (evsql ${EVSQL_SOURCES}) |
22 |
||
23 |
# set target attributes |
|
61 | 24 |
target_link_libraries (evsql ${EVSQL_LIBRARIES}) |
60 | 25 |
set_target_properties (evsql PROPERTIES |
26 |
FRAMEWORK True |
|
27 |
PUBLIC_HEADER include/evsql.h |
|
28 |
) |
|
57
527d23bf6441
move to CMake from old crufty Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
29 |
|
60 | 30 |
# setup install info |
31 |
install (TARGETS evsql |
|
32 |
LIBRARY DESTINATION lib |
|
33 |
ARCHIVE DESTINATION lib/static |
|
34 |
PUBLIC_HEADER DESTINATION include |
|
35 |
) |
|
61 | 36 |
|
37 |
# test stuff |
|
38 |
add_executable (evsql_test EXCLUDE_FROM_ALL lib/log.c lib/signals.c evsql_test.c) |
|
39 |
target_link_libraries (evsql_test evsql) |
|
62 | 40 |
|
41 |
# global target properties |
|
42 |
set_target_properties (evsql evsql_test PROPERTIES |
|
61 | 43 |
COMPILE_FLAGS ${CFLAGS} |
44 |
) |
|
45 |