Merge pull request #49 from sirocyl/patch-1
[lwext4.git] / CMakeLists.txt
index 1a5fcf3d8a1bdbdecc6556be1b3af7df5d3a265a..eec0993b08f57f885d04e0d3083047b99f631357 100644 (file)
@@ -1,7 +1,8 @@
 project(lwext4 C)
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.4)
 
 
+include_directories(include)
 include_directories(${PROJECT_BINARY_DIR}/include)
 include_directories(blockdev/filedev)
 include_directories(blockdev/filedev_win)
@@ -15,11 +16,11 @@ add_definitions(-DVERSION="${VERSION}")
 if    (CMAKE_SYSTEM_PROCESSOR STREQUAL  cortex-m0)
     #...
 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL  cortex-m3)
-    #...
+    add_definitions(-DCONFIG_UNALIGNED_ACCESS=1)
 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL  arm-sim)
     #...
 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL  cortex-m4)
-    #...
+    add_definitions(-DCONFIG_UNALIGNED_ACCESS=1)
 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL  bf518)
     #...
 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL  avrxmega7)
@@ -36,7 +37,12 @@ elseif(LIB_ONLY)
     add_definitions(-DCONFIG_BLOCK_DEV_CACHE_SIZE=16)
 else()
     #Generic example target
-    set(BLOCKDEV_TYPE  linux)
+    if (WIN32)
+      set(BLOCKDEV_TYPE  windows)
+    else()
+      set(BLOCKDEV_TYPE  linux)
+    endif()
+    set (INSTALL_LIB 1)
     add_definitions(-DCONFIG_HAVE_OWN_OFLAGS=0)
     add_definitions(-DCONFIG_HAVE_OWN_ERRNO=0)
     add_definitions(-DCONFIG_HAVE_OWN_ASSERT=0)
@@ -79,12 +85,6 @@ else()
     set_target_properties(lwext4 PROPERTIES COMPILE_FLAGS "-Wall -Wextra -pedantic")
 endif()
 
-#Config file generation
-file(
-    COPY include
-    DESTINATION .
-)
-
 #DISTRIBUTION
 set(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
 set(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")