Require OpenSSL by default and add list it as a dependency for Conan
OpenSSL support remains optional, but instead of including it or not solely depending on whether cmake manages to find it, there is now a DDSC_ENABLE_OPENSSL option that defaults to "ON". Setting to OFF removes the dependency. The Conan configuration has been updated to automatically provide openssl 1.1.1a. Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
		
							parent
							
								
									334a85e0f1
								
							
						
					
					
						commit
						b8329ce206
					
				
					 3 changed files with 15 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -33,10 +33,18 @@ endif()
 | 
			
		|||
 | 
			
		||||
add_definitions(-DDDSI_INCLUDE_NETWORK_PARTITIONS -DDDSI_INCLUDE_SSM)
 | 
			
		||||
 | 
			
		||||
find_package(OpenSSL)
 | 
			
		||||
if(OPENSSL_FOUND)
 | 
			
		||||
  add_definitions(-DDDSI_INCLUDE_SSL)
 | 
			
		||||
  target_link_libraries(ddsc PRIVATE OpenSSL)
 | 
			
		||||
option(DDSC_ENABLE_OPENSSL "Enable openssl support" ON)
 | 
			
		||||
if(DDSC_ENABLE_OPENSSL)
 | 
			
		||||
  find_package(OpenSSL)
 | 
			
		||||
  if(OPENSSL_FOUND)
 | 
			
		||||
    add_definitions(-DDDSI_INCLUDE_SSL)
 | 
			
		||||
    target_link_libraries(ddsc PRIVATE OpenSSL::SSL)
 | 
			
		||||
    if(CMAKE_GENERATOR MATCHES "Visual Studio")
 | 
			
		||||
      set_target_properties(ddsc PROPERTIES LINK_FLAGS "/ignore:4099")
 | 
			
		||||
    endif()
 | 
			
		||||
  else()
 | 
			
		||||
    message(FATAL_ERROR "To build without openssl support, set DDSC_ENABLE_OPENSSL to OFF")
 | 
			
		||||
  endif()
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
include(ddsi/CMakeLists.txt)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue