aboutsummaryrefslogtreecommitdiff
path: root/src/threads
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2014-05-27 15:41:55 +0200
committerAndreas Schneider <asn@cryptomilk.org>2014-05-27 15:42:53 +0200
commita738507ad24aa283c6af91fc2a5e8b35473d4c77 (patch)
treefd300bda3732315d6d8c02839c033817481de258 /src/threads
parent142b2e4edeb1be1f3d5d5ea665e535d8d62bb597 (diff)
downloadlibssh-a738507ad24aa283c6af91fc2a5e8b35473d4c77.tar.gz
libssh-a738507ad24aa283c6af91fc2a5e8b35473d4c77.tar.xz
libssh-a738507ad24aa283c6af91fc2a5e8b35473d4c77.zip
cmake: Fix the build on Windows.
Diffstat (limited to 'src/threads')
-rw-r--r--src/threads/CMakeLists.txt134
1 files changed, 68 insertions, 66 deletions
diff --git a/src/threads/CMakeLists.txt b/src/threads/CMakeLists.txt
index b95525e4..a32d601e 100644
--- a/src/threads/CMakeLists.txt
+++ b/src/threads/CMakeLists.txt
@@ -53,73 +53,75 @@ include_directories(
${LIBSSH_THREADS_PRIVATE_INCLUDE_DIRS}
)
-add_library(${LIBSSH_THREADS_SHARED_LIBRARY} SHARED ${libssh_threads_SRCS})
-
-target_link_libraries(${LIBSSH_THREADS_SHARED_LIBRARY} ${LIBSSH_THREADS_LINK_LIBRARIES})
-
-set_target_properties(
- ${LIBSSH_THREADS_SHARED_LIBRARY}
- PROPERTIES
- VERSION
- ${LIBRARY_VERSION}
- SOVERSION
- ${LIBRARY_SOVERSION}
- OUTPUT_NAME
- ssh_threads
- DEFINE_SYMBOL
- LIBSSH_EXPORTS
-)
+if (libssh_threads_SRCS)
+ add_library(${LIBSSH_THREADS_SHARED_LIBRARY} SHARED ${libssh_threads_SRCS})
-if (WITH_VISIBILITY_HIDDEN)
- set_target_properties(${LIBSSH_THREADS_SHARED_LIBRARY} PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
-endif (WITH_VISIBILITY_HIDDEN)
-
-install(
- TARGETS
- ${LIBSSH_THREADS_SHARED_LIBRARY}
- RUNTIME DESTINATION ${BIN_INSTALL_DIR}
- LIBRARY DESTINATION ${LIB_INSTALL_DIR}
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- COMPONENT libraries
-)
+ target_link_libraries(${LIBSSH_THREADS_SHARED_LIBRARY} ${LIBSSH_THREADS_LINK_LIBRARIES})
-if (WITH_STATIC_LIB)
- add_library(${LIBSSH_THREADS_STATIC_LIBRARY} STATIC ${libssh_threads_SRCS})
-
- if (MSVC)
- set(OUTPUT_SUFFIX static)
- else (MSVC)
- set(OUTPUT_SUFFIX )
- endif (MSVC)
-
- set_target_properties(
- ${LIBSSH_THREADS_STATIC_LIBRARY}
- PROPERTIES
- VERSION
- ${LIBRARY_VERSION}
- SOVERSION
- ${LIBRARY_SOVERSION}
- OUTPUT_NAME
- ssh_threads
- ARCHIVE_OUTPUT_DIRECTORY
- ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_SUFFIX}
- )
-
- if (WIN32)
set_target_properties(
+ ${LIBSSH_THREADS_SHARED_LIBRARY}
+ PROPERTIES
+ VERSION
+ ${LIBRARY_VERSION}
+ SOVERSION
+ ${LIBRARY_SOVERSION}
+ OUTPUT_NAME
+ ssh_threads
+ DEFINE_SYMBOL
+ LIBSSH_EXPORTS
+ )
+
+ if (WITH_VISIBILITY_HIDDEN)
+ set_target_properties(${LIBSSH_THREADS_SHARED_LIBRARY} PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
+ endif (WITH_VISIBILITY_HIDDEN)
+
+ install(
+ TARGETS
+ ${LIBSSH_THREADS_SHARED_LIBRARY}
+ RUNTIME DESTINATION ${BIN_INSTALL_DIR}
+ LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+ ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
+ COMPONENT libraries
+ )
+
+ if (WITH_STATIC_LIB)
+ add_library(${LIBSSH_THREADS_STATIC_LIBRARY} STATIC ${libssh_threads_SRCS})
+
+ if (MSVC)
+ set(OUTPUT_SUFFIX static)
+ else (MSVC)
+ set(OUTPUT_SUFFIX )
+ endif (MSVC)
+
+ set_target_properties(
${LIBSSH_THREADS_STATIC_LIBRARY}
- PROPERTIES
- COMPILE_FLAGS
- "-DLIBSSH_STATIC"
- )
- endif (WIN32)
-
- install(
- TARGETS
- ${LIBSSH_THREADS_STATIC_LIBRARY}
- DESTINATION
- ${LIB_INSTALL_DIR}/${OUTPUT_SUFFIX}
- COMPONENT
- libraries
- )
-endif (WITH_STATIC_LIB)
+ PROPERTIES
+ VERSION
+ ${LIBRARY_VERSION}
+ SOVERSION
+ ${LIBRARY_SOVERSION}
+ OUTPUT_NAME
+ ssh_threads
+ ARCHIVE_OUTPUT_DIRECTORY
+ ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_SUFFIX}
+ )
+
+ if (WIN32)
+ set_target_properties(
+ ${LIBSSH_THREADS_STATIC_LIBRARY}
+ PROPERTIES
+ COMPILE_FLAGS
+ "-DLIBSSH_STATIC"
+ )
+ endif (WIN32)
+
+ install(
+ TARGETS
+ ${LIBSSH_THREADS_STATIC_LIBRARY}
+ DESTINATION
+ ${LIB_INSTALL_DIR}/${OUTPUT_SUFFIX}
+ COMPONENT
+ libraries
+ )
+ endif (WITH_STATIC_LIB)
+endif (libssh_threads_SRCS)