mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-23 01:49:53 +03:00
src: split CMakeLists.txt for each subdirectory
This commit is contained in:
parent
65bda6a44d
commit
07ed7e1626
@ -13,92 +13,6 @@ macro(install_wrapper_script target destination)
|
|||||||
)
|
)
|
||||||
endmacro(install_wrapper_script)
|
endmacro(install_wrapper_script)
|
||||||
|
|
||||||
# Cedar communication module
|
|
||||||
file(GLOB SOURCES_CEDAR "Cedar/*.c")
|
|
||||||
file(GLOB HEADERS_CEDAR "Cedar/*.h")
|
|
||||||
|
|
||||||
add_library(cedar STATIC ${SOURCES_CEDAR} ${HEADERS_CEDAR})
|
|
||||||
|
|
||||||
set_target_properties(cedar
|
|
||||||
PROPERTIES
|
|
||||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Cedar"
|
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Cedar"
|
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Cedar"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Mayaqua kernel
|
|
||||||
file(GLOB SOURCES_MAYAQUA "Mayaqua/*.c")
|
|
||||||
file(GLOB HEADERS_MAYAQUA "Mayaqua/*.h")
|
|
||||||
|
|
||||||
add_library(mayaqua STATIC ${SOURCES_MAYAQUA} ${HEADERS_MAYAQUA})
|
|
||||||
|
|
||||||
target_include_directories(mayaqua PUBLIC Mayaqua)
|
|
||||||
|
|
||||||
set_target_properties(mayaqua
|
|
||||||
PROPERTIES
|
|
||||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Mayaqua"
|
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Mayaqua"
|
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Mayaqua"
|
|
||||||
)
|
|
||||||
|
|
||||||
# hamcorebuilder utility
|
|
||||||
add_executable(hamcorebuilder hamcorebuilder/hamcorebuilder.c)
|
|
||||||
|
|
||||||
set_target_properties(hamcorebuilder
|
|
||||||
PROPERTIES
|
|
||||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp"
|
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp"
|
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp"
|
|
||||||
)
|
|
||||||
|
|
||||||
# vpnserver
|
|
||||||
add_executable(vpnserver vpnserver/vpnserver.c)
|
|
||||||
|
|
||||||
set_target_properties(vpnserver
|
|
||||||
PROPERTIES
|
|
||||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/vpnserver"
|
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/vpnserver"
|
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/vpnserver"
|
|
||||||
)
|
|
||||||
|
|
||||||
get_target_property(VPNSERVER_RUNTIME_OUTPUT_DIRECTORY vpnserver RUNTIME_OUTPUT_DIRECTORY)
|
|
||||||
|
|
||||||
# vpnclient
|
|
||||||
add_executable(vpnclient vpnclient/vpncsvc.c)
|
|
||||||
|
|
||||||
set_target_properties(vpnclient
|
|
||||||
PROPERTIES
|
|
||||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/vpnclient"
|
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/vpnclient"
|
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/vpnclient"
|
|
||||||
)
|
|
||||||
|
|
||||||
get_target_property(VPNCLIENT_RUNTIME_OUTPUT_DIRECTORY vpnclient RUNTIME_OUTPUT_DIRECTORY)
|
|
||||||
|
|
||||||
# vpnbridge
|
|
||||||
add_executable(vpnbridge vpnbridge/vpnbridge.c)
|
|
||||||
|
|
||||||
set_target_properties(vpnbridge
|
|
||||||
PROPERTIES
|
|
||||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/vpnbridge"
|
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/vpnbridge"
|
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/vpnbridge"
|
|
||||||
)
|
|
||||||
|
|
||||||
get_target_property(VPNBRIDGE_RUNTIME_OUTPUT_DIRECTORY vpnbridge RUNTIME_OUTPUT_DIRECTORY)
|
|
||||||
|
|
||||||
# vpncmd
|
|
||||||
add_executable(vpncmd vpncmd/vpncmd.c)
|
|
||||||
|
|
||||||
set_target_properties(vpncmd
|
|
||||||
PROPERTIES
|
|
||||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/vpncmd"
|
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/vpncmd"
|
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/vpncmd"
|
|
||||||
)
|
|
||||||
|
|
||||||
get_target_property(VPNCMD_RUNTIME_OUTPUT_DIRECTORY vpncmd RUNTIME_OUTPUT_DIRECTORY)
|
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
add_definitions(-D_DEBUG -DDEBUG)
|
add_definitions(-D_DEBUG -DDEBUG)
|
||||||
endif()
|
endif()
|
||||||
@ -113,8 +27,6 @@ endif()
|
|||||||
|
|
||||||
add_definitions(-D_REENTRANT -DREENTRANT -D_THREAD_SAFE -D_THREADSAFE -DTHREAD_SAFE -DTHREADSAFE -D_FILE_OFFSET_BITS=64)
|
add_definitions(-D_REENTRANT -DREENTRANT -D_THREAD_SAFE -D_THREADSAFE -DTHREAD_SAFE -DTHREADSAFE -D_FILE_OFFSET_BITS=64)
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsigned-char")
|
|
||||||
|
|
||||||
# Add /src to the include paths
|
# Add /src to the include paths
|
||||||
include_directories(.)
|
include_directories(.)
|
||||||
|
|
||||||
@ -123,30 +35,12 @@ if(WIN32)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsigned-char")
|
||||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
|
||||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2")
|
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2")
|
||||||
|
|
||||||
add_definitions(-DUNIX)
|
add_definitions(-DUNIX)
|
||||||
|
|
||||||
find_package(Threads)
|
|
||||||
find_library(LIB_READLINE readline)
|
|
||||||
find_library(LIB_NCURSES ncurses)
|
|
||||||
find_library(LIB_Z z)
|
|
||||||
|
|
||||||
# In some cases libiconv is not included in libc
|
|
||||||
find_library(LIB_ICONV iconv)
|
|
||||||
|
|
||||||
# This is required in order to link to the correct OpenSSL library
|
|
||||||
find_library(LIB_SSL
|
|
||||||
NAMES ssl
|
|
||||||
HINTS "/usr/local/opt/openssl/lib"
|
|
||||||
)
|
|
||||||
|
|
||||||
find_library(LIB_CRYPTO
|
|
||||||
NAMES crypto
|
|
||||||
HINTS "/usr/local/opt/openssl/lib"
|
|
||||||
)
|
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||||
add_definitions(-DUNIX_LINUX)
|
add_definitions(-DUNIX_LINUX)
|
||||||
endif()
|
endif()
|
||||||
@ -165,29 +59,39 @@ if(UNIX)
|
|||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
|
||||||
add_definitions(-DUNIX_SOLARIS -DNO_VLAN)
|
add_definitions(-DUNIX_SOLARIS -DNO_VLAN)
|
||||||
target_link_libraries(mayaqua nsl socket)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
||||||
add_definitions(-DUNIX_MACOS -DBRIDGE_PCAP)
|
add_definitions(-DUNIX_MACOS -DBRIDGE_PCAP)
|
||||||
include_directories(SYSTEM /usr/local/opt/openssl/include)
|
include_directories(SYSTEM /usr/local/opt/openssl/include)
|
||||||
link_directories(SYSTEM /usr/local/opt/openssl/lib)
|
link_directories(SYSTEM /usr/local/opt/openssl/lib)
|
||||||
target_link_libraries(cedar pcap)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(mayaqua ${CMAKE_THREAD_LIBS_INIT} ${LIB_SSL} ${LIB_CRYPTO} ${LIB_READLINE} ${LIB_NCURSES} ${LIB_Z})
|
# Cedar communication module
|
||||||
|
add_subdirectory(Cedar)
|
||||||
|
|
||||||
if(LIB_ICONV)
|
# Mayaqua kernel
|
||||||
target_link_libraries(mayaqua ${LIB_ICONV})
|
add_subdirectory(Mayaqua)
|
||||||
endif()
|
|
||||||
|
|
||||||
target_link_libraries(hamcorebuilder cedar mayaqua)
|
# hamcorebuilder utility
|
||||||
|
add_subdirectory(hamcorebuilder)
|
||||||
|
|
||||||
target_link_libraries(vpnserver cedar mayaqua)
|
# vpnserver
|
||||||
target_link_libraries(vpnclient cedar mayaqua)
|
add_subdirectory(vpnserver)
|
||||||
target_link_libraries(vpnbridge cedar mayaqua)
|
get_target_property(VPNSERVER_RUNTIME_OUTPUT_DIRECTORY vpnserver RUNTIME_OUTPUT_DIRECTORY)
|
||||||
target_link_libraries(vpncmd cedar mayaqua)
|
|
||||||
|
# vpnclient
|
||||||
|
add_subdirectory(vpnclient)
|
||||||
|
get_target_property(VPNCLIENT_RUNTIME_OUTPUT_DIRECTORY vpnclient RUNTIME_OUTPUT_DIRECTORY)
|
||||||
|
|
||||||
|
# vpnbridge
|
||||||
|
add_subdirectory(vpnbridge)
|
||||||
|
get_target_property(VPNBRIDGE_RUNTIME_OUTPUT_DIRECTORY vpnbridge RUNTIME_OUTPUT_DIRECTORY)
|
||||||
|
|
||||||
|
# vpncmd
|
||||||
|
add_subdirectory(vpncmd)
|
||||||
|
get_target_property(VPNCMD_RUNTIME_OUTPUT_DIRECTORY vpncmd RUNTIME_OUTPUT_DIRECTORY)
|
||||||
|
|
||||||
# hamcore.se2 archive file
|
# hamcore.se2 archive file
|
||||||
add_custom_target(hamcore-archive-build
|
add_custom_target(hamcore-archive-build
|
||||||
|
15
src/Cedar/CMakeLists.txt
Normal file
15
src/Cedar/CMakeLists.txt
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
file(GLOB SOURCES_CEDAR "*.c")
|
||||||
|
file(GLOB HEADERS_CEDAR "*.h")
|
||||||
|
|
||||||
|
add_library(cedar STATIC ${SOURCES_CEDAR} ${HEADERS_CEDAR})
|
||||||
|
|
||||||
|
set_target_properties(cedar
|
||||||
|
PROPERTIES
|
||||||
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Cedar"
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Cedar"
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Cedar"
|
||||||
|
)
|
||||||
|
|
||||||
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
||||||
|
target_link_libraries(cedar pcap)
|
||||||
|
endif()
|
42
src/Mayaqua/CMakeLists.txt
Normal file
42
src/Mayaqua/CMakeLists.txt
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
file(GLOB SOURCES_MAYAQUA "*.c")
|
||||||
|
file(GLOB HEADERS_MAYAQUA "*.h")
|
||||||
|
|
||||||
|
add_library(mayaqua STATIC ${SOURCES_MAYAQUA} ${HEADERS_MAYAQUA})
|
||||||
|
|
||||||
|
target_include_directories(mayaqua PUBLIC .)
|
||||||
|
|
||||||
|
set_target_properties(mayaqua
|
||||||
|
PROPERTIES
|
||||||
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Mayaqua"
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Mayaqua"
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Mayaqua"
|
||||||
|
)
|
||||||
|
|
||||||
|
find_package(Threads)
|
||||||
|
find_library(LIB_READLINE readline)
|
||||||
|
find_library(LIB_NCURSES ncurses)
|
||||||
|
find_library(LIB_Z z)
|
||||||
|
|
||||||
|
# In some cases libiconv is not included in libc
|
||||||
|
find_library(LIB_ICONV iconv)
|
||||||
|
|
||||||
|
# This is required in order to link to the correct OpenSSL library
|
||||||
|
find_library(LIB_SSL
|
||||||
|
NAMES ssl
|
||||||
|
HINTS "/usr/local/opt/openssl/lib"
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(LIB_CRYPTO
|
||||||
|
NAMES crypto
|
||||||
|
HINTS "/usr/local/opt/openssl/lib"
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(mayaqua ${CMAKE_THREAD_LIBS_INIT} ${LIB_SSL} ${LIB_CRYPTO} ${LIB_READLINE} ${LIB_NCURSES} ${LIB_Z})
|
||||||
|
|
||||||
|
if(LIB_ICONV)
|
||||||
|
target_link_libraries(mayaqua ${LIB_ICONV})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
|
||||||
|
target_link_libraries(mayaqua nsl socket)
|
||||||
|
endif()
|
10
src/hamcorebuilder/CMakeLists.txt
Normal file
10
src/hamcorebuilder/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
add_executable(hamcorebuilder hamcorebuilder.c)
|
||||||
|
|
||||||
|
set_target_properties(hamcorebuilder
|
||||||
|
PROPERTIES
|
||||||
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp"
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp"
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp"
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(hamcorebuilder cedar mayaqua)
|
10
src/vpnbridge/CMakeLists.txt
Normal file
10
src/vpnbridge/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
add_executable(vpnbridge vpnbridge.c)
|
||||||
|
|
||||||
|
set_target_properties(vpnbridge
|
||||||
|
PROPERTIES
|
||||||
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/vpnbridge"
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/vpnbridge"
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/vpnbridge"
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(vpnbridge cedar mayaqua)
|
10
src/vpnclient/CMakeLists.txt
Normal file
10
src/vpnclient/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
add_executable(vpnclient vpncsvc.c)
|
||||||
|
|
||||||
|
set_target_properties(vpnclient
|
||||||
|
PROPERTIES
|
||||||
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/vpnclient"
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/vpnclient"
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/vpnclient"
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(vpnclient cedar mayaqua)
|
10
src/vpncmd/CMakeLists.txt
Normal file
10
src/vpncmd/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
add_executable(vpncmd vpncmd.c)
|
||||||
|
|
||||||
|
set_target_properties(vpncmd
|
||||||
|
PROPERTIES
|
||||||
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/vpncmd"
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/vpncmd"
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/vpncmd"
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(vpncmd cedar mayaqua)
|
10
src/vpnserver/CMakeLists.txt
Normal file
10
src/vpnserver/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
add_executable(vpnserver vpnserver.c)
|
||||||
|
|
||||||
|
set_target_properties(vpnserver
|
||||||
|
PROPERTIES
|
||||||
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/vpnserver"
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/vpnserver"
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/vpnserver"
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(vpnserver cedar mayaqua)
|
Loading…
Reference in New Issue
Block a user