From 23557d11ffa359dfa0a370a13adc2fa5379e8a95 Mon Sep 17 00:00:00 2001 From: admercs Date: Tue, 20 Feb 2024 11:46:28 -0800 Subject: [PATCH] update windows build --- cmake/AutonomyLib/CMakeLists.txt | 3 ++- cmake/AutonomyLibUnitTests/CMakeLists.txt | 5 ++--- cmake/CMakeLists.txt | 6 +++--- cmake/DroneServer/CMakeLists.txt | 5 ++--- cmake/DroneShell/CMakeLists.txt | 5 ++--- cmake/HelloCar/CMakeLists.txt | 7 +++---- cmake/HelloDrone/CMakeLists.txt | 7 +++---- cmake/HelloSpawnedDrones/CMakeLists.txt | 7 +++---- cmake/MavLinkCom/CMakeLists.txt | 1 + cmake/rpclib_wrapper/CMakeLists.txt | 1 + scripts/build.ps1 | 22 +++++++++++----------- scripts/test_cmake.psm1 | 12 ++++++------ scripts/test_eigen.psm1 | 10 +++++----- scripts/test_rpclib.psm1 | 10 +++++----- scripts/test_unrealasset.psm1 | 10 +++++----- scripts/test_visualstudio.psm1 | 10 +++++----- 16 files changed, 59 insertions(+), 62 deletions(-) diff --git a/cmake/AutonomyLib/CMakeLists.txt b/cmake/AutonomyLib/CMakeLists.txt index 57b27e05..72d876f6 100644 --- a/cmake/AutonomyLib/CMakeLists.txt +++ b/cmake/AutonomyLib/CMakeLists.txt @@ -3,8 +3,8 @@ project(AutonomyLib) LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake-modules") INCLUDE("${CMAKE_CURRENT_LIST_DIR}/../cmake-modules/CommonSetup.cmake") -CommonSetup() +CommonSetup() IncludeEigen() include_directories( @@ -26,6 +26,7 @@ file(GLOB_RECURSE ${PROJECT_NAME}_sources add_library(${PROJECT_NAME} STATIC ${${PROJECT_NAME}_sources}) CommonTargetLink() + target_link_libraries(${PROJECT_NAME} ${RPC_LIB}) target_link_libraries(${PROJECT_NAME} MavLinkCom) diff --git a/cmake/AutonomyLibUnitTests/CMakeLists.txt b/cmake/AutonomyLibUnitTests/CMakeLists.txt index 87198891..5f9b6dd3 100644 --- a/cmake/AutonomyLibUnitTests/CMakeLists.txt +++ b/cmake/AutonomyLibUnitTests/CMakeLists.txt @@ -3,10 +3,9 @@ project(AutonomyLibUnitTests) LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake-modules") INCLUDE("${CMAKE_CURRENT_LIST_DIR}/../cmake-modules/CommonSetup.cmake") -CommonSetup() +CommonSetup() IncludeEigen() - SetupConsoleBuild() include_directories( @@ -16,8 +15,8 @@ include_directories( ) AddExecutableSource() - CommonTargetLink() + target_link_libraries(${PROJECT_NAME} AutonomyLib) target_link_libraries(${PROJECT_NAME} MavLinkCom) target_link_libraries(${PROJECT_NAME} ${RPC_LIB}) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 3ae60c78..17e8c19b 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1,12 +1,12 @@ cmake_minimum_required(VERSION 3.5.0) project(AutonomySim) -add_subdirectory("rpclib_wrapper") add_subdirectory("AutonomyLib") -add_subdirectory("MavLinkCom") add_subdirectory("AutonomyLibUnitTests") +add_subdirectory("rpclib_wrapper") +add_subdirectory("MavLinkCom") +add_subdirectory("HelloCar") add_subdirectory("HelloDrone") add_subdirectory("HelloSpawnedDrones") -add_subdirectory("HelloCar") add_subdirectory("DroneShell") add_subdirectory("DroneServer") diff --git a/cmake/DroneServer/CMakeLists.txt b/cmake/DroneServer/CMakeLists.txt index 23ea810e..546b5aea 100644 --- a/cmake/DroneServer/CMakeLists.txt +++ b/cmake/DroneServer/CMakeLists.txt @@ -3,10 +3,9 @@ project(DroneServer) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake-modules") include("${CMAKE_CURRENT_LIST_DIR}/../cmake-modules/CommonSetup.cmake") -CommonSetup() +CommonSetup() IncludeEigen() - SetupConsoleBuild() include_directories( @@ -17,8 +16,8 @@ include_directories( ) AddExecutableSource() - CommonTargetLink() + target_link_libraries(${PROJECT_NAME} AutonomyLib) target_link_libraries(${PROJECT_NAME} MavLinkCom) target_link_libraries(${PROJECT_NAME} ${RPC_LIB}) diff --git a/cmake/DroneShell/CMakeLists.txt b/cmake/DroneShell/CMakeLists.txt index f10f0bb1..55bc93eb 100644 --- a/cmake/DroneShell/CMakeLists.txt +++ b/cmake/DroneShell/CMakeLists.txt @@ -3,10 +3,9 @@ project(DroneShell) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake-modules") include("${CMAKE_CURRENT_LIST_DIR}/../cmake-modules/CommonSetup.cmake") -CommonSetup() +CommonSetup() IncludeEigen() - SetupConsoleBuild() include_directories( @@ -18,7 +17,7 @@ include_directories( ) AddExecutableSource() - CommonTargetLink() + target_link_libraries(${PROJECT_NAME} AutonomyLib) target_link_libraries(${PROJECT_NAME} ${RPC_LIB}) diff --git a/cmake/HelloCar/CMakeLists.txt b/cmake/HelloCar/CMakeLists.txt index 5db446dd..f55c2ae5 100644 --- a/cmake/HelloCar/CMakeLists.txt +++ b/cmake/HelloCar/CMakeLists.txt @@ -3,10 +3,9 @@ project(HelloCar) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake-modules") include("${CMAKE_CURRENT_LIST_DIR}/../cmake-modules/CommonSetup.cmake") -CommonSetup() +CommonSetup() IncludeEigen() - SetupConsoleBuild() ## Specify additional locations of header files @@ -18,8 +17,8 @@ include_directories( ${AUTONOMYSIM_ROOT}/MavLinkCom/common_utils ) -AddExecutableSource() - +AddExecutableSource() CommonTargetLink() + target_link_libraries(${PROJECT_NAME} AutonomyLib) target_link_libraries(${PROJECT_NAME} ${RPC_LIB}) diff --git a/cmake/HelloDrone/CMakeLists.txt b/cmake/HelloDrone/CMakeLists.txt index e9183076..18deeb1c 100644 --- a/cmake/HelloDrone/CMakeLists.txt +++ b/cmake/HelloDrone/CMakeLists.txt @@ -3,10 +3,9 @@ project(HelloDrone) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake-modules") include("${CMAKE_CURRENT_LIST_DIR}/../cmake-modules/CommonSetup.cmake") -CommonSetup() +CommonSetup() IncludeEigen() - SetupConsoleBuild() ## Specify additional locations of header files @@ -18,8 +17,8 @@ include_directories( ${AUTONOMYSIM_ROOT}/MavLinkCom/common_utils ) -AddExecutableSource() - +AddExecutableSource() CommonTargetLink() + target_link_libraries(${PROJECT_NAME} AutonomyLib) target_link_libraries(${PROJECT_NAME} ${RPC_LIB}) diff --git a/cmake/HelloSpawnedDrones/CMakeLists.txt b/cmake/HelloSpawnedDrones/CMakeLists.txt index db8dcf91..745665bd 100644 --- a/cmake/HelloSpawnedDrones/CMakeLists.txt +++ b/cmake/HelloSpawnedDrones/CMakeLists.txt @@ -3,10 +3,9 @@ project(HelloSpawnedDrones) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake-modules") include("${CMAKE_CURRENT_LIST_DIR}/../cmake-modules/CommonSetup.cmake") -CommonSetup() +CommonSetup() IncludeEigen() - SetupConsoleBuild() ## Specify additional locations of header files @@ -18,8 +17,8 @@ include_directories( ${AUTONOMYSIM_ROOT}/MavLinkCom/common_utils ) -AddExecutableSource() - +AddExecutableSource() CommonTargetLink() + target_link_libraries(${PROJECT_NAME} AutonomyLib) target_link_libraries(${PROJECT_NAME} ${RPC_LIB}) diff --git a/cmake/MavLinkCom/CMakeLists.txt b/cmake/MavLinkCom/CMakeLists.txt index 8673d717..dd4c652a 100644 --- a/cmake/MavLinkCom/CMakeLists.txt +++ b/cmake/MavLinkCom/CMakeLists.txt @@ -5,6 +5,7 @@ add_subdirectory("MavLinkTest") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake-modules") include("${CMAKE_CURRENT_LIST_DIR}/../cmake-modules/CommonSetup.cmake") + CommonSetup() include_directories( diff --git a/cmake/rpclib_wrapper/CMakeLists.txt b/cmake/rpclib_wrapper/CMakeLists.txt index 2e08978f..60a1f415 100644 --- a/cmake/rpclib_wrapper/CMakeLists.txt +++ b/cmake/rpclib_wrapper/CMakeLists.txt @@ -3,6 +3,7 @@ project(rpclib_wrapper) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake-modules") include("${CMAKE_CURRENT_LIST_DIR}/../cmake-modules/CommonSetup.cmake") + CommonSetup() if(UNIX) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 5ea0549e..99806b54 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -47,21 +47,21 @@ param( # NOTE: Prefer Import-Module to Get-Content for its scoping rules -# Common utilities: -# Add-Directories, Remove-Directories, Invoke-Fail, Test-WorkingDirectory, Test-VariableDefined, -# Get-EnvVariables, Get-ProgramVersion, Get-VersionMajorMinor, Get-VersionMajorMinorBuild, -# Get-WindowsInfo, Get-WindowsVersion, Get-Architecture, Get-ArchitectureWidth, Set-ProcessorCount -Import-Module "${PWD}\scripts\utils.psm1" +# Common utilities +Import-Module "${PWD}\scripts\utils.psm1" # imports: Add-Directories, Remove-Directories, Invoke-Fail, Test-WorkingDirectory, + # Test-VariableDefined, Get-EnvVariables, Get-ProgramVersion, Get-VersionMajorMinor, + # Get-VersionMajorMinorBuild, Get-WindowsInfo, Get-WindowsVersion, Get-Architecture, + # Get-ArchitectureWidth, Set-ProcessorCount # Documentation -Import-Module "${PWD}\scripts\build_docs.psm1" # imports: Build-Documentation +Import-Module "${PWD}\scripts\build_docs.psm1" # imports: Build-Documentation # Tests -Import-Module "${PWD}\scripts\test_visualstudio.psm1" # imports: VS_VERSION_MINIMUM, Set-VsInstance, Get-VsInstanceVersion, Test-VisualStudioVersion -Import-Module "${PWD}\scripts\test_cmake.psm1" # imports: CMAKE_VERSION_MINIMUM, Test-CmakeVersion -Import-Module "${PWD}\scripts\test_rpclib.psm1" # imports: RPCLIB_VERSION, Test-RpcLibVersion -Import-Module "${PWD}\scripts\test_eigen.psm1" # imports: EIGEN_VERSION, Test-EigenVersion -Import-Module "${PWD}\scripts\test_unrealasset.psm1" # imports: ASSET_SUV_VERSION, Test-AssetSuvVersion +Import-Module "${PWD}\scripts\test_visualstudio.psm1" # imports: VS_VERSION_MINIMUM, Set-VsInstance, Get-VsInstanceVersion, Test-VisualStudioVersion +Import-Module "${PWD}\scripts\test_cmake.psm1" # imports: CMAKE_VERSION_MINIMUM, Test-CmakeVersion +Import-Module "${PWD}\scripts\test_rpclib.psm1" # imports: RPCLIB_VERSION, Test-RpcLibVersion +Import-Module "${PWD}\scripts\test_eigen.psm1" # imports: EIGEN_VERSION, Test-EigenVersion +Import-Module "${PWD}\scripts\test_unrealasset.psm1" # imports: ASSET_SUV_VERSION, Test-AssetSuvVersion ### ### Variables diff --git a/scripts/test_cmake.psm1 b/scripts/test_cmake.psm1 index fabc1f5b..695c6e9b 100644 --- a/scripts/test_cmake.psm1 +++ b/scripts/test_cmake.psm1 @@ -17,11 +17,11 @@ NOTES: ### Imports ### -# Common utilities: -# Add-Directories, Remove-Directories, Invoke-Fail, Test-WorkingDirectory, Test-VariableDefined, -# Get-EnvVariables, Get-ProgramVersion, Get-VersionMajorMinor, Get-VersionMajorMinorBuild, -# Get-WindowsInfo, Get-WindowsVersion, Get-Architecture, Get-ArchitectureWidth, Set-ProcessorCount -Import-Module "${PWD}\scripts\utils.psm1" +# Common utilities +Import-Module "${PWD}\scripts\utils.psm1" # imports: Add-Directories, Remove-Directories, Invoke-Fail, Test-WorkingDirectory, + # Test-VariableDefined, Get-EnvVariables, Get-ProgramVersion, Get-VersionMajorMinor, + # Get-VersionMajorMinorBuild, Get-WindowsInfo, Get-WindowsVersion, Get-Architecture, + # Get-ArchitectureWidth, Set-ProcessorCount ### ### Variables @@ -47,7 +47,7 @@ function Install-Cmake { $VersionMajMinBuild = Get-VersionMajorMinorBuild $Version $Installer = "cmake-${VersionMajMinBuild}-x86_64.msi" Invoke-WebRequest "https://cmake.org/files/v${VersionMajMin}/${Installer}" -OutFile "temp\${Installer}" - Start-Process -FilePath "temp\${Installer}" -Wait + Start-Process -FilePath "temp\${Installer}" -Wait -NoNewWindow Remove-Item -Path "temp\${Installer}" } else { diff --git a/scripts/test_eigen.psm1 b/scripts/test_eigen.psm1 index 496138e5..b7cff0aa 100644 --- a/scripts/test_eigen.psm1 +++ b/scripts/test_eigen.psm1 @@ -17,11 +17,11 @@ NOTES: ### Imports ### -# Common utilities: -# Add-Directories, Remove-Directories, Invoke-Fail, Test-WorkingDirectory, Test-VariableDefined, -# Get-EnvVariables, Get-ProgramVersion, Get-VersionMajorMinor, Get-VersionMajorMinorBuild, -# Get-WindowsInfo, Get-WindowsVersion, Get-Architecture, Get-ArchitectureWidth, Set-ProcessorCount -Import-Module "${PWD}\scripts\utils.psm1" +# Common utilities +Import-Module "${PWD}\scripts\utils.psm1" # imports: Add-Directories, Remove-Directories, Invoke-Fail, Test-WorkingDirectory, + # Test-VariableDefined, Get-EnvVariables, Get-ProgramVersion, Get-VersionMajorMinor, + # Get-VersionMajorMinorBuild, Get-WindowsInfo, Get-WindowsVersion, Get-Architecture, + # Get-ArchitectureWidth, Set-ProcessorCount ### ### Variables diff --git a/scripts/test_rpclib.psm1 b/scripts/test_rpclib.psm1 index 86c5cbbe..467c3b1a 100644 --- a/scripts/test_rpclib.psm1 +++ b/scripts/test_rpclib.psm1 @@ -17,11 +17,11 @@ NOTES: ### Imports ### -# Common utilities: -# Add-Directories, Remove-Directories, Invoke-Fail, Test-WorkingDirectory, Test-VariableDefined, -# Get-EnvVariables, Get-ProgramVersion, Get-VersionMajorMinor, Get-VersionMajorMinorBuild, -# Get-WindowsInfo, Get-WindowsVersion, Get-Architecture, Get-ArchitectureWidth, Set-ProcessorCount -Import-Module "${PWD}\scripts\utils.psm1" +# Common utilities +Import-Module "${PWD}\scripts\utils.psm1" # imports: Add-Directories, Remove-Directories, Invoke-Fail, Test-WorkingDirectory, + # Test-VariableDefined, Get-EnvVariables, Get-ProgramVersion, Get-VersionMajorMinor, + # Get-VersionMajorMinorBuild, Get-WindowsInfo, Get-WindowsVersion, Get-Architecture, + # Get-ArchitectureWidth, Set-ProcessorCount ### ### Variables diff --git a/scripts/test_unrealasset.psm1 b/scripts/test_unrealasset.psm1 index fc496a0c..90b55cbb 100644 --- a/scripts/test_unrealasset.psm1 +++ b/scripts/test_unrealasset.psm1 @@ -17,11 +17,11 @@ NOTES: ### Imports ### -# Common utilities: -# Add-Directories, Remove-Directories, Invoke-Fail, Test-WorkingDirectory, Test-VariableDefined, -# Get-EnvVariables, Get-ProgramVersion, Get-VersionMajorMinor, Get-VersionMajorMinorBuild, -# Get-WindowsInfo, Get-WindowsVersion, Get-Architecture, Get-ArchitectureWidth, Set-ProcessorCount -Import-Module "${PWD}\scripts\utils.psm1" +# Common utilities +Import-Module "${PWD}\scripts\utils.psm1" # imports: Add-Directories, Remove-Directories, Invoke-Fail, Test-WorkingDirectory, + # Test-VariableDefined, Get-EnvVariables, Get-ProgramVersion, Get-VersionMajorMinor, + # Get-VersionMajorMinorBuild, Get-WindowsInfo, Get-WindowsVersion, Get-Architecture, + # Get-ArchitectureWidth, Set-ProcessorCount ### ### Variables diff --git a/scripts/test_visualstudio.psm1 b/scripts/test_visualstudio.psm1 index ce5bff37..29ca6604 100644 --- a/scripts/test_visualstudio.psm1 +++ b/scripts/test_visualstudio.psm1 @@ -17,11 +17,11 @@ NOTES: ### Imports ### -# Common utilities: -# Add-Directories, Remove-Directories, Invoke-Fail, Test-WorkingDirectory, Test-VariableDefined, -# Get-EnvVariables, Get-ProgramVersion, Get-VersionMajorMinor, Get-VersionMajorMinorBuild, -# Get-WindowsInfo, Get-WindowsVersion, Get-Architecture, Get-ArchitectureWidth, Set-ProcessorCount -Import-Module "${PWD}\scripts\utils.psm1" +# Common utilities +Import-Module "${PWD}\scripts\utils.psm1" # imports: Add-Directories, Remove-Directories, Invoke-Fail, Test-WorkingDirectory, + # Test-VariableDefined, Get-EnvVariables, Get-ProgramVersion, Get-VersionMajorMinor, + # Get-VersionMajorMinorBuild, Get-WindowsInfo, Get-WindowsVersion, Get-Architecture, + # Get-ArchitectureWidth, Set-ProcessorCount ### ### Variables