2 project(libt2n-example1)
4 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
7 set(CMAKE_COLOR_MAKEFILE ON)
8 cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
10 # Source package generation
11 set(CPACK_SOURCE_GENERATOR TGZ)
12 set(CPACK_SOURCE_IGNORE_FILES "~$;\\\\.git;build;build-rpm")
13 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION}")
15 # Find external packages
16 include(FindPkgConfig)
18 pkg_check_modules(LIBT2N REQUIRED libt2n>=0.2)
19 include_directories(${LIBT2N_INCLUDE_DIRS})
20 link_directories(${LIBT2N_LIBRARY_DIRS})
25 # for each command group list the files to parse for LIBT2N_EXPORT
26 set(t2nexample_GROUP ${CMAKE_CURRENT_SOURCE_DIR}/t2nexample.cpp)
27 # include CMake snippet doing all the magic
28 include(${CMAKE_SOURCE_DIR}/codegen/Libt2n.cmake)
29 # command groups are listed here (seperated by spaces)
30 setup_libt2n(t2nexample)
33 # for each group build a client library from generated source file(s)
34 # Note: the library name must match the group name
35 set(libt2nexample_SOURCES
38 set(libt2n_example1_server_SOURCES
45 # build server program
46 add_executable(libt2n-example1-server ${libt2n_example1_server_SOURCES})
49 add_library(libt2nexample STATIC ${libt2nexample_SOURCES})
50 set_target_properties(libt2nexample PROPERTIES OUTPUT_NAME t2nexample)
53 target_link_libraries(libt2n-example1-server ${LIBT2N_LIBRARIES})
54 target_link_libraries(libt2nexample t2nexample ${LIBT2N_LIBRARIES})
56 add_dependencies(libt2n-example1-server t2n_arnielizer_codegen_done)
57 add_dependencies(libt2nexample t2n_arnielizer_codegen_done)
60 # install(TARGETS libt2n-example1-server DESTINATION bin)
61 # install(TARGETS libt2nexample ARCHIVE DESTINATION lib)