Fix whitespace in CMakeLists.txt
- all spaces no tabs
- indent with 4 spaces everywhere
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 03969f4..a89a9bc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,26 +4,26 @@
string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}")
if(CMAKE_COMPILER_IS_GNUCC)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings -Wlogical-op")
- set(CMAKE_C_FLAGS_RELEASE "-O2")
- set(CMAKE_C_FLAGS_DEBUG "-O0 -g3")
- set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage")
- set(CMAKE_C_FLAGS_ASAN "-Werror -fsanitize=address -fno-common -O3")
- set(CMAKE_C_FLAGS_ASANDBG "-Werror -fsanitize=address -fno-common -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls ")
- set(CMAKE_C_FLAGS_CHECK "-Werror -Os")
- set(CMAKE_C_FLAGS_CHECKFULL "${CMAKE_C_FLAGS_CHECK} -Wcast-qual")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings -Wlogical-op")
+ set(CMAKE_C_FLAGS_RELEASE "-O2")
+ set(CMAKE_C_FLAGS_DEBUG "-O0 -g3")
+ set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage")
+ set(CMAKE_C_FLAGS_ASAN "-Werror -fsanitize=address -fno-common -O3")
+ set(CMAKE_C_FLAGS_ASANDBG "-Werror -fsanitize=address -fno-common -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls ")
+ set(CMAKE_C_FLAGS_CHECK "-Werror -Os")
+ set(CMAKE_C_FLAGS_CHECKFULL "${CMAKE_C_FLAGS_CHECK} -Wcast-qual")
endif(CMAKE_COMPILER_IS_GNUCC)
if(CMAKE_COMPILER_IS_CLANG)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith")
- set(CMAKE_C_FLAGS_RELEASE "-O2")
- set(CMAKE_C_FLAGS_DEBUG "-O0 -g3")
- set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage")
- set(CMAKE_C_FLAGS_ASAN "-Werror -fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover -O3")
- set(CMAKE_C_FLAGS_ASANDBG "-Werror -fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls ")
- set(CMAKE_C_FLAGS_MEMSAN "-Werror -fsanitize=memory -O3")
- set(CMAKE_C_FLAGS_MEMSANDBG "-Werror -fsanitize=memory -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2")
- set(CMAKE_C_FLAGS_CHECK "-Werror -Os")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith")
+ set(CMAKE_C_FLAGS_RELEASE "-O2")
+ set(CMAKE_C_FLAGS_DEBUG "-O0 -g3")
+ set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage")
+ set(CMAKE_C_FLAGS_ASAN "-Werror -fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover -O3")
+ set(CMAKE_C_FLAGS_ASANDBG "-Werror -fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls ")
+ set(CMAKE_C_FLAGS_MEMSAN "-Werror -fsanitize=memory -O3")
+ set(CMAKE_C_FLAGS_MEMSANDBG "-Werror -fsanitize=memory -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2")
+ set(CMAKE_C_FLAGS_CHECK "-Werror -Os")
endif(CMAKE_COMPILER_IS_CLANG)
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE}
@@ -31,9 +31,9 @@
FORCE)
if(CMAKE_BUILD_TYPE STREQUAL "Coverage")
- if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
- set(CMAKE_SHARED_LINKER_FLAGS "--coverage")
- endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
+ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
+ set(CMAKE_SHARED_LINKER_FLAGS "--coverage")
+ endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
endif(CMAKE_BUILD_TYPE STREQUAL "Coverage")
option(USE_PKCS11_HELPER_LIBRARY "Build mbed TLS with the pkcs11-helper library." OFF)
@@ -43,65 +43,65 @@
option(ENABLE_TESTING "Build mbed TLS tests." ON)
if(ENABLE_TESTING)
- enable_testing()
+ enable_testing()
endif()
if(LIB_INSTALL_DIR)
else()
-set(LIB_INSTALL_DIR lib)
+ set(LIB_INSTALL_DIR lib)
endif()
include_directories(include/)
if(ENABLE_ZLIB_SUPPORT)
- find_package(ZLIB)
+ find_package(ZLIB)
- if(ZLIB_FOUND)
- include_directories(${ZLIB_INCLUDE_DIR})
- endif(ZLIB_FOUND)
+ if(ZLIB_FOUND)
+ include_directories(${ZLIB_INCLUDE_DIR})
+ endif(ZLIB_FOUND)
endif(ENABLE_ZLIB_SUPPORT)
add_subdirectory(library)
add_subdirectory(include)
if(ENABLE_TESTING)
- if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
- add_subdirectory(tests)
- endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
+ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
+ add_subdirectory(tests)
+ endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
endif()
if(ENABLE_PROGRAMS)
- add_subdirectory(programs)
+ add_subdirectory(programs)
endif()
ADD_CUSTOM_TARGET(apidoc
- COMMAND doxygen doxygen/mbedtls.doxyfile
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+ COMMAND doxygen doxygen/mbedtls.doxyfile
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
if(ENABLE_TESTING)
- ADD_CUSTOM_TARGET(covtest
- COMMAND make test
- COMMAND programs/test/selftest
- COMMAND cd tests && ./compat.sh
- COMMAND cd tests && ./ssl-opt.sh
+ ADD_CUSTOM_TARGET(covtest
+ COMMAND make test
+ COMMAND programs/test/selftest
+ COMMAND cd tests && ./compat.sh
+ COMMAND cd tests && ./ssl-opt.sh
)
- ADD_CUSTOM_TARGET(lcov
- COMMAND rm -rf Coverage
- COMMAND lcov --capture --initial --directory library/CMakeFiles/mbedtls.dir -o files.info
- COMMAND lcov --capture --directory library/CMakeFiles/mbedtls.dir -o tests.info
- COMMAND lcov --add-tracefile files.info --add-tracefile tests.info -o all.info
- COMMAND lcov --remove all.info -o final.info '*.h'
- COMMAND gendesc tests/Descriptions.txt -o descriptions
- COMMAND genhtml --title "mbed TLS" --description-file descriptions --keep-descriptions --legend --no-branch-coverage -o Coverage final.info
- COMMAND rm -f files.info tests.info all.info final.info descriptions
+ ADD_CUSTOM_TARGET(lcov
+ COMMAND rm -rf Coverage
+ COMMAND lcov --capture --initial --directory library/CMakeFiles/mbedtls.dir -o files.info
+ COMMAND lcov --capture --directory library/CMakeFiles/mbedtls.dir -o tests.info
+ COMMAND lcov --add-tracefile files.info --add-tracefile tests.info -o all.info
+ COMMAND lcov --remove all.info -o final.info '*.h'
+ COMMAND gendesc tests/Descriptions.txt -o descriptions
+ COMMAND genhtml --title "mbed TLS" --description-file descriptions --keep-descriptions --legend --no-branch-coverage -o Coverage final.info
+ COMMAND rm -f files.info tests.info all.info final.info descriptions
)
- ADD_CUSTOM_TARGET(memcheck
- COMMAND sed -i.bak s+/usr/bin/valgrind+`which valgrind`+ DartConfiguration.tcl
- COMMAND ctest -O memcheck.log -D ExperimentalMemCheck
- COMMAND tail -n1 memcheck.log | grep 'Memory checking results:' > /dev/null
- COMMAND rm -f memcheck.log
- COMMAND mv DartConfiguration.tcl.bak DartConfiguration.tcl
+ ADD_CUSTOM_TARGET(memcheck
+ COMMAND sed -i.bak s+/usr/bin/valgrind+`which valgrind`+ DartConfiguration.tcl
+ COMMAND ctest -O memcheck.log -D ExperimentalMemCheck
+ COMMAND tail -n1 memcheck.log | grep 'Memory checking results:' > /dev/null
+ COMMAND rm -f memcheck.log
+ COMMAND mv DartConfiguration.tcl.bak DartConfiguration.tcl
)
endif()
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index ce0ed6b..985a353 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -2,9 +2,9 @@
if(INSTALL_MBEDTLS_HEADERS)
-file(GLOB headers "mbedtls/*.h")
+ file(GLOB headers "mbedtls/*.h")
-install(FILES ${headers}
+ install(FILES ${headers}
DESTINATION include/mbedtls
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
index a0fadad..585e75e 100644
--- a/library/CMakeLists.txt
+++ b/library/CMakeLists.txt
@@ -87,62 +87,62 @@
)
if(WIN32)
-set(libs ws2_32)
+ set(libs ws2_32)
endif(WIN32)
if(CMAKE_COMPILER_IS_GNUCC)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes")
endif(CMAKE_COMPILER_IS_GNUCC)
if(CMAKE_COMPILER_IS_CLANG)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes -Wdocumentation -Wno-documentation-deprecated-sync -Wunreachable-code")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes -Wdocumentation -Wno-documentation-deprecated-sync -Wunreachable-code")
endif(CMAKE_COMPILER_IS_CLANG)
if (NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY)
- message(FATAL_ERROR "Need to choose static or shared mbedtls build!")
+ message(FATAL_ERROR "Need to choose static or shared mbedtls build!")
endif(NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY)
if(USE_STATIC_MBEDTLS_LIBRARY AND USE_SHARED_MBEDTLS_LIBRARY)
- # if we build both static an shared, then let
- # tests and programs link to the shared lib target
- set(mbedtls_static_target "mbedtls_static")
+ # if we build both static an shared, then let
+ # tests and programs link to the shared lib target
+ set(mbedtls_static_target "mbedtls_static")
elseif(USE_STATIC_MBEDTLS_LIBRARY)
- set(mbedtls_static_target "mbedtls")
+ set(mbedtls_static_target "mbedtls")
endif()
if(USE_STATIC_MBEDTLS_LIBRARY)
- add_library(${mbedtls_static_target} STATIC ${src})
- set_target_properties(${mbedtls_static_target} PROPERTIES OUTPUT_NAME mbedtls)
- target_link_libraries(${mbedtls_static_target} ${libs})
+ add_library(${mbedtls_static_target} STATIC ${src})
+ set_target_properties(${mbedtls_static_target} PROPERTIES OUTPUT_NAME mbedtls)
+ target_link_libraries(${mbedtls_static_target} ${libs})
- if(ZLIB_FOUND)
- target_link_libraries(${mbedtls_static_target} ${ZLIB_LIBRARIES})
- endif(ZLIB_FOUND)
+ if(ZLIB_FOUND)
+ target_link_libraries(${mbedtls_static_target} ${ZLIB_LIBRARIES})
+ endif(ZLIB_FOUND)
- if(LINK_WITH_PTHREAD)
+ if(LINK_WITH_PTHREAD)
target_link_libraries(${mbedtls_static_target} pthread)
- endif()
+ endif()
- install(TARGETS ${mbedtls_static_target}
- DESTINATION ${LIB_INSTALL_DIR}
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+ install(TARGETS ${mbedtls_static_target}
+ DESTINATION ${LIB_INSTALL_DIR}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endif()
if(USE_SHARED_MBEDTLS_LIBRARY)
- add_library(mbedtls SHARED ${src})
- set_target_properties(mbedtls PROPERTIES VERSION 1.4.0 SOVERSION 8)
+ add_library(mbedtls SHARED ${src})
+ set_target_properties(mbedtls PROPERTIES VERSION 1.4.0 SOVERSION 8)
- target_link_libraries(mbedtls ${libs})
+ target_link_libraries(mbedtls ${libs})
- if(ZLIB_FOUND)
- target_link_libraries(mbedtls ${ZLIB_LIBRARIES})
- endif(ZLIB_FOUND)
+ if(ZLIB_FOUND)
+ target_link_libraries(mbedtls ${ZLIB_LIBRARIES})
+ endif(ZLIB_FOUND)
- if(LINK_WITH_PTHREAD)
+ if(LINK_WITH_PTHREAD)
target_link_libraries(mbedtls pthread)
- endif()
+ endif()
- install(TARGETS mbedtls
- DESTINATION ${LIB_INSTALL_DIR}
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+ install(TARGETS mbedtls
+ DESTINATION ${LIB_INSTALL_DIR}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endif(USE_SHARED_MBEDTLS_LIBRARY)
diff --git a/programs/ssl/CMakeLists.txt b/programs/ssl/CMakeLists.txt
index a2f5dc2..1e65633 100644
--- a/programs/ssl/CMakeLists.txt
+++ b/programs/ssl/CMakeLists.txt
@@ -2,18 +2,18 @@
find_package(Threads)
set(libs
- mbedtls
+ mbedtls
)
set(targets
- dtls_client
- dtls_server
- ssl_client1
- ssl_client2
- ssl_server
- ssl_fork_server
- ssl_mail_client
- mini_client
+ dtls_client
+ dtls_server
+ ssl_client1
+ ssl_client2
+ ssl_server
+ ssl_fork_server
+ ssl_mail_client
+ mini_client
)
if(USE_PKCS11_HELPER_LIBRARY)
diff --git a/programs/test/CMakeLists.txt b/programs/test/CMakeLists.txt
index d0116c5..0ed7145 100644
--- a/programs/test/CMakeLists.txt
+++ b/programs/test/CMakeLists.txt
@@ -1,5 +1,5 @@
set(libs
- mbedtls
+ mbedtls
)
if(USE_PKCS11_HELPER_LIBRARY)
diff --git a/programs/util/CMakeLists.txt b/programs/util/CMakeLists.txt
index f302de7..f9b6604 100644
--- a/programs/util/CMakeLists.txt
+++ b/programs/util/CMakeLists.txt
@@ -1,5 +1,5 @@
set(libs
- mbedtls
+ mbedtls
)
add_executable(strerror strerror.c)
diff --git a/programs/x509/CMakeLists.txt b/programs/x509/CMakeLists.txt
index 4e39e45..39b8b5b 100644
--- a/programs/x509/CMakeLists.txt
+++ b/programs/x509/CMakeLists.txt
@@ -1,5 +1,5 @@
set(libs
- mbedtls
+ mbedtls
)
if(USE_PKCS11_HELPER_LIBRARY)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 63dfead..23d662d 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,5 +1,5 @@
set(libs
- mbedtls
+ mbedtls
)
if(USE_PKCS11_HELPER_LIBRARY)
@@ -12,9 +12,9 @@
function(add_test_suite suite_name)
if(ARGV1)
- set(data_name ${ARGV1})
+ set(data_name ${ARGV1})
else()
- set(data_name ${suite_name})
+ set(data_name ${suite_name})
endif()
add_custom_command(