diff options
author | yann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd> | 2012-04-08 15:18:12 (GMT) |
---|---|---|
committer | yann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd> | 2012-04-08 15:18:12 (GMT) |
commit | 6cedd1f252cd091be19f6a56526a5106b5140943 (patch) | |
tree | b90d6ff4752cc7cf8072d623e0da11c349b3bf47 /cmake | |
parent | ee1c2819476deb4865527e363bd5e773ec5b0ea1 (diff) | |
download | lz4-6cedd1f252cd091be19f6a56526a5106b5140943.zip lz4-6cedd1f252cd091be19f6a56526a5106b5140943.tar.gz lz4-6cedd1f252cd091be19f6a56526a5106b5140943.tar.bz2 |
Added : cmake configuration file, from Dmitry Cherepanov
git-svn-id: https://lz4.googlecode.com/svn/trunk@62 650e7d94-2a16-8b24-b05c-7c0b3f6821cd
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/CMakeLists.txt | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt new file mode 100644 index 0000000..345a6f4 --- /dev/null +++ b/cmake/CMakeLists.txt @@ -0,0 +1,52 @@ +PROJECT(LZ4)
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "ASN.1 Compiler")
+set(CPACK_PACKAGE_VERSION_MAJOR 0)
+set(CPACK_PACKAGE_VERSION_MINOR 0)
+set(CPACK_PACKAGE_VERSION_PATCH r51)
+#set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_BINARY_DIR}/COPYING_LGPL)
+ set(VERSION_STRING " \"${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}\" ")
+include(CPack)
+
+
+cmake_minimum_required (VERSION 2.6)
+INCLUDE (CheckTypeSize)
+check_type_size("void *" SIZEOF_VOID_P)
+IF( ${SIZEOF_VOID_P} STREQUAL "8" )
+ set (CMAKE_SYSTEM_PROCESSOR "64bit")
+ MESSAGE( STATUS "64 bit architecture detected size of void * is " ${SIZEOF_VOID_P})
+ENDIF()
+
+
+set(SRC_DIR ../)
+set(LZ4_SRCS_LIB ${SRC_DIR}lz4.c ${SRC_DIR}lz4.h )
+set(LZ4_SRCS ${LZ4_SRCS_LIB} ${SRC_DIR}bench.c ${SRC_DIR}lz4demo.c )
+
+# EXECUTABLES FOR 32 Bit and 64 versions
+if(CMAKE_SYSTEM_PROCESSOR STREQUAL "64bit")
+ add_executable(lz4demo64 ${LZ4_SRCS})
+ install(TARGETS lz4demo64 RUNTIME DESTINATION "./")
+endif()
+
+ add_executable(lz4demo32 ${LZ4_SRCS})
+ install(TARGETS lz4demo32 RUNTIME DESTINATION "./")
+
+if(CMAKE_SYSTEM_PROCESSOR STREQUAL "64bit")
+SET_TARGET_PROPERTIES(lz4demo32 PROPERTIES
+ COMPILE_FLAGS PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
+endif()
+
+
+#warnings
+
+ADD_DEFINITIONS("-Wall")
+ADD_DEFINITIONS("-W")
+ADD_DEFINITIONS("-Wundef")
+ADD_DEFINITIONS("-Wcast-align")
+ADD_DEFINITIONS("-Wno-implicit-function-declaration")
+ADD_DEFINITIONS("-Os -march=native -std=c99")
+INCLUDE_DIRECTORIES (${SRC_DIR})
+
+
+#target_link_libraries(lz4 ${LZ4_SRCS_LIB})
+
+
|