From ae150fbfd3038f3354337c381b65c9dd658d36d8 Mon Sep 17 00:00:00 2001 From: "Spencer G. Jones" Date: Wed, 12 Feb 2014 15:28:34 -0700 Subject: [PATCH] Windows cmake puts the dlls in RUNTIME_OUTPUT_DIRECTORY --- cpp/ycm/CMakeLists.txt | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/cpp/ycm/CMakeLists.txt b/cpp/ycm/CMakeLists.txt index 5212a0f5..ff35f783 100644 --- a/cpp/ycm/CMakeLists.txt +++ b/cpp/ycm/CMakeLists.txt @@ -317,14 +317,22 @@ endif() set_target_properties( ${CLIENT_LIB} PROPERTIES PREFIX "") set_target_properties( ${SERVER_LIB} PROPERTIES PREFIX "") -if ( WIN32 ) - # This is the extension for compiled Python modules on Windows - set_target_properties( ${CLIENT_LIB} PROPERTIES SUFFIX ".pyd") - set_target_properties( ${SERVER_LIB} PROPERTIES SUFFIX ".pyd") -elseif ( CYGWIN ) - # This is the extension for compiled Python modules in Cygwin - set_target_properties( ${CLIENT_LIB} PROPERTIES SUFFIX ".dll") - set_target_properties( ${SERVER_LIB} PROPERTIES SUFFIX ".dll") +if ( WIN32 OR CYGWIN ) + # DLL platforms put dlls in the RUNTIME_OUTPUT_DIRECTORY + set_target_properties( ${CLIENT_LIB} PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/../../python ) + set_target_properties( ${SERVER_LIB} PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/../../python ) + + if ( WIN32 ) + # This is the extension for compiled Python modules on Windows + set_target_properties( ${CLIENT_LIB} PROPERTIES SUFFIX ".pyd") + set_target_properties( ${SERVER_LIB} PROPERTIES SUFFIX ".pyd") + elseif ( CYGWIN ) + # This is the extension for compiled Python modules in Cygwin + set_target_properties( ${CLIENT_LIB} PROPERTIES SUFFIX ".dll") + set_target_properties( ${SERVER_LIB} PROPERTIES SUFFIX ".dll") + endif() else() # Even on macs, we want a .so extension instead of a .dylib which is what # cmake would give us by default. Python won't recognize a .dylib as a module,