Question about multi target project

#1

The target i would like to achieve is to create a multi platform project, but i would like to work with Visual Studio for the development phase.
I build the engine for Vs2015 and for emscripten, and i am now trying to compile my simple project to visual studio.
The engine complain that my Urho home is indeed the emscripten one, so i did change the home and build the project.
Everything works good.

Did i have to change Uhro home everytime i need to create a project?
Is this the correct approach? Or did i miss some steps?

Thank you.

0 Likes

#2

multi platform target? this means multiple build environments, yes generally this means more projects, at worst, one for each build target. But your source code does not change, well never a lot, just the requirements and settings for the various targets.
I’ve built across multiple targets and it’s always been somewhat of a pain - but it can be done, some game engines actively support this concept more than others… mostly because they are commercial, and well-funded.

0 Likes

#3

I am not worried about that, i was just asking if this is the correct way to handle this.

0 Likes

#4

Generally, and without specific knowledge of your preferred IDE or build platform, yes this is the right way for targetting multiple platforms.

0 Likes

#5

this is usually where things like cmake come in - cmake can wrap your project code for a given target platform, sometimes.

0 Likes

#6

my base app tree:

(3.5.3_Default) max:myApp tree -L 5
.
β”œβ”€β”€ CMake -> /usr/local/Urho/Urho3D/CMake
β”œβ”€β”€ CMakeLists.txt -> /Users/max/Developer/Setup/urho/playground/my1.7/CMakeLists.txt
β”œβ”€β”€ bin
β”‚   β”œβ”€β”€ CoreData -> /usr/local/Urho/Urho3D/bin/CoreData
β”‚   β”œβ”€β”€ Data -> /usr/local/Urho/Urho3D/bin/Data
β”‚   └── GameData
β”‚       β”œβ”€β”€ Scenes
β”‚       β”‚   └── BaseThreeLights.xml
β”‚       β”œβ”€β”€ UI
β”‚       β”‚   └── UIWindowAndButton.xml
β”‚       └── dummy.txt
β”œβ”€β”€ build
β”‚   β”œβ”€β”€ android
β”‚   β”‚   β”œβ”€β”€ app
β”‚   β”‚   β”‚   β”œβ”€β”€ CMakeLists.txt
β”‚   β”‚   β”‚   β”œβ”€β”€ LIBRARIES.txt
β”‚   β”‚   β”‚   β”œβ”€β”€ SOURCES.txt
β”‚   β”‚   β”‚   β”œβ”€β”€ VARS.txt
β”‚   β”‚   β”‚   β”œβ”€β”€ build
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ generated
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ intermediates
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ outputs
β”‚   β”‚   β”‚   β”‚   └── tmp
β”‚   β”‚   β”‚   β”œβ”€β”€ build.gradle
β”‚   β”‚   β”‚   └── src
β”‚   β”‚   β”‚       └── main
β”‚   β”‚   β”œβ”€β”€ bin
β”‚   β”‚   β”‚   β”œβ”€β”€ CoreData -> /Users/max/Developer/Stage/Workspace/Urho/myApp/bin/CoreData
β”‚   β”‚   β”‚   β”œβ”€β”€ Data -> /Users/max/Developer/Stage/Workspace/Urho/myApp/bin/Data
β”‚   β”‚   β”‚   └── GameData -> /Users/max/Developer/Stage/Workspace/Urho/myApp/bin/GameData
β”‚   β”‚   β”œβ”€β”€ build
β”‚   β”‚   β”‚   └── android-profile
β”‚   β”‚   β”‚       β”œβ”€β”€ profile-2018-12-17-19-15-13-678.json
β”‚   β”‚   β”‚       └── profile-2018-12-17-19-15-13-678.rawproto
β”‚   β”‚   β”œβ”€β”€ build.gradle
β”‚   β”‚   β”œβ”€β”€ gradle
β”‚   β”‚   β”‚   └── wrapper
β”‚   β”‚   β”‚       β”œβ”€β”€ gradle-wrapper.jar
β”‚   β”‚   β”‚       └── gradle-wrapper.properties
β”‚   β”‚   β”œβ”€β”€ gradle.properties
β”‚   β”‚   β”œβ”€β”€ gradlew
β”‚   β”‚   β”œβ”€β”€ gradlew.bat
β”‚   β”‚   β”œβ”€β”€ local.properties
β”‚   β”‚   └── settings.gradle
β”‚   └── emscripten
β”‚       └── Debug
β”‚           β”œβ”€β”€ CMakeCache.txt
β”‚           β”œβ”€β”€ CMakeFiles
β”‚           β”‚   β”œβ”€β”€ 3.14.0
β”‚           β”‚   β”œβ”€β”€ CMakeDirectoryInformation.cmake
β”‚           β”‚   β”œβ”€β”€ CMakeOutput.log
β”‚           β”‚   β”œβ”€β”€ CMakeRelink.dir
β”‚           β”‚   β”œβ”€β”€ CMakeRuleHashes.txt
β”‚           β”‚   β”œβ”€β”€ CMakeTmp
β”‚           β”‚   β”œβ”€β”€ Makefile.cmake
β”‚           β”‚   β”œβ”€β”€ Makefile2
β”‚           β”‚   β”œβ”€β”€ RESOURCE_CHECK.dir
β”‚           β”‚   β”œβ”€β”€ TargetDirectories.txt
β”‚           β”‚   β”œβ”€β”€ cmake.check_cache
β”‚           β”‚   β”œβ”€β”€ myApp.dir
β”‚           β”‚   └── progress.marks
β”‚           β”œβ”€β”€ CTestTestfile.cmake
β”‚           β”œβ”€β”€ Makefile
β”‚           β”œβ”€β”€ Source
β”‚           β”‚   └── shell.html
β”‚           β”œβ”€β”€ bin
β”‚           β”‚   β”œβ”€β”€ CoreData -> /Users/max/Developer/Stage/Workspace/Urho/myApp/bin/CoreData
β”‚           β”‚   β”œβ”€β”€ CoreData.pak
β”‚           β”‚   β”œβ”€β”€ Data -> /Users/max/Developer/Stage/Workspace/Urho/myApp/bin/Data
β”‚           β”‚   β”œβ”€β”€ Data.pak
β”‚           β”‚   β”œβ”€β”€ GameData -> /Users/max/Developer/Stage/Workspace/Urho/myApp/bin/GameData
β”‚           β”‚   β”œβ”€β”€ GameData.pak
β”‚           β”‚   β”œβ”€β”€ myApp.data
β”‚           β”‚   β”œβ”€β”€ myApp.html
β”‚           β”‚   β”œβ”€β”€ myApp.html.map
β”‚           β”‚   └── myApp.js
β”‚           β”œβ”€β”€ cmake_install.cmake
β”‚           └── compile_commands.json
β”œβ”€β”€ cmake_clean.sh -> /usr/local/Urho/Urho3D/cmake_clean.sh
β”œβ”€β”€ cmake_emscripten.sh -> /usr/local/Urho/Urho3D/cmake_emscripten.sh
β”œβ”€β”€ cmake_generic.sh -> /usr/local/Urho/Urho3D/cmake_generic.sh
β”œβ”€β”€ setup
└── src
    β”œβ”€β”€ MyApp.cpp
    β”œβ”€β”€ MyApp.h
    β”œβ”€β”€ Sample.h
    └── Sample.inl

40 directories, 47 files
(3.5.3_Default) max:myApp 

one source, mutiple builds per system

I use an ad-hoc bash scripting system, but you can use the default scaffolding system with rake for generating quick project setup…

2 Likes