2 cmake_minimum_required(VERSION 2.8)
5 include_directories(lwext4)
6 include_directories(blockdev/filedev)
7 include_directories(blockdev/filedev_win)
9 set(BLOCKDEV_TYPE none)
11 add_definitions(-DVERSION="${VERSION}")
14 if (CMAKE_SYSTEM_PROCESSOR STREQUAL cortex-m0)
16 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL cortex-m3)
18 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL arm-sim)
20 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL cortex-m4)
22 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL bf518)
24 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL avrxmega7)
25 add_definitions(-DCONFIG_HAVE_OWN_ERRNO=1)
26 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL msp430g2210)
27 add_definitions(-DCONFIG_DEBUG_PRINTF=0)
28 add_definitions(-DCONFIG_DEBUG_ASSERT=0)
31 add_definitions(-DCONFIG_DEBUG_PRINTF=0)
32 add_definitions(-DCONFIG_DEBUG_ASSERT=0)
33 add_definitions(-DCONFIG_HAVE_OWN_OFLAGS=1)
34 add_definitions(-DCONFIG_HAVE_OWN_ERRNO=0)
35 add_definitions(-DCONFIG_BLOCK_DEV_CACHE_SIZE=16)
37 #Generic example target
38 set(BLOCKDEV_TYPE linux)
39 add_definitions(-DCONFIG_HAVE_OWN_OFLAGS=0)
40 add_definitions(-DCONFIG_HAVE_OWN_ERRNO=0)
41 add_definitions(-DCONFIG_HAVE_OWN_ASSERT=0)
42 add_definitions(-DCONFIG_BLOCK_DEV_CACHE_SIZE=16)
43 add_subdirectory(fs_test)
46 add_subdirectory(blockdev)
49 add_subdirectory(lwext4)
50 #Detect all possible warnings for lwext4 target
51 if (NOT CMAKE_COMPILER_IS_GNUCC)
52 set_target_properties(lwext4 PROPERTIES COMPILE_FLAGS "")
54 set_target_properties(lwext4 PROPERTIES COMPILE_FLAGS "-Wall -Wextra -pedantic")
58 set(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
59 set(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
60 set(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}")
61 set(CPACK_SOURCE_GENERATOR "TBZ2")
62 set(CPACK_SOURCE_PACKAGE_FILE_NAME
63 "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
64 set(CPACK_SOURCE_IGNORE_FILES
69 add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)