Update directory tree.
[lwext4.git] / CMakeLists.txt
1 project(lwext4 C)\r
2 cmake_minimum_required(VERSION 2.8)\r
3 \r
4 \r
5 #LIBRARY\r
6 include_directories(. lwext4)\r
7 aux_source_directory(lwext4 LWEXT4_SRC)\r
8 add_library(lwext4  ${LWEXT4_SRC})\r
9 \r
10 \r
11 #EXECUTABLE\r
12 \r
13 if(CMAKE_SYSTEM_PROCESSOR STREQUAL  cortex-m3)\r
14 #Library size print\r
15 add_custom_target(size ALL DEPENDS lwext4 COMMAND ${SIZE} -B liblwext4.a)\r
16 \r
17 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL  cortex-m4)\r
18 #Library size print\r
19 add_custom_target(size ALL DEPENDS lwext4 COMMAND ${SIZE} -B liblwext4.a)\r
20 \r
21 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL  bf518)\r
22 #Library size print\r
23 add_custom_target(size ALL DEPENDS lwext4 COMMAND ${SIZE} -B liblwext4.a)\r
24 \r
25 else()\r
26 #Generic example target\r
27 include_directories(blockdev/filedev)\r
28 aux_source_directory(blockdev/filedev FILEDEV_SRC)\r
29 aux_source_directory(demos/generic GENERIC_SRC)\r
30 add_executable(fileimage_demo ${GENERIC_SRC} ${FILEDEV_SRC})\r
31 target_link_libraries(fileimage_demo lwext4)\r
32 add_custom_target(size ALL DEPENDS lwext4 COMMAND size -B liblwext4.a)\r
33 endif()\r
34 \r
35 #DISTRIBUTION\r
36 set(CPACK_PACKAGE_VERSION_MAJOR "0")\r
37 set(CPACK_PACKAGE_VERSION_MINOR "1")\r
38 set(CPACK_PACKAGE_VERSION_PATCH "1")\r
39 set(CPACK_SOURCE_GENERATOR "TBZ2")\r
40 set(CPACK_SOURCE_PACKAGE_FILE_NAME\r
41   "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")\r
42 set(CPACK_SOURCE_IGNORE_FILES\r
43 "/build")\r
44 include(CPack)\r
45 \r
46 add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)\r