How should I setup a C++ project on github so that it is portable? -


i start c++ project on github such able clone/build on different operating systems (for example, osx , unix). there lots of dependencies need installed (for example curl, libxml2, etc), , possible i'd avoid having user need manually install deps on system. possible this?

it depends on how want bite off.

the short answer let cmake work. generate projects whatever platform , should usable. don't need distribute binaries this, assuming readily available (and them, extension).

here example sets sqlite, boost, , eigen used 1 of projects.

cmake_minimum_required(version 2.8) set(cmake_module_path ${cmake_current_source_dir}/modules)  # boost find_package(boost 1.42.0 required ) include_directories(${boost_include_dirs}) link_directories(${boost_library_dirs})  find_package(eigen required) include_directories(${eigen_include_dirs})  find_package(sqlite3 required) include_directories(${sqlite3_include_dir})  set(cmake_cxx_flags "-std=c++0x")  include_directories(.)  link_libraries(     ${boost_libraries}     ${sqlite3_libraries} )  add_executable(igd_sqlite     main.cpp ) 

you'd take , generate visual studio projects, makefiles, etc. build project would.

cmake supports lots of libraries out of box, though have google less popular ones , add them project.

i use day-to-day work, when don't need cross platform.

when want distribute binaries, setup external folder binary files.

here example:

https://github.com/tomisarobot/curl_race

this works great if don't have lot of external dependencies , if aren't huge. when isn't case, i'd recommend putting each plattform in different repositories. source should in own too. can use subprojects if want, though isn't strictly necessary. external deps dont change often, not worth overhead. write bash script document everything. script necessary distribution build anyway.

things maven-nar-plugin exist, though unaware of maturity. if you're creating binaries distribute source anyway, maybe isn't attractive. don't see lot of talk it, assume adoption low. having seen maven java, should more popular.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -