From 547f73d66f8e65407db93520c99a24fc168520ec Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Wed, 5 Jan 2011 15:07:54 +0000
Subject: [PATCH] - Added install targets to the CMake files
---
CMakeLists.txt | 1 +
include/CMakeLists.txt | 5 +++++
library/CMakeLists.txt | 4 ++++
programs/aes/CMakeLists.txt | 4 ++++
programs/hash/CMakeLists.txt | 4 ++++
programs/pkey/CMakeLists.txt | 4 ++++
programs/ssl/CMakeLists.txt | 4 ++++
programs/test/CMakeLists.txt | 3 +++
programs/x509/CMakeLists.txt | 4 ++++
9 files changed, 33 insertions(+)
create mode 100644 include/CMakeLists.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 589fb043f..3d42fa4b5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,5 +14,6 @@ endif(CMAKE_BUILD_TYPE STREQUAL "Coverage")
include_directories(include/)
add_subdirectory(library)
+add_subdirectory(include)
add_subdirectory(tests)
add_subdirectory(programs)
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
new file mode 100644
index 000000000..c60cd6bf7
--- /dev/null
+++ b/include/CMakeLists.txt
@@ -0,0 +1,5 @@
+FILE(GLOB headers "polarssl/*.h")
+
+INSTALL(FILES ${headers}
+ DESTINATION include/polarssl
+ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
index 9e84ca65b..f75629b2e 100644
--- a/library/CMakeLists.txt
+++ b/library/CMakeLists.txt
@@ -26,3 +26,7 @@ add_library(polarssl STATIC
x509parse.c
xtea.c
)
+
+INSTALL(TARGETS polarssl
+ DESTINATION lib
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
diff --git a/programs/aes/CMakeLists.txt b/programs/aes/CMakeLists.txt
index 1daad58da..52b5e1223 100644
--- a/programs/aes/CMakeLists.txt
+++ b/programs/aes/CMakeLists.txt
@@ -1,2 +1,6 @@
add_executable(aescrypt2 aescrypt2.c)
target_link_libraries(aescrypt2 polarssl)
+
+INSTALL(TARGETS aescrypt2
+ DESTINATION "bin"
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
diff --git a/programs/hash/CMakeLists.txt b/programs/hash/CMakeLists.txt
index e9af5227a..0341c8b3c 100644
--- a/programs/hash/CMakeLists.txt
+++ b/programs/hash/CMakeLists.txt
@@ -9,3 +9,7 @@ target_link_libraries(sha1sum polarssl)
add_executable(sha2sum sha2sum.c)
target_link_libraries(sha2sum polarssl)
+
+INSTALL(TARGETS hello md5sum sha1sum sha2sum
+ DESTINATION "bin"
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
diff --git a/programs/pkey/CMakeLists.txt b/programs/pkey/CMakeLists.txt
index 7190ee400..d81366808 100644
--- a/programs/pkey/CMakeLists.txt
+++ b/programs/pkey/CMakeLists.txt
@@ -18,3 +18,7 @@ target_link_libraries(rsa_sign polarssl)
add_executable(rsa_verify rsa_verify.c)
target_link_libraries(rsa_verify polarssl)
+
+INSTALL(TARGETS dh_client dh_genprime dh_server mpi_demo rsa_genkey rsa_sign rsa_verify
+ DESTINATION "bin"
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
diff --git a/programs/ssl/CMakeLists.txt b/programs/ssl/CMakeLists.txt
index 8eb6d3cac..14b1d3eb3 100644
--- a/programs/ssl/CMakeLists.txt
+++ b/programs/ssl/CMakeLists.txt
@@ -6,3 +6,7 @@ target_link_libraries(ssl_client2 polarssl)
add_executable(ssl_server ssl_server.c)
target_link_libraries(ssl_server polarssl)
+
+INSTALL(TARGETS ssl_client1 ssl_client2 ssl_server
+ DESTINATION "bin"
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
diff --git a/programs/test/CMakeLists.txt b/programs/test/CMakeLists.txt
index 95c01b43d..9cd43baaf 100644
--- a/programs/test/CMakeLists.txt
+++ b/programs/test/CMakeLists.txt
@@ -10,3 +10,6 @@ target_link_libraries(ssl_test polarssl)
add_executable(ssl_cert_test ssl_cert_test.c)
target_link_libraries(ssl_cert_test polarssl)
+INSTALL(TARGETS selftest benchmark ssl_test ssl_cert_test
+ DESTINATION "bin"
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
diff --git a/programs/x509/CMakeLists.txt b/programs/x509/CMakeLists.txt
index 3078fd599..29e5854ae 100644
--- a/programs/x509/CMakeLists.txt
+++ b/programs/x509/CMakeLists.txt
@@ -1,2 +1,6 @@
add_executable(cert_app cert_app.c)
target_link_libraries(cert_app polarssl)
+
+INSTALL(TARGETS cert_app
+ DESTINATION "bin"
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)