mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-23 18:09:53 +03:00
CMake: don't hardcode build directories
Our CMake project used to forcefully create and use two different build directories: "build" and "tmp". This commit changes the behavior so that only the build directory CMake is ran in is used. The "configure" script now runs CMake in "build" by default, instead of "tmp".
This commit is contained in:
parent
7b042e53d2
commit
369a8850c4
@ -6,7 +6,7 @@ project("SoftEther VPN"
|
|||||||
)
|
)
|
||||||
|
|
||||||
set(TOP_DIRECTORY ${CMAKE_SOURCE_DIR})
|
set(TOP_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||||
set(BUILD_DIRECTORY ${TOP_DIRECTORY}/build)
|
set(BUILD_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
|
|
||||||
# We define a dedicated variable because CMAKE_BUILD_TYPE can have different
|
# We define a dedicated variable because CMAKE_BUILD_TYPE can have different
|
||||||
# configurations than "Debug" and "Release", such as "RelWithDebInfo".
|
# configurations than "Debug" and "Release", such as "RelWithDebInfo".
|
||||||
|
8
configure
vendored
8
configure
vendored
@ -17,8 +17,8 @@ echo
|
|||||||
echo 'Welcome to the corner-cutting configure script !'
|
echo 'Welcome to the corner-cutting configure script !'
|
||||||
echo
|
echo
|
||||||
|
|
||||||
if [ ! -d "tmp" ]; then
|
if [ ! -d "build" ]; then
|
||||||
mkdir tmp
|
mkdir build
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z ${CMAKE_FLAGS+x} ]; then
|
if [ ! -z ${CMAKE_FLAGS+x} ]; then
|
||||||
@ -50,9 +50,9 @@ fi
|
|||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
(cd tmp && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ${CMAKE_FLAGS} .. || exit 1)
|
(cd build && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ${CMAKE_FLAGS} .. || exit 1)
|
||||||
|
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "The Makefile is generated. Run 'make -C tmp' to build SoftEther VPN."
|
echo "The Makefile is generated. Run 'make -C build' to build SoftEther VPN."
|
||||||
|
@ -13,11 +13,11 @@ echo.
|
|||||||
echo Welcome to the corner-cutting configure script !
|
echo Welcome to the corner-cutting configure script !
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
if not exist "tmp" (
|
if not exist "build" (
|
||||||
mkdir tmp
|
mkdir build
|
||||||
)
|
)
|
||||||
|
|
||||||
cd tmp
|
cd build
|
||||||
|
|
||||||
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "NMake Makefiles" ..
|
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "NMake Makefiles" ..
|
||||||
|
|
||||||
|
@ -1,17 +1,3 @@
|
|||||||
add_executable(hamcorebuilder hamcorebuilder.c)
|
add_executable(hamcorebuilder hamcorebuilder.c)
|
||||||
|
|
||||||
set_target_properties(hamcorebuilder
|
|
||||||
PROPERTIES
|
|
||||||
ARCHIVE_OUTPUT_DIRECTORY "${TOP_DIRECTORY}/tmp"
|
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${TOP_DIRECTORY}/tmp"
|
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${TOP_DIRECTORY}/tmp"
|
|
||||||
)
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
set_target_properties(hamcorebuilder
|
|
||||||
PROPERTIES
|
|
||||||
PDB_OUTPUT_DIRECTORY "${TOP_DIRECTORY}/tmp"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_link_libraries(hamcorebuilder cedar mayaqua)
|
target_link_libraries(hamcorebuilder cedar mayaqua)
|
||||||
|
@ -19,8 +19,8 @@ if(WIN32)
|
|||||||
get_filename_component(COMPONENT_FILE_NAME vpnbridge NAME)
|
get_filename_component(COMPONENT_FILE_NAME vpnbridge NAME)
|
||||||
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
|
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
|
||||||
|
|
||||||
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_BINARY_DIR}/VerScript/vpnbridge.rc")
|
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
|
||||||
target_sources(vpnbridge PRIVATE vpnbridge.rc "${CMAKE_BINARY_DIR}/VerScript/vpnbridge.rc")
|
target_sources(vpnbridge PRIVATE "vpnbridge.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(vpnbridge cedar mayaqua)
|
target_link_libraries(vpnbridge cedar mayaqua)
|
||||||
|
@ -19,8 +19,8 @@ if(WIN32)
|
|||||||
get_filename_component(COMPONENT_FILE_NAME vpnclient NAME)
|
get_filename_component(COMPONENT_FILE_NAME vpnclient NAME)
|
||||||
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
|
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
|
||||||
|
|
||||||
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_BINARY_DIR}/VerScript/vpnclient.rc")
|
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
|
||||||
target_sources(vpnclient PRIVATE vpnclient.rc "${CMAKE_BINARY_DIR}/VerScript/vpnclient.rc")
|
target_sources(vpnclient PRIVATE "vpnclient.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(vpnclient cedar mayaqua)
|
target_link_libraries(vpnclient cedar mayaqua)
|
||||||
|
@ -19,8 +19,8 @@ if(WIN32)
|
|||||||
get_filename_component(COMPONENT_FILE_NAME vpncmd NAME)
|
get_filename_component(COMPONENT_FILE_NAME vpncmd NAME)
|
||||||
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
|
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
|
||||||
|
|
||||||
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_BINARY_DIR}/VerScript/vpncmd.rc")
|
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
|
||||||
target_sources(vpncmd PRIVATE vpncmd.rc "${CMAKE_BINARY_DIR}/VerScript/vpncmd.rc")
|
target_sources(vpncmd PRIVATE "vpncmd.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(vpncmd cedar mayaqua)
|
target_link_libraries(vpncmd cedar mayaqua)
|
||||||
|
@ -10,8 +10,8 @@ add_executable(vpncmgr WIN32 vpncmgr.c vpncmgr.rc)
|
|||||||
get_filename_component(COMPONENT_FILE_NAME vpncmgr NAME)
|
get_filename_component(COMPONENT_FILE_NAME vpncmgr NAME)
|
||||||
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
|
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
|
||||||
|
|
||||||
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_BINARY_DIR}/VerScript/vpncmgr.rc")
|
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
|
||||||
target_sources(vpncmgr PRIVATE "${CMAKE_BINARY_DIR}/VerScript/vpncmgr.rc")
|
target_sources(vpncmgr PRIVATE "vpncmgr.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
|
||||||
|
|
||||||
if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
|
if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
|
||||||
target_sources(vpncmgr PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x64_user.manifest")
|
target_sources(vpncmgr PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x64_user.manifest")
|
||||||
|
@ -19,8 +19,8 @@ if(WIN32)
|
|||||||
get_filename_component(COMPONENT_FILE_NAME vpnserver NAME)
|
get_filename_component(COMPONENT_FILE_NAME vpnserver NAME)
|
||||||
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
|
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
|
||||||
|
|
||||||
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_BINARY_DIR}/VerScript/vpnserver.rc")
|
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
|
||||||
target_sources(vpnserver PRIVATE vpnserver.rc "${CMAKE_BINARY_DIR}/VerScript/vpnserver.rc")
|
target_sources(vpnserver PRIVATE "vpnserver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(vpnserver cedar mayaqua)
|
target_link_libraries(vpnserver cedar mayaqua)
|
||||||
|
@ -10,8 +10,8 @@ add_executable(vpnsmgr WIN32 vpnsmgr.c vpnsmgr.rc)
|
|||||||
get_filename_component(COMPONENT_FILE_NAME vpnsmgr NAME)
|
get_filename_component(COMPONENT_FILE_NAME vpnsmgr NAME)
|
||||||
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
|
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
|
||||||
|
|
||||||
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_BINARY_DIR}/VerScript/vpnsmgr.rc")
|
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
|
||||||
target_sources(vpnsmgr PRIVATE "${CMAKE_BINARY_DIR}/VerScript/vpnsmgr.rc")
|
target_sources(vpnsmgr PRIVATE "vpnsmgr.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
|
||||||
|
|
||||||
if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
|
if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
|
||||||
target_sources(vpnsmgr PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x64_user.manifest")
|
target_sources(vpnsmgr PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x64_user.manifest")
|
||||||
|
@ -19,8 +19,8 @@ if(WIN32)
|
|||||||
get_filename_component(COMPONENT_FILE_NAME vpntest NAME)
|
get_filename_component(COMPONENT_FILE_NAME vpntest NAME)
|
||||||
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
|
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
|
||||||
|
|
||||||
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_BINARY_DIR}/VerScript/vpntest.rc")
|
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
|
||||||
target_sources(vpntest PRIVATE vpntest.rc "${CMAKE_BINARY_DIR}/VerScript/vpntest.rc")
|
target_sources(vpntest PRIVATE "vpntest.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
|
||||||
|
|
||||||
if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
|
if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
|
||||||
target_sources(vpntest PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x64_user.manifest")
|
target_sources(vpntest PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x64_user.manifest")
|
||||||
|
Loading…
Reference in New Issue
Block a user