Cleaned up build files.
This commit is contained in:
parent
550c252813
commit
f6676ca8e9
|
@ -14,6 +14,44 @@ rem ============================================================================
|
||||||
rem -- Parse arguments ---------------------------------------------------------
|
rem -- Parse arguments ---------------------------------------------------------
|
||||||
rem ============================================================================
|
rem ============================================================================
|
||||||
|
|
||||||
|
set DOC_STRING=Build LibCarla.
|
||||||
|
set USAGE_STRING=Usage: %FILE_N% [-h^|--help] [--rebuild] [--build] [--clean]
|
||||||
|
|
||||||
|
set REMOVE_INTERMEDIATE=false
|
||||||
|
set BUILD_OSM2ODR=false
|
||||||
|
|
||||||
|
:arg-parse
|
||||||
|
if not "%1"=="" (
|
||||||
|
if "%1"=="--rebuild" (
|
||||||
|
set REMOVE_INTERMEDIATE=true
|
||||||
|
set BUILD_OSM2ODR=true
|
||||||
|
)
|
||||||
|
if "%1"=="--build" (
|
||||||
|
set BUILD_OSM2ODR=true
|
||||||
|
)
|
||||||
|
if "%1"=="--clean" (
|
||||||
|
set REMOVE_INTERMEDIATE=true
|
||||||
|
)
|
||||||
|
if "%1"=="-h" (
|
||||||
|
echo %DOC_STRING%
|
||||||
|
echo %USAGE_STRING%
|
||||||
|
GOTO :eof
|
||||||
|
)
|
||||||
|
if "%1"=="--help" (
|
||||||
|
echo %DOC_STRING%
|
||||||
|
echo %USAGE_STRING%
|
||||||
|
GOTO :eof
|
||||||
|
)
|
||||||
|
shift
|
||||||
|
goto :arg-parse
|
||||||
|
)
|
||||||
|
|
||||||
|
if %REMOVE_INTERMEDIATE% == false (
|
||||||
|
if %BUILD_OSM2ODR% == false (
|
||||||
|
echo Nothing selected to be done.
|
||||||
|
goto :eof
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
rem ============================================================================
|
rem ============================================================================
|
||||||
rem -- Local Variables ---------------------------------------------------------
|
rem -- Local Variables ---------------------------------------------------------
|
||||||
|
@ -24,19 +62,66 @@ rem
|
||||||
set OSM2ODR_VSPROJECT_PATH=%INSTALLATION_DIR:/=\%osm2odr-visualstudio\
|
set OSM2ODR_VSPROJECT_PATH=%INSTALLATION_DIR:/=\%osm2odr-visualstudio\
|
||||||
set OSM2ODR_INSTALL_PATH=%ROOT_PATH:/=\%PythonAPI\carla\dependencies\
|
set OSM2ODR_INSTALL_PATH=%ROOT_PATH:/=\%PythonAPI\carla\dependencies\
|
||||||
|
|
||||||
if "%1"=="--rebuild" (
|
if %REMOVE_INTERMEDIATE% == true (
|
||||||
rmdir "%OSM2ODR_VSPROJECT_PATH%" /s /q
|
rem Remove directories
|
||||||
|
for %%G in (
|
||||||
|
"%OSM2ODR_INSTALL_PATH%",
|
||||||
|
) do (
|
||||||
|
if exist %%G (
|
||||||
|
echo %FILE_N% Cleaning %%G
|
||||||
|
rmdir /s/q %%G
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
if not exist "%OSM2ODR_VSPROJECT_PATH%" mkdir "%OSM2ODR_VSPROJECT_PATH%"
|
if not exist "%OSM2ODR_VSPROJECT_PATH%" mkdir "%OSM2ODR_VSPROJECT_PATH%"
|
||||||
cd "%OSM2ODR_VSPROJECT_PATH%"
|
cd "%OSM2ODR_VSPROJECT_PATH%"
|
||||||
|
|
||||||
cmake -G "Visual Studio 15 2017 Win64"^
|
rem Build OSM2ODR
|
||||||
-DCMAKE_CXX_FLAGS_RELEASE="/MD /MP"^
|
if %BUILD_OSM2ODR% == true (
|
||||||
-DCMAKE_INSTALL_PREFIX="%OSM2ODR_INSTALL_PATH:\=/%"^
|
cmake -G "Visual Studio 15 2017 Win64"^
|
||||||
"%ROOT_PATH%\Util\OSM2ODR"
|
-DCMAKE_CXX_FLAGS_RELEASE="/MD /MP"^
|
||||||
cmake --build . --config Release --target install | findstr /V "Up-to-date:"
|
-DCMAKE_INSTALL_PREFIX="%OSM2ODR_INSTALL_PATH:\=/%"^
|
||||||
|
"%ROOT_PATH%\Util\OSM2ODR"
|
||||||
|
if %errorlevel% neq 0 goto error_cmake
|
||||||
|
|
||||||
endlocal
|
cmake --build . --config Release --target install | findstr /V "Up-to-date:"
|
||||||
exit /b 0
|
if %errorlevel% neq 0 goto error_install
|
||||||
|
)
|
||||||
|
|
||||||
|
goto success
|
||||||
|
|
||||||
|
rem ============================================================================
|
||||||
|
rem -- Messages and Errors -----------------------------------------------------
|
||||||
|
rem ============================================================================
|
||||||
|
|
||||||
|
:success
|
||||||
|
if %BUILD_OSM2ODR% == true echo %FILE_N% OSM2ODR has been successfully installed in "%OSM2ODR_INSTALL_PATH%"!
|
||||||
|
goto good_exit
|
||||||
|
|
||||||
|
:error_cmake
|
||||||
|
echo.
|
||||||
|
echo %FILE_N% [ERROR] An error ocurred while executing the cmake.
|
||||||
|
echo [ERROR] Possible causes:
|
||||||
|
echo [ERROR] - Make sure "CMake" is installed.
|
||||||
|
echo [ERROR] - Make sure it is available on your Windows "path".
|
||||||
|
echo [ERROR] - CMake 3.9.0 or higher is required.
|
||||||
|
goto bad_exit
|
||||||
|
|
||||||
|
:error_install
|
||||||
|
echo.
|
||||||
|
echo %FILE_N% [ERROR] An error ocurred while installing using Visual Studio 15 2017 Win64.
|
||||||
|
echo [ERROR] Possible causes:
|
||||||
|
echo [ERROR] - Make sure you have Visual Studio installed.
|
||||||
|
echo [ERROR] - Make sure you have the "x64 Visual C++ Toolset" in your path.
|
||||||
|
echo [ERROR] For example using the "Visual Studio x64 Native Tools Command Prompt",
|
||||||
|
echo [ERROR] or the "vcvarsall.bat".
|
||||||
|
goto bad_exit
|
||||||
|
|
||||||
|
:good_exit
|
||||||
|
endlocal
|
||||||
|
exit /b 0
|
||||||
|
|
||||||
|
:bad_exit
|
||||||
|
endlocal
|
||||||
|
exit /b %errorlevel%
|
||||||
|
|
|
@ -2,26 +2,89 @@
|
||||||
|
|
||||||
source $(dirname "$0")/Environment.sh
|
source $(dirname "$0")/Environment.sh
|
||||||
|
|
||||||
# define clang compiler
|
function get_source_code_checksum {
|
||||||
export CC=/usr/bin/clang-8
|
local EXCLUDE='*__pycache__*'
|
||||||
export CXX=/usr/bin/clang++-8
|
find "${OSM2ODR_ROOT_FOLDER}"/* \! -path "${EXCLUDE}" -print0 | sha1sum | awk '{print $1}'
|
||||||
|
}
|
||||||
|
|
||||||
OSM2ODR_BASE_DIR=${CARLA_ROOT_FOLDER}/Util/OSM2ODR
|
DOC_STRING="Build OSM2ODR."
|
||||||
OSM2ODR_BUILD_DIR=${CARLA_ROOT_FOLDER}/Build/osm2odr-build
|
|
||||||
OSM2ODR_BIN_DIR=${OSM2ODR_BASE_DIR}/bin
|
|
||||||
[ ! -d ${OSM2ODR_BUILD_DIR} ] && mkdir ${OSM2ODR_BUILD_DIR}
|
|
||||||
|
|
||||||
cd ${OSM2ODR_BUILD_DIR}
|
USAGE_STRING=$(cat <<- END
|
||||||
|
Usage: $0 [-h|--help]
|
||||||
|
|
||||||
case $1 in
|
commands
|
||||||
--rebuild)
|
|
||||||
rm -r * || true
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
cmake ${OSM2ODR_BASE_DIR} \
|
[--clean] Clean intermediate files.
|
||||||
-G "Eclipse CDT4 - Ninja" \
|
[--rebuild] Clean and rebuild both configurations.
|
||||||
-DCMAKE_INSTALL_PREFIX=${LIBCARLA_INSTALL_CLIENT_FOLDER}
|
END
|
||||||
|
)
|
||||||
|
|
||||||
ninja osm2odr
|
REMOVE_INTERMEDIATE=false
|
||||||
ninja install
|
BUILD_OSM2ODR=false
|
||||||
|
|
||||||
|
OPTS=`getopt -o h --long help,rebuild,build,clean -n 'parse-options' -- "$@"`
|
||||||
|
|
||||||
|
if [ $? != 0 ] ; then echo "$USAGE_STRING" ; exit 2 ; fi
|
||||||
|
|
||||||
|
eval set -- "$OPTS"
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
case $1 in
|
||||||
|
--rebuild )
|
||||||
|
REMOVE_INTERMEDIATE=true;
|
||||||
|
BUILD_OSM2ODR=true;
|
||||||
|
shift ;;
|
||||||
|
--build )
|
||||||
|
BUILD_OSM2ODR=true;
|
||||||
|
shift ;;
|
||||||
|
--clean )
|
||||||
|
REMOVE_INTERMEDIATE=true;
|
||||||
|
shift ;;
|
||||||
|
-h | --help )
|
||||||
|
echo "$DOC_STRING"
|
||||||
|
echo "$USAGE_STRING"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
break ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if ! { ${REMOVE_INTERMEDIATE} || ${BUILD_OSM2ODR}; }; then
|
||||||
|
fatal_error "Nothing selected to be done."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ==============================================================================
|
||||||
|
# -- Clean intermediate files --------------------------------------------------
|
||||||
|
# ==============================================================================
|
||||||
|
|
||||||
|
if ${REMOVE_INTERMEDIATE} ; then
|
||||||
|
|
||||||
|
log "Cleaning intermediate files and folders."
|
||||||
|
|
||||||
|
rm -Rf ${OSM2ODR_BUILD_FOLDER}*
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ==============================================================================
|
||||||
|
# -- Build library -------------------------------------------------------------
|
||||||
|
# ==============================================================================
|
||||||
|
|
||||||
|
if ${BUILD_OSM2ODR} ; then
|
||||||
|
|
||||||
|
[ ! -d ${OSM2ODR_BUILD_FOLDER} ] && mkdir ${OSM2ODR_BUILD_FOLDER}
|
||||||
|
cd ${OSM2ODR_BUILD_FOLDER}
|
||||||
|
# define clang compiler
|
||||||
|
export CC=/usr/bin/clang-8
|
||||||
|
export CXX=/usr/bin/clang++-8
|
||||||
|
|
||||||
|
cmake ${OSM2ODR_ROOT_FOLDER} \
|
||||||
|
-G "Eclipse CDT4 - Ninja" \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=${LIBCARLA_INSTALL_CLIENT_FOLDER}
|
||||||
|
|
||||||
|
ninja osm2odr
|
||||||
|
ninja install
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "Success!"
|
||||||
|
|
|
@ -28,15 +28,19 @@ clean.PythonAPI:
|
||||||
@${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.sh --clean
|
@${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.sh --clean
|
||||||
clean.CarlaUE4Editor:
|
clean.CarlaUE4Editor:
|
||||||
@${CARLA_BUILD_TOOLS_FOLDER}/BuildCarlaUE4.sh --clean
|
@${CARLA_BUILD_TOOLS_FOLDER}/BuildCarlaUE4.sh --clean
|
||||||
clean: clean.CarlaUE4Editor clean.PythonAPI clean.LibCarla
|
clean.osm2odr:
|
||||||
|
@${CARLA_BUILD_TOOLS_FOLDER}/BuildOSM2ODR.sh --clean
|
||||||
|
clean: clean.CarlaUE4Editor clean.PythonAPI clean.LibCarla clean.osm2odr
|
||||||
|
|
||||||
rebuild: setup
|
rebuild: setup
|
||||||
@${CARLA_BUILD_TOOLS_FOLDER}/BuildLibCarla.sh --rebuild
|
@${CARLA_BUILD_TOOLS_FOLDER}/BuildLibCarla.sh --rebuild
|
||||||
|
@${CARLA_BUILD_TOOLS_FOLDER}/BuildOSM2ODR.sh --rebuild
|
||||||
@${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.sh --rebuild
|
@${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.sh --rebuild
|
||||||
@${CARLA_BUILD_TOOLS_FOLDER}/BuildCarlaUE4.sh --rebuild
|
@${CARLA_BUILD_TOOLS_FOLDER}/BuildCarlaUE4.sh --rebuild
|
||||||
|
|
||||||
hard-clean:
|
hard-clean:
|
||||||
@${CARLA_BUILD_TOOLS_FOLDER}/BuildCarlaUE4.sh --hard-clean
|
@${CARLA_BUILD_TOOLS_FOLDER}/BuildCarlaUE4.sh --hard-clean
|
||||||
|
@${CARLA_BUILD_TOOLS_FOLDER}/BuildOSM2ODR.sh --clean
|
||||||
@${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.sh --clean
|
@${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.sh --clean
|
||||||
@${CARLA_BUILD_TOOLS_FOLDER}/BuildLibCarla.sh --clean
|
@${CARLA_BUILD_TOOLS_FOLDER}/BuildLibCarla.sh --clean
|
||||||
@echo "To force recompiling dependencies run: rm -Rf ${CARLA_BUILD_FOLDER}"
|
@echo "To force recompiling dependencies run: rm -Rf ${CARLA_BUILD_FOLDER}"
|
||||||
|
@ -151,4 +155,4 @@ build.utils: PythonAPI
|
||||||
@${CARLA_BUILD_TOOLS_FOLDER}/BuildUtilsDocker.sh
|
@${CARLA_BUILD_TOOLS_FOLDER}/BuildUtilsDocker.sh
|
||||||
|
|
||||||
osm2odr:
|
osm2odr:
|
||||||
@${CARLA_BUILD_TOOLS_FOLDER}/BuildOSM2ODR.sh $(ARGS)
|
@${CARLA_BUILD_TOOLS_FOLDER}/BuildOSM2ODR.sh --build
|
|
@ -19,6 +19,9 @@ LIBCARLA_BUILD_CLIENT_FOLDER=${CARLA_BUILD_FOLDER}/libcarla-client-build
|
||||||
LIBCARLA_INSTALL_SERVER_FOLDER=${CARLAUE4_PLUGIN_ROOT_FOLDER}/CarlaDependencies
|
LIBCARLA_INSTALL_SERVER_FOLDER=${CARLAUE4_PLUGIN_ROOT_FOLDER}/CarlaDependencies
|
||||||
LIBCARLA_INSTALL_CLIENT_FOLDER=${CARLA_PYTHONAPI_SOURCE_FOLDER}/dependencies
|
LIBCARLA_INSTALL_CLIENT_FOLDER=${CARLA_PYTHONAPI_SOURCE_FOLDER}/dependencies
|
||||||
|
|
||||||
|
OSM2ODR_ROOT_FOLDER=${CURDIR}/Util/OSM2ODR
|
||||||
|
OSM2ODR_BUILD_FOLDER=${CARLA_BUILD_FOLDER}/libosm2dr-build
|
||||||
|
|
||||||
CARLAUE4_PLUGIN_DEPS_FOLDER=${CARLAUE4_PLUGIN_ROOT_FOLDER}/CarlaDependencies
|
CARLAUE4_PLUGIN_DEPS_FOLDER=${CARLAUE4_PLUGIN_ROOT_FOLDER}/CarlaDependencies
|
||||||
|
|
||||||
LIBSTDCPP_TOOLCHAIN_FILE=${CARLA_BUILD_FOLDER}/LibStdCppToolChain.cmake
|
LIBSTDCPP_TOOLCHAIN_FILE=${CARLA_BUILD_FOLDER}/LibStdCppToolChain.cmake
|
||||||
|
|
|
@ -42,10 +42,12 @@ clean:
|
||||||
@"${CARLA_BUILD_TOOLS_FOLDER}/BuildCarlaUE4.bat" --clean
|
@"${CARLA_BUILD_TOOLS_FOLDER}/BuildCarlaUE4.bat" --clean
|
||||||
@"${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.bat" --clean
|
@"${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.bat" --clean
|
||||||
@"${CARLA_BUILD_TOOLS_FOLDER}/BuildLibCarla.bat" --clean
|
@"${CARLA_BUILD_TOOLS_FOLDER}/BuildLibCarla.bat" --clean
|
||||||
|
@${CARLA_BUILD_TOOLS_FOLDER}/BuildOSM2ODR.bat --clean
|
||||||
|
|
||||||
rebuild: setup
|
rebuild: setup
|
||||||
@"${CARLA_BUILD_TOOLS_FOLDER}/BuildCarlaUE4.bat" --clean
|
@"${CARLA_BUILD_TOOLS_FOLDER}/BuildCarlaUE4.bat" --clean
|
||||||
@"${CARLA_BUILD_TOOLS_FOLDER}/BuildLibCarla.bat" --rebuild
|
@"${CARLA_BUILD_TOOLS_FOLDER}/BuildLibCarla.bat" --rebuild
|
||||||
|
@${CARLA_BUILD_TOOLS_FOLDER}/BuildOSM2ODR.bat --rebuild
|
||||||
@"${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.bat" --rebuild
|
@"${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.bat" --rebuild
|
||||||
|
|
||||||
check: PythonAPI
|
check: PythonAPI
|
||||||
|
@ -79,4 +81,4 @@ deploy:
|
||||||
@"${CARLA_BUILD_TOOLS_FOLDER}/Deploy.bat" $(ARGS)
|
@"${CARLA_BUILD_TOOLS_FOLDER}/Deploy.bat" $(ARGS)
|
||||||
|
|
||||||
osm2odr:
|
osm2odr:
|
||||||
@${CARLA_BUILD_TOOLS_FOLDER}/BuildOSM2ODR.bat $(ARGS)
|
@${CARLA_BUILD_TOOLS_FOLDER}/BuildOSM2ODR.bat --build
|
|
@ -1,24 +1,4 @@
|
||||||
set(netconvertlibs
|
|
||||||
netwrite netimport netbuild foreign_eulerspiral ${GDAL_LIBRARY} netimport_vissim netimport_vissim_typeloader netimport_vissim_tempstructs ${commonlibs})
|
|
||||||
|
|
||||||
#add_subdirectory(foreign)
|
|
||||||
#add_subdirectory(netbuild)
|
|
||||||
#add_subdirectory(netimport)
|
|
||||||
#add_subdirectory(netwrite)
|
|
||||||
#add_subdirectory(utils)
|
|
||||||
|
|
||||||
#add_executable(netconvert netconvert_main.cpp)
|
|
||||||
#set_target_properties(netconvert PROPERTIES OUTPUT_NAME netconvert${BINARY_SUFFIX})
|
|
||||||
#set_target_properties(netconvert PROPERTIES OUTPUT_NAME_DEBUG netconvert${BINARY_SUFFIX}D)
|
|
||||||
#target_link_libraries(netconvert ${netconvertlibs})
|
|
||||||
#add_dependencies(netconvert generate-version-h)
|
|
||||||
|
|
||||||
#install(TARGETS netconvert RUNTIME DESTINATION bin)
|
|
||||||
|
|
||||||
set(osm2odr_sources "OSM2ODR.cpp")
|
set(osm2odr_sources "OSM2ODR.cpp")
|
||||||
#add_library(osm2odr STATIC ${osm2odr_sources})
|
|
||||||
#target_link_libraries(osm2odr ${netconvertlibs})
|
|
||||||
#install(TARGETS osm2odr ARCHIVE DESTINATION lib)
|
|
||||||
|
|
||||||
configure_file(config.h.cmake config.h)
|
configure_file(config.h.cmake config.h)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue