2019-12-22 03:34:24 +08:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
2018-03-21 17:32:35 +08:00
|
|
|
project(openvpncli CXX)
|
|
|
|
|
|
|
|
find_path(ASIO_HPP asio.hpp)
|
|
|
|
find_library(MBEDTLS_LIB mbedtls)
|
|
|
|
find_library(MBEDCRYPTO_LIB mbedcrypto)
|
|
|
|
find_library(MBEDX509_LIB mbedx509)
|
|
|
|
|
|
|
|
include_directories(. ${ASIO_HPP})
|
|
|
|
|
[many ports] Updates 2019.05.24 (#6618)
* [many ports] Updates 2019.05.24
* Update SHA512 and resolve conflict for ebml and matroska
* [avro-c]Fix build error caused by jansson upgrades.
* [xxhash]Update to the next version to fix build error.(xxhash issue:#179)
* Fix failures and undo asio
* [libyaml, grpc, miniz, paho-mqtt, sqlitecpp] Update patches
* Update REF
* Undo nvtt flann itk libtins aws-sdk-cpp openvdb vlpp xmsh changes
* [flann, fastcdr] Fix old patches and build error.
* [flann, fastcdr] Fix build error.
* Fix ensmallen uvatlas cppcms libplist failures and undo aws-c-common libopusenc arb taglib changes
* [dcmtk, draco, flatbuffers, forge, ftgl, mosquitto,nmslib, ogre] Update old patches and fix build error.
* fix libusbmuxd failures and undo xxhash paho-mqtt mongo-c-driver flann libffi
* fix libimobiledevice and undo qhull harfbuzz lcm libbson draco flatbuffers
* undo libmupdf forge kd-soap qca
* [mosquitto] Fix installation of import libs
* [arb][asio][aws-c-common][collada-dom][concurrentqueue][cryptopp][ebml] Revert trivial/undesired changes
* [fastcdr] Minimize patch
* [many ports] Revert trivial changes
* [libyaml] Switch to non-dist tag
* [sqlite-modern-cpp] Track master due to infrequent release
* [nano-signal-slot] Revert downgrade
* [openvpn3] Bump control version to account for portfile change
* [sqlite-modern-cpp] Fixup wrong hash
* [mosquitto] Commit missing patch
2019-06-11 08:01:54 +08:00
|
|
|
if(WIN32)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
|
|
|
|
endif()
|
|
|
|
|
2019-11-02 05:45:42 +08:00
|
|
|
add_definitions(-DNOMINMAX -DUSE_ASIO -DUSE_MBEDTLS -D_WIN32_WINNT=0x0600)
|
2019-12-22 03:34:24 +08:00
|
|
|
if(LINUX)
|
|
|
|
add_compile_options(-include bits/endian.h)
|
|
|
|
endif()
|
2018-03-21 17:32:35 +08:00
|
|
|
|
|
|
|
add_library(ovpncli client/ovpncli.cpp)
|
2019-11-02 05:45:42 +08:00
|
|
|
target_link_libraries(ovpncli PRIVATE Iphlpapi.lib Wininet.lib Setupapi.lib Cfgmgr32.lib Rpcrt4.lib Fwpuclnt.lib Wtsapi32.lib ${MBEDTLS_LIB} ${MBEDCRYPTO_LIB} ${MBEDX509_LIB})
|
2018-03-21 17:32:35 +08:00
|
|
|
|
|
|
|
install(
|
|
|
|
TARGETS ovpncli
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
)
|
|
|
|
|
|
|
|
if(BUILD_TOOL)
|
|
|
|
add_executable(cli test/ovpncli/cli.cpp)
|
2019-11-02 05:45:42 +08:00
|
|
|
target_compile_definitions(cli PRIVATE -DTAP_WIN_COMPONENT_ID=tap0901)
|
|
|
|
target_link_libraries(cli PRIVATE ovpncli)
|
2018-03-21 17:32:35 +08:00
|
|
|
endif()
|