Move stm32f429 demo to separate repository
[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     add_subdirectory(blockdev)
18     add_subdirectory(demos/generic)
19 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL  cortex-m4)
20     #...
21 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL  bf518)
22     add_definitions(-DCONFIG_HAVE_OWN_OFLAGS=1)
23     #...
24 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL  avrxmega7)
25     add_definitions(-DCONFIG_HAVE_OWN_OFLAGS=1)
26     #...
27 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL  msp430g2210)
28     add_definitions(-DCONFIG_DEBUG_PRINTF=0)
29     add_definitions(-DCONFIG_DEBUG_ASSERT=0)
30     add_definitions(-DCONFIG_HAVE_OWN_OFLAGS=1)
31     #...
32 else()
33     #Generic example target
34     set(BLOCKDEV_TYPE  linux)
35     add_definitions(-DCONFIG_EXTENT_FULL=1)
36     add_definitions(-DCONFIG_HAVE_OWN_OFLAGS=0)
37     add_definitions(-DCONFIG_HAVE_OWN_ERRNO=0)
38     add_definitions(-DCONFIG_HAVE_OWN_ASSERT=0)
39     add_definitions(-DCONFIG_BLOCK_DEV_CACHE_SIZE=16)
40     add_subdirectory(fs_test)
41     add_subdirectory(demos/generic)
42 endif()
43
44 add_subdirectory(blockdev)
45
46 #Library build
47 add_subdirectory(lwext4)
48 #Detect all possible warnings for lwext4 target
49 set_target_properties(lwext4 PROPERTIES COMPILE_FLAGS "-Wall -Wextra -pedantic")
50
51
52 #DISTRIBUTION
53 set(CPACK_PACKAGE_VERSION_MAJOR "0")
54 set(CPACK_PACKAGE_VERSION_MINOR "8")
55 set(CPACK_PACKAGE_VERSION_PATCH "0")
56 set(CPACK_SOURCE_GENERATOR "TBZ2")
57 set(CPACK_SOURCE_PACKAGE_FILE_NAME
58   "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
59 set(CPACK_SOURCE_IGNORE_FILES
60 "/build" ".git")
61 include(CPack)
62
63 add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)