Switch time() calls to monotonic clock calls (#7597)
[libt2n] / CMakeLists.txt
index 3746728..25f4754 100644 (file)
@@ -1,6 +1,6 @@
 # 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}")
 
@@ -13,6 +13,13 @@ set(CPACK_SOURCE_GENERATOR             TGZ)
 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)
 
@@ -32,6 +39,7 @@ if(DOXYGEN_FOUND)
    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
@@ -118,14 +126,14 @@ configure_file(${CMAKE_SOURCE_DIR}/libt2n.pc.in ${CMAKE_BINARY_DIR}/libt2n.pc @O
 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)