From b6ddf1ed24fa406e0a04b0cab23a9612180450aa Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 9 Jan 2020 12:18:11 +0100 Subject: [PATCH] CMakeLists.txt: Fix Windows build failure (the windows specific stuffs must come after PROGRAM_EXE target) --- CMakeLists.txt | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fca8bb8..ab071e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,19 @@ if (USE_THREADS) endif (Threads_FOUND) endif (USE_THREADS) +# Include OpenSSL headers +include_directories( ${OPENSSL_INCLUDE_DIR} ) + +add_executable( ${PROGRAM_EXE} ${PROGRAM_SOURCE} ) + +target_link_libraries( ${PROGRAM_EXE} + PUBLIC + ${OPENSSL_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} +) + +install(TARGETS ${PROGRAM_EXE} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + # Win32 specific. if (WIN32) if (CMAKE_SIZEOF_VOID_P EQUAL 8) @@ -65,19 +78,6 @@ if (WIN32) install(FILES ${OPENSSL_LIBCRYPTO_DLL} DESTINATION ${CMAKE_INSTALL_BINDIR}) endif (WIN32) -# Include OpenSSL headers -include_directories( ${OPENSSL_INCLUDE_DIR} ) - -add_executable( ${PROGRAM_EXE} ${PROGRAM_SOURCE} ) - -target_link_libraries( ${PROGRAM_EXE} - PUBLIC - ${OPENSSL_LIBRARIES} - ${CMAKE_THREAD_LIBS_INIT} -) - -install(TARGETS ${PROGRAM_EXE} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - # -------------------------------- # Additional install files # --------------------------------