mirror of
https://github.com/QuasarApp/openssl-cmake.git
synced 2025-04-27 18:24:35 +00:00
configure dso
This commit is contained in:
parent
02f5d0265d
commit
f4047cd59c
@ -39,11 +39,27 @@ file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/opensslconf.h.cmake "${CONF}" )
|
||||
#~2DO: set BUILDINF_DATE to `date LC_ALL=C LC_TIME=C`
|
||||
configure_file ( buildinf.h.cmake buildinf.h )
|
||||
|
||||
include( CheckIncludeFile )
|
||||
CHECK_INCLUDE_FILE( fcntl.h CHK_DLFCN )
|
||||
if( CHK_DLFCN )
|
||||
set( HAVE_DLFCN_H ON )
|
||||
endif()
|
||||
|
||||
if ( APPLE )
|
||||
set( DSO_DLFCN ON )
|
||||
set( DSO_EXTENSION ".dylib" )
|
||||
elseif ( WIN32 )
|
||||
elseif ( WIN32 AND NOT CYGWIN )
|
||||
set( DSO_WIN32 ON )
|
||||
set( DSO_EXTENSION ".dll" )
|
||||
elseif ( CYGWIN )
|
||||
set( DSO_DLFCN ON )
|
||||
set( DSO_EXTENSION ".dll" )
|
||||
else()
|
||||
if( CHK_DLFCN )
|
||||
set( DSO_DLFCN ON )
|
||||
else()
|
||||
set( DSO_NONE ON )
|
||||
endif()
|
||||
set( DSO_EXTENSION ".so" )
|
||||
endif()
|
||||
|
||||
@ -271,8 +287,13 @@ add_library( crypto ${LIBSRC} ${OBJECTS_SRC} )
|
||||
|
||||
if( WIN32 AND NOT CYGWIN )
|
||||
target_link_libraries( crypto ws2_32 crypt32 )
|
||||
elseif( Threads_FOUND )
|
||||
target_link_libraries( crypto ${CMAKE_THREAD_LIBS_INIT} )
|
||||
else()
|
||||
if( Threads_FOUND )
|
||||
target_link_libraries( crypto ${CMAKE_THREAD_LIBS_INIT} )
|
||||
endif()
|
||||
if ( DSO_DLFCN AND HAVE_DLFCN_H )
|
||||
target_link_libraries( crypto dl )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_target_properties( crypto PROPERTIES
|
||||
|
@ -9,6 +9,9 @@
|
||||
|
||||
#ifndef HEADER_DSO_CONF_H
|
||||
# define HEADER_DSO_CONF_H
|
||||
|
||||
# define DSO_EXTENSION "@DSO_EXTENSION@"
|
||||
#cmakedefine DSO_NONE
|
||||
#cmakedefine DSO_WIN32
|
||||
#cmakedefine DSO_DLFCN
|
||||
#cmakedefine HAVE_DLFCN_H
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user