#For TLS #target_compile_definitions(WebSocketServerXPlane PUBLIC #IXWEBSOCKET_USE_TLS #IXWEBSOCKET_USE_OPEN_SSL #) #Link to ssl(requires OpenSLL for macOS and Windows) file(GLOB ixwebsocket CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/ixwebsocket/*.cpp) file(GLOB websocket CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/websocket/*.cpp) file(GLOB file CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/file/*.cpp) add_library(germanairlinesva_xplugin SHARED ${ixwebsocket} ${websocket} ${file} makeRwysXP.cpp main.cpp ) target_include_directories(germanairlinesva_xplugin PRIVATE ${CMAKE_SOURCE_DIR}/ixwebsocket/include ${CMAKE_SOURCE_DIR}/websocket/include ${CMAKE_SOURCE_DIR}/XPSDK/CHeaders ${CMAKE_SOURCE_DIR}/nlohmann ${CMAKE_SOURCE_DIR}/file ) set_target_properties(germanairlinesva_xplugin PROPERTIES PREFIX "" SUFFIX ".xpl" ) target_compile_definitions(germanairlinesva_xplugin PRIVATE XPLM200 XPLM210 _USE_MATH_DEFINES ) target_compile_options(germanairlinesva_xplugin PRIVATE -Wall -Wextra -pedantic -fvisibility=hidden ) if(DEBUG) target_compile_options(germanairlinesva_xplugin PRIVATE -g ) target_link_options(germanairlinesva_xplugin PRIVATE -g ) else() target_compile_options(germanairlinesva_xplugin PRIVATE -O2 ) endif() if(APPLE) message("Building for MacOSX Universal into ${PROJECT_BINARY_DIR}/${PLUGIN_NAME}/${BIT}") set_target_properties(germanairlinesva_xplugin PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Plugin/${PLUGIN_NAME} OUTPUT_NAME mac ) target_compile_definitions(germanairlinesva_xplugin PUBLIC APL ) target_compile_options(germanairlinesva_xplugin PRIVATE "SHELL:-arch i386" "SHELL:-arch x86_64" ) target_link_options(germanairlinesva_xplugin PRIVATE "SHELL:-arch i386" "SHELL:-arch x86_64" ) target_link_libraries(germanairlinesva_xplugin PRIVATE ${CMAKE_SOURCE_DIR}/XPSDK/Libraries/Mac/XPLM.framework/XPLM "-framework Security" ) elseif(UNIX) message("Building for Linux ${BIT} into ${PROJECT_BINARY_DIR}/Plugin/${PLUGIN_NAME}/${BIT}") set_target_properties(germanairlinesva_xplugin PROPERTIES NO_SONAME 1 LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Plugin/${PLUGIN_NAME}/${BIT} OUTPUT_NAME lin ) target_compile_definitions(germanairlinesva_xplugin PUBLIC LIN ) target_compile_options(germanairlinesva_xplugin PRIVATE -nodefaultlibs ) if(BIT STREQUAL "32") target_compile_options(germanairlinesva_xplugin PRIVATE -m32 ) target_link_options(germanairlinesva_xplugin PRIVATE -m32 ) endif() target_link_libraries(germanairlinesva_xplugin PRIVATE crypto pthread ) elseif(WIN32) message("Building for Windows ${BIT} into ${PROJECT_BINARY_DIR}/Plugin/${PLUGIN_NAME}/${BIT}") set_target_properties(germanairlinesva_xplugin PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Plugin/${PLUGIN_NAME}/${BIT} OUTPUT_NAME win ) target_compile_definitions(germanairlinesva_xplugin PUBLIC IBM ) if(DEBUG) target_compile_options(germanairlinesva_xplugin PRIVATE -gcodeview ) target_link_options(germanairlinesva_xplugin PRIVATE -Wl,-pdb= ) endif() target_link_options(germanairlinesva_xplugin PRIVATE -static -static-libgcc -static-libstdc++ ) target_link_libraries(germanairlinesva_xplugin PRIVATE ws2_32.lib ) if(BIT STREQUAL "32") target_link_libraries(germanairlinesva_xplugin PRIVATE ${CMAKE_SOURCE_DIR}/XPSDK/Libraries/Win/XPLM.lib ) else() target_link_libraries(germanairlinesva_xplugin PRIVATE ${CMAKE_SOURCE_DIR}/XPSDK/Libraries/Win/XPLM_64.lib ) endif() target_sources(germanairlinesva_xplugin PRIVATE xPluginWin.cpp ) endif()