diff options
| author | gkostka <kostka.grzegorz@gmail.com> | 2016-03-31 20:43:31 +0200 |
|---|---|---|
| committer | gkostka <kostka.grzegorz@gmail.com> | 2016-03-31 22:53:44 +0200 |
| commit | 0202d13dec910d55acc5b92c290b9aaa72d8b691 (patch) | |
| tree | 8536346f7ffc7e970d754d127bb82633d41862a3 | |
| parent | 5e4248f2e98ac13f30c2b84a7e444691276b85ea (diff) | |
CMake: add library & headers to make install target
| -rw-r--r-- | CMakeLists.txt | 1 | ||||
| -rw-r--r-- | fs_test/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/CMakeLists.txt | 8 |
3 files changed, 9 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a5fcf3..1ffb96a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,7 @@ elseif(LIB_ONLY) else() #Generic example target set(BLOCKDEV_TYPE linux) + 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) diff --git a/fs_test/CMakeLists.txt b/fs_test/CMakeLists.txt index 419e398..84760cf 100644 --- a/fs_test/CMakeLists.txt +++ b/fs_test/CMakeLists.txt @@ -29,3 +29,4 @@ install (TARGETS lwext4-client DESTINATION /usr/bin) install (TARGETS lwext4-generic DESTINATION /usr/bin) install (TARGETS lwext4-mkfs DESTINATION /usr/bin) install (TARGETS lwext4-mbr DESTINATION /usr/bin) + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 78b233d..82d6a6b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,9 +2,15 @@ #LIBRARY include_directories(.) aux_source_directory(. LWEXT4_SRC) -add_library(lwext4 ${LWEXT4_SRC}) +add_library(lwext4 STATIC ${LWEXT4_SRC}) + if (DEFINED SIZE) add_custom_target(lib_size ALL DEPENDS lwext4 COMMAND ${SIZE} liblwext4.a) else() endif() + +if (DEFINED INSTALL_LIB) +INSTALL(TARGETS lwext4 DESTINATION /usr/local/lib) +INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/include/. DESTINATION /usr/local/include/lwext4) +endif()
\ No newline at end of file |
