Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 80 lines (62 sloc) 2.3 kB
0a0b1b3 @RJ initial commit, f2f library
authored
1 PROJECT(libf2f)
2 CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
3
4 SET(F2F_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
5 SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${F2F_PATH}/CMakeModules")
6
7 SET(SRC "${F2F_PATH}/src")
8 SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${F2F_PATH}/bin")
6b90016 @RJ minor cmake change
authored
9 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${F2F_PATH}/lib")
0a0b1b3 @RJ initial commit, f2f library
authored
10
2fed613 @RJ add -pthread to cxxflags to solve linker errors on some distros, than…
authored
11 set(CMAKE_CXX_FLAGS "-pthread")
12
8c3abcb @RJ make install implemented, to usr/local
authored
13 # binaries get installed here
14 SET(CMAKE_INSTALL_PREFIX "/usr/local/")
15
0a0b1b3 @RJ initial commit, f2f library
authored
16 # on linux x86-64 set this to OFF if you are having (-fPIC...) build problems.
17 # then: cd build/ && rm -rf CMakeCache.txt CMakeFiles/ cmake_install.cmake resolvers/
18 # then: cmake .. ; make
19 # alternatively, recompile boost with -fPIC like so:
20 # bjam --v2 cxxflags=-fPIC stage
21 SET(Boost_USE_STATIC_LIBS ON)
71ae0bb @RJ now the demo app works properly again
authored
22 #SET(Boost_USE_STATIC_LIBS OFF)
0a0b1b3 @RJ initial commit, f2f library
authored
23
24 SET(Boost_USE_MULTITHREADED ON)
25 FIND_PACKAGE(Boost 1.35 REQUIRED COMPONENTS filesystem system regex thread program_options date_time)
26
27 INCLUDE_DIRECTORIES(
28 ${F2F_PATH}/include
29 ${Boost_INCLUDE_DIR}
30 )
31
32 LINK_DIRECTORIES(
33 ${F2F_PATH}/lib
34 /usr/local/lib
35 )
36
37 SET(CMAKE_VERBOSE_MAKEFILE ON)
38 INCLUDE(InstallRequiredSystemLibraries)
39
40 IF(WIN32)
41 ADD_DEFINITIONS(/DNOMINMAX)
42 ADD_DEFINITIONS(/DWIN32_LEAN_AND_MEAN)
43 ENDIF(WIN32)
44
45 IF(NOT WIN32)
46 # removes operators like "and", "or" and "not"
d975378 @RJ error msg
authored
47 ADD_DEFINITIONS(-Wall -ggdb)
0a0b1b3 @RJ initial commit, f2f library
authored
48 ADD_DEFINITIONS(-g )
49 ADD_DEFINITIONS(-fno-operator-names)
50 ADD_DEFINITIONS(-fPIC)
d2268cb @RJ archive not .so, less hassle to distribute
authored
51 ADD_DEFINITIONS(-O2)
0a0b1b3 @RJ initial commit, f2f library
authored
52 ENDIF(NOT WIN32)
53
d2268cb @RJ archive not .so, less hassle to distribute
authored
54 ADD_LIBRARY( f2f STATIC
0a0b1b3 @RJ initial commit, f2f library
authored
55 ${SRC}/router.cpp
56 ${SRC}/protocol.cpp
57 ${SRC}/connection.cpp
58 )
59
60 SET_TARGET_PROPERTIES( f2f PROPERTIES
61 CMAKE_RUNTIME_OUTPUT_DIRECTORY "${F2F_PATH}/lib"
62 )
63
64 ADD_EXECUTABLE( f2f-demo
65 ${F2F_PATH}/app/main.cpp
66 )
67
68 TARGET_LINK_LIBRARIES( f2f
69 ${Boost_LIBRARIES} # Boost license
70 )
71
72 TARGET_LINK_LIBRARIES( f2f-demo
73 f2f
74 ${Boost_LIBRARIES} # Boost license
75 )
76
d2268cb @RJ archive not .so, less hassle to distribute
authored
77 INSTALL(TARGETS f2f ARCHIVE DESTINATION lib)
8c3abcb @RJ make install implemented, to usr/local
authored
78 INSTALL(TARGETS f2f-demo RUNTIME DESTINATION bin)
79 INSTALL(DIRECTORY include/libf2f DESTINATION include PATTERN "*~" EXCLUDE)
Something went wrong with that request. Please try again.