From 5d8a1cf7155130bd8101090d7e1d0c2f90d9b123 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 10 Jul 2014 22:06:10 -0500 Subject: add initial CMake and Visual Studio build support This moves the compatibility include files from include to include/compat so we can use the awful MS C compiler <../include/> trick to emulate the GNU #include_next extension. This also removes a few old compat files we do not need anymore. --- apps/CMakeLists.txt | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++ apps/Makefile.am | 1 + 2 files changed, 85 insertions(+) create mode 100644 apps/CMakeLists.txt (limited to 'apps') diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt new file mode 100644 index 0000000..13d6e9c --- /dev/null +++ b/apps/CMakeLists.txt @@ -0,0 +1,84 @@ +include_directories( + . + ../include + ../include/compat +) + +set( + OPENSSL_SRC + apps.c + asn1pars.c + ca.c + ciphers.c + cms.c + crl.c + crl2p7.c + dgst.c + dh.c + dhparam.c + dsa.c + dsaparam.c + ec.c + ecparam.c + enc.c + engine.c + errstr.c + gendh.c + gendsa.c + genpkey.c + genrsa.c + nseq.c + ocsp.c + openssl.c + passwd.c + pkcs12.c + pkcs7.c + pkcs8.c + pkey.c + pkeyparam.c + pkeyutl.c + prime.c + rand.c + req.c + rsa.c + rsautl.c + s_cb.c + s_client.c + s_server.c + s_socket.c + s_time.c + sess_id.c + smime.c + speed.c + spkac.c + ts.c + verify.c + version.c + x509.c +) + +if(CMAKE_HOST_UNIX) + set(OPENSSL_SRC ${OPENSSL_SRC} apps_posix.c) + set(OPENSSL_SRC ${OPENSSL_SRC} certhash.c) +endif() + +if(CMAKE_HOST_WIN32) + set(OPENSSL_SRC ${OPENSSL_SRC} apps_win.c) + set(OPENSSL_SRC ${OPENSSL_SRC} certhash_disabled.c) + set(OPENSSL_SRC ${OPENSSL_SRC} poll_win.c) +endif() + +check_function_exists(strtonum HAVE_STRTONUM) +if(HAVE_STRTONUM) + add_definitions(-DHAVE_STRTONUM) +else() + set(OPENSSL_SRC ${OPENSSL_SRC} strtonum.c) +endif() + +set(OPENSSL_LIBS ssl crypto) +if(CMAKE_HOST_WIN32) + set(OPENSSL_LIBS ${OPENSSL_LIBS} ws2_32) +endif() + +add_executable(openssl ${OPENSSL_SRC}) +target_link_libraries(openssl ${OPENSSL_LIBS}) diff --git a/apps/Makefile.am b/apps/Makefile.am index 0547876..ce78b33 100644 --- a/apps/Makefile.am +++ b/apps/Makefile.am @@ -88,6 +88,7 @@ noinst_HEADERS += timeouts.h EXTRA_DIST = cert.pem EXTRA_DIST += openssl.cnf EXTRA_DIST += x509v3.cnf +EXTRA_DIST += CMakeLists.txt install-exec-hook: @if [ "@OPENSSLDIR@x" != "x" ]; then \ -- cgit v1.2.3-55-g6feb