# Project
project(libt2n)
-set(VERSION 0.6)
+set(VERSION 0.8)
set(PROTOCOL_VERSION 1) # protocol version used (integers, increase version if incompatible)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
set(CPACK_SOURCE_IGNORE_FILES "~$;\\\\.git;build;build-rpm")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION}")
+# "make dist" target
+set(ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${VERSION})
+add_custom_target(dist
+ COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD
+ | bzip2 > ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+
# Find external packages
include(FindPkgConfig)
link_directories(${XMLPP_LIBRARY_DIRS})
# Documentation
+option(DOCUMENTATION "Generate API documentation with Doxygen" ON)
find_package(Doxygen)
-if(DOXYGEN_FOUND)
+if(DOXYGEN_FOUND AND DOCUMENTATION)
# Find doxy config
message(STATUS "Doxygen found.")
set(DOXY_DIR "${CMAKE_SOURCE_DIR}/doc")
set(DOXY_CONFIG "${DOXY_DIR}/Doxyfile.in")
# Copy doxy.config.in
+ set(top_srcdir ${CMAKE_SOURCE_DIR})
configure_file("${DOXY_CONFIG}" "${CMAKE_BINARY_DIR}/doxy.config")
# Create doc directory
add_custom_target(docs ALL DEPENDS ${CMAKE_BINARY_DIR}/doc/html/index.html)
message(STATUS "Generating API documentation with Doxygen.")
-else(DOXYGEN_FOUND)
+else(DOXYGEN_FOUND AND DOCUMENTATION)
message(STATUS "Not generating API documentation.")
-endif(DOXYGEN_FOUND)
+endif(DOXYGEN_FOUND AND DOCUMENTATION)
# Spec file
configure_file(${CMAKE_SOURCE_DIR}/libt2n.spec.in ${CMAKE_SOURCE_DIR}/libt2n.spec @ONLY)
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)