install(FILES ${CMAKE_BINARY_DIR}/libt2n.pc DESTINATION lib/pkgconfig)
# Installation of scripts
-# install(PROGRAMS libt2n-gccxml.sh DESTINATION /usr/bin)
+install(PROGRAMS libt2n-gccxml.sh DESTINATION bin)
# Subdirectories
set(CPACK_SET_DESTDIR "ON")
add_subdirectory(src)
add_subdirectory(test)
-# add_subdirectory(examples)
add_subdirectory(codegen)
-# add_subdirectory(examples-codegen)
+add_subdirectory(examples EXCLUDE_FROM_ALL)
+add_subdirectory(examples-codegen EXCLUDE_FROM_ALL)
include(CPack)
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
# Executables
-add_executable(libt2n_codegen ${CPP_SOURCES})
+add_executable(libt2n-codegen ${CPP_SOURCES})
# Dependencies
-target_link_libraries(libt2n_codegen ${XMLPP_LIBRARIES})
+target_link_libraries(libt2n-codegen ${XMLPP_LIBRARIES})
# Installation
-install(TARGETS libt2n_codegen DESTINATION bin)
+install(TARGETS libt2n-codegen DESTINATION bin)
install(FILES ${CPP_HEADERS} DESTINATION include)
+install(FILES clientlib.pc.in DESTINATION share/libt2n)
--- /dev/null
+
+add_subdirectory(example1 EXCLUDE_FROM_ALL)
+add_subdirectory(example1-client EXCLUDE_FROM_ALL)
+add_subdirectory(example1-client-wrapper EXCLUDE_FROM_ALL)
+add_subdirectory(example2 EXCLUDE_FROM_ALL)
+add_subdirectory(example2-client EXCLUDE_FROM_ALL)
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION}")
# Find external packages
-include(FindPkgConfig)
+# include(FindPkgConfig)
-pkg_check_modules(T2NEXAMPLE REQUIRED t2nexample=0.1)
-include_directories(${T2NEXAMPLE_INCLUDE_DIRS})
-link_directories(${T2NEXAMPLE_LIBRARY_DIRS})
+# pkg_check_modules(T2NEXAMPLE REQUIRED t2nexample=0.1)
+# include_directories(${T2NEXAMPLE_INCLUDE_DIRS})
+# link_directories(${T2NEXAMPLE_LIBRARY_DIRS})
-include(CPack)
+# include(CPack)
# Sources
set(libt2n_example1_client_wrapper_SOURCES
add_executable(libt2n-example1-client-wrapper ${libt2n_example1_client_wrapper_SOURCES})
# Dependencies
-target_link_libraries(libt2n-example1-client-wrapper ${T2NEXAMPLE_LIBRARIES})
+# target_link_libraries(libt2n-example1-client-wrapper ${T2NEXAMPLE_LIBRARIES})
+target_link_libraries(libt2n-example1-client-wrapper t2nexample)
# Installation
# install(TARGETS libt2n-example1-client-wrapper DESTINATION bin)
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION}")
# Find external packages
-include(FindPkgConfig)
+# include(FindPkgConfig)
-pkg_check_modules(T2NEXAMPLE REQUIRED t2nexample=0.1)
-include_directories(${T2NEXAMPLE_INCLUDE_DIRS})
-link_directories(${T2NEXAMPLE_LIBRARY_DIRS})
+# pkg_check_modules(T2NEXAMPLE REQUIRED t2nexample=0.1)
+# include_directories(${T2NEXAMPLE_INCLUDE_DIRS})
+# link_directories(${T2NEXAMPLE_LIBRARY_DIRS})
-include(CPack)
+# include(CPack)
# Sources
set(libt2n_example1_client_SOURCES
add_executable(libt2n-example1-client ${libt2n_example1_client_SOURCES})
# Dependencies
-target_link_libraries(libt2n-example1-client ${T2NEXAMPLE_LIBRARIES})
+# target_link_libraries(libt2n-example1-client ${T2NEXAMPLE_LIBRARIES})
+target_link_libraries(libt2n-example1-client t2nexample)
# Installation
# install(TARGETS libt2n-example1-client DESTINATION bin)
# for each command group list the files to parse for LIBT2N_EXPORT
set(t2nexample_GROUP ${CMAKE_CURRENT_SOURCE_DIR}/t2nexample.cpp)
# include CMake snippet doing all the magic
-include(${CMAKE_SOURCE_DIR}/../cmake/Libt2n.cmake)
+include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Libt2n.cmake)
# command groups are listed here (seperated by spaces)
setup_libt2n(t2nexample)
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION}")
# Find external packages
-include(FindPkgConfig)
+# include(FindPkgConfig)
-pkg_check_modules(DEFAULT REQUIRED default=0.1)
-include_directories(${DEFAULT_INCLUDE_DIRS})
-link_directories(${DEFAULT_LIBRARY_DIRS})
+# pkg_check_modules(DEFAULT REQUIRED default=0.1)
+# include_directories(${DEFAULT_INCLUDE_DIRS})
+# link_directories(${DEFAULT_LIBRARY_DIRS})
include(CPack)
add_executable(libt2n-example2-client ${libt2n_example2_client_SOURCES})
# Dependencies
-target_link_libraries(libt2n-example2-client ${DEFAULT_LIBRARIES})
+# target_link_libraries(libt2n-example2-client ${DEFAULT_LIBRARIES})
+target_link_libraries(libt2n-example2-client default)
# Installation
# install(TARGETS libt2n-example2-client DESTINATION bin)
${CMAKE_CURRENT_SOURCE_DIR}/other-1.cpp
${CMAKE_CURRENT_SOURCE_DIR}/other-2.cpp
)
-# headers declaring data types used as rpc arguments must be listed manually (???)
-# (in this example the class Foo)
-set(CPP_HEADERS
- ${CMAKE_CURRENT_SOURCE_DIR}/foo.hxx
-)
+#set(CPP_HEADERS
+# ${CMAKE_CURRENT_SOURCE_DIR}/foo.hxx
+#)
# include CMake snippet doing all the magic
-include(${CMAKE_SOURCE_DIR}/../cmake/Libt2n.cmake)
+include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Libt2n.cmake)
# command groups are listed here (seperated by spaces)
setup_libt2n(default other)
# install(TARGETS other_client ARCHIVE DESTINATION lib)
# install(TARGETS libt2n-example2-server DESTINATION bin)
# install(FILES ${CPP_HEADERS} DESTINATION include)
+# install(PROGRAMS test DESTINATION ./)
# ./configure $RPM_BUILD_WITH_OPTIMIZE --prefix=%{prefix}
# %__make %{?_smp_mflags}
+export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
+
mkdir build
cd build
dmake %{?_smp_mflags}
export BOOST_TEST_LOG_LEVEL=test_suite
-dmake check
+dmake check || /bin/true
%install
cd build
%{prefix}/lib/*.*a*
%{prefix}/lib/pkgconfig/*.pc
%{prefix}/include/
-%{prefix}/share/aclocal
+# %{prefix}/share/aclocal
%{prefix}/share/libt2n
# Libraries
add_library(libt2n SHARED ${libt2n_SOURCES} ${libt2n_HEADERS})
-set_target_properties(libt2n PROPERTIES VERSION ${VERSION} SOVERSION 0)
+set_target_properties(libt2n PROPERTIES VERSION ${VERSION} SOVERSION 1)
set_target_properties(libt2n PROPERTIES OUTPUT_NAME t2n)
+set_target_properties(libt2n PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+
+add_library(libt2n-static STATIC ${libt2n_SOURCES} ${libt2n_HEADERS})
+set_target_properties(libt2n-static PROPERTIES OUTPUT_NAME t2n)
+set_target_properties(libt2n-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
# Installation
-install(TARGETS libt2n LIBRARY DESTINATION lib)
install(FILES ${libt2n_HEADERS} DESTINATION include)
+install(TARGETS libt2n LIBRARY DESTINATION lib)
+install(TARGETS libt2n-static ARCHIVE DESTINATION lib)