summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt30
1 files changed, 28 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 19fa71c..2adae92 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,6 @@
-project(fastwriter)
+project(fastwriter C)
+set(RELEASE "0")
set(FASTWRITER_VERSION "0.0.2")
set(FASTWRITER_ABI_VERSION "0")
@@ -60,12 +61,36 @@ set(PACKAGE_TARNAME "${TARNAME}")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "http://ufo.kit.edu/ufo/newticket")
+
+set(CPACK_SOURCE_GENERATOR "TBZ2")
+set(CPACK_PACKAGE_CONTACT "Suren A. Chilingaryan <csa@suren.me>")
+if (${RELEASE} GREATER 0)
+ set(CPACK_PACKAGE_VERSION "${PACKAGE_VERSION}.${RELEASE}")
+else (${RELEASE} GREATER 0)
+ set(CPACK_PACKAGE_VERSION "${PACKAGE_VERSION}")
+endif (${RELEASE} GREATER 0)
+set(CPACK_SOURCE_IGNORE_FILES "/.bzr/;CMakeFiles;_CPack_Packages;cmake_install.cmake;CPack.*.cmake;CMakeCache.txt;install_manifest.txt;config.h$;.pc$;Makefile;.tar.bz2$;~$;${CPACK_SOURCE_IGNORE_FILES}")
+set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}")
+include(CPack)
+
+add_custom_target(dist_clean COMMAND ${CMAKE_MAKE_PROGRAM} clean WORKING_DIRECTORY ${CMAKE_CURRENT_DIR})
+add_custom_target(dist DEPENDS dist_clean COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
+
+
if(NOT DEFINED BIN_INSTALL_DIR)
set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
endif(NOT DEFINED BIN_INSTALL_DIR)
+if(NOT DEFINED LIB_SUFFIX)
+ if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set(LIB_SUFFIX "64")
+ else (CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set(LIB_SUFFIX "")
+ endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
+endif(NOT DEFINED LIB_SUFFIX)
+
if(NOT DEFINED LIB_INSTALL_DIR)
- set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+ set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
endif(NOT DEFINED LIB_INSTALL_DIR)
if(NOT DEFINED INCLUDE_INSTALL_DIR)
@@ -77,6 +102,7 @@ if(NOT DEFINED LOCALE_INSTALL_DIR)
endif(NOT DEFINED LOCALE_INSTALL_DIR)
configure_file(fastwriter.pc.in ${CMAKE_CURRENT_BINARY_DIR}/fastwriter.pc)
+configure_file(fastwriter.spec.in ${CMAKE_CURRENT_BINARY_DIR}/fastwriter.spec)
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
install(TARGETS fastwriter