Code format in bcache & blockdev
[lwext4.git] / CMakeLists.txt
1 project(lwext4 C)
2 cmake_minimum_required(VERSION 2.8)
3
4
5 include_directories(lwext4)
6 include_directories(blockdev/filedev)
7 include_directories(blockdev/filedev_win)
8
9 set(BLOCKDEV_TYPE  none)
10
11 #Examples
12 if    (CMAKE_SYSTEM_PROCESSOR STREQUAL  cortex-m0)
13     #...
14 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL  cortex-m3)
15     #...
16 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL  arm-sim)
17     #...
18 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL  cortex-m4)
19     #...
20 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL  bf518)
21     add_definitions(-DCONFIG_HAVE_OWN_OFLAGS=1)
22     #...
23 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL  avrxmega7)
24     add_definitions(-DCONFIG_HAVE_OWN_OFLAGS=1)
25     #...
26 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL  msp430g2210)
27     add_definitions(-DCONFIG_DEBUG_PRINTF=0)
28     add_definitions(-DCONFIG_DEBUG_ASSERT=0)
29     add_definitions(-DCONFIG_HAVE_OWN_OFLAGS=1)
30     #...
31 else()
32     #Generic example target
33     set(BLOCKDEV_TYPE  linux)
34     add_definitions(-DCONFIG_EXTENT_FULL=1)
35     add_definitions(-DCONFIG_HAVE_OWN_OFLAGS=0)
36     add_definitions(-DCONFIG_HAVE_OWN_ERRNO=0)
37     add_definitions(-DCONFIG_HAVE_OWN_ASSERT=0)
38     add_definitions(-DCONFIG_BLOCK_DEV_CACHE_SIZE=16)
39     add_subdirectory(fs_test)
40 endif()
41
42 add_subdirectory(blockdev)
43
44 #Library build
45 add_subdirectory(lwext4)
46 #Detect all possible warnings for lwext4 target
47 set_target_properties(lwext4 PROPERTIES COMPILE_FLAGS "-Wall -Wextra -pedantic")
48
49
50 #DISTRIBUTION
51 set(CPACK_PACKAGE_VERSION_MAJOR "0")
52 set(CPACK_PACKAGE_VERSION_MINOR "8")
53 set(CPACK_PACKAGE_VERSION_PATCH "0")
54 set(CPACK_SOURCE_GENERATOR "TBZ2")
55 set(CPACK_SOURCE_PACKAGE_FILE_NAME
56   "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
57 set(CPACK_SOURCE_IGNORE_FILES
58 "/build" ".git")
59 include(CPack)
60
61 add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)