Specifying an alternative source file directory with biicode - c++

I am trying to use biicode to manager dependencies for my project so that I can automate things like boost or sqlite and use travis-ci
From what I understand bii is expecting your source files to be at the root folder of your block like mentionned in their tutorials:
|-- my_project
| +-- bii
| +-- bin
| +-- blocks
| | +-- myuser
| | | +-- my_block
| | | | |-- main.cpp
| | | | |-- biicode.conf
But in my case, the source file is like this
|-- my_project
| +-- bii
| +-- bin
| +-- blocks
| | +-- myuser
| | | +-- my_block
| | | | |-- src
| | | | | +--folderA
| | | | | | +--core
| | | | | | |-- various .cpp
| | | | | | +--impl
| | | | | | |-- various .cpp
| | | | | |-- various .cpp
| | | | |-- biicode.conf
and running configuration keep missing these folders
bii cpp:configure
I have read the doc about biicode.conf but it doesn't mention an alternative path for source files.
So my question is, do I really need to put everything as a flat directory where every source file is in the same folder to use biicode ?
EDIT: I forgot to mention that I am trying to build a library (to be used in another bii project), not an executable

You can sort your block like you want inside your blocks/my_user/my_block. For example, take a look to this block:
fenix/flatbuffers block
Here there is a structure without any pattern.
biicode.conf, among other things, helps you to tell biicode where your header files (but not source ones) are, thanks to [paths]section, because the source ones biicode detects them automatically, else you could customize your dependencies with [dependencies]section.
Making an example with this layout:
|-- my_project
| +-- bii
| +-- bin
| +-- blocks
| | +-- myuser
| | | +-- my_block
| | | | |-- src
| | | | | +--folderA
| | | | | | +--core
| | | | | | |-- core.h
| | | | | | |-- core.cpp
| | | | | | +--impl
| | | | | | |-- impl_ext.h
| | | | | | |-- impl.h
| | | | | | +--src
| | | | | | |-- impl.cpp
| | | | | | |-- impl_ext.cpp
| | | | | |-- CMakeLists.txt
| | | | |-- biicode.conf
| | | | |-- CMakeLists.txt
Then, your .cpp files might have relative includes like:
#include "core/core.h"
#include "impl/impl.h"
#include "impl/impl_ext.h"
Supposing your CMakeLists.txt files are right, you'd only have to tell biicode where it must search this "relative" headers, so write into the biicode.conf:
[paths]
folderA/core
folderA/impl
I hope it resolves your doubts! ;)

Related

GLOB_RECURSE grabbing the wrong source file

My source project directory is something like this,
|── CMakeLists.txt
|
├── src
| |
| |
| |
| └── a
| | |
| | |__ a.cpp
| |
| |
| |
| └── b
| |
| |__ b.cpp
|
|___test
|
|__test.cpp
I need to make a executable out of source a.cpp and b.cpp,
file(GLOB_RECURSE SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/*/ *.cpp)
I expect this to take a.cpp and b.cpp as the only source files, but when I print
message("All source file - ${SRC_FILES}")
It picks up test.cpp as well, which I don't know why it's happening. My understanding here is ${CMAKE_CURRENT_SOURCE_DIR}/src/*/ *.cpp, in this statement
due to wildcard * it would go through each subdirectory of src folder, and then with *.cpp it would append all the cpp files inside each of these subdirectory.

Including header files with full path VisualStudio c++

Let's say I have such project structure
|-- DynamicLoader
| `-- dmc
| |-- DynamicLoader.h
| |-- Loader
| | |-- DynamicLibrary.cpp
| | |-- DynamicLibrary.h
| | |-- LibraryManager.cpp
| | |-- LibraryManager.h
| |-- Utils
| | |-- Utils.h
| |-- dmc.cpp
| |-- dmc.h
where dmc.h is my pre-compiled header.
I want to use it for example in my source files located in Loader folder like this: #include "dmc/dmc.h
but the intelisense complains about it and I have to use those semantics:
#include "../dmc.h"
is there anyway to achieve this in visual studio? I've seen one project that worked similarly to this but I couldn't figure it out by myself

How cmake handle include_directories() for a project with nested folder

The problem is solved, it is due to other dependency of my project, it has nothing wrong with cmake. Thanks for everyone trying to help in the question.
Here is my project tree Tree 1:
project
| + src
| | + other_src
| | | - abc.cpp
| | | - abc.h
| | - main.cpp
| - CMakeLists.txt
3rd_party
| + pcap
| | - pcap.h
| - pcap.h
Inside my CMakeLists.txt, I do:
include_directories("/path/to/3rd_party")
Inside my abc.cpp, I have:
#include "pcap.h"
Then I do cmake and make. I get error pcap.h: No such file or directory
I then change my project tree Tree 2:
project
| + src
| | - abc.cpp
| | - abc.h
| | - main.cpp
| - CMakeLists.txt
3rd_party
| + pcap
| | - pcap.h
| - pcap.h
Without modifying my CMakeLists.txt, I do cmake and make again. The header file is found.
How can I build this project while my source code is placed in different folders?

502 error with django, gunicorn and Nginx

Been trying to set up django to work with nginx and gunicorn for a few days, followed a digital ocean guide for the setup, tried numerous solutions found in this forum but none worked for me.
This is my first stackoverflow post, if it's miss-formated or poorly written based on how you like to read the posts I'd like to hear it so that I can improve.
Starting gunicorn from the folder
/home/django/virtualenv/sio/SiO
running the command
gunicorn --bind 0.0.0.0:8000 SiO.wsgi:application
works just fine, I've tried setting this to be the sock-folder. But my latest try has been for /home/django/virtualenv/sio/SiO/SiO where the wsgi.py file resides.
when looking at the nginx error log I find
2017/05/03 13:56:34 [emerg] 29248#29248: invalid number of arguments in "proxy_pass" directive in /etc/nginx/sites-enabled/sio:12
2017/05/03 13:58:54 [crit] 29275#29275: *1 connect() to unix:/home/django/virtualenv/sio/SiO.sock failed (2: No such file or directory) while connecting to upstream, client: 158.39.197.123, server: 67.207.75.163, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/virtualenv/sio/SiO.sock:/", host: "67.207.75.163"
2017/05/03 14:03:53 [crit] 29275#29275: *4 connect() to unix:/home/django/virtualenv/sio/SiO.sock failed (2: No such file or directory) while connecting to upstream, client: 158.39.197.123, server: 67.207.75.163, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/virtualenv/sio/SiO.sock:/", host: "67.207.75.163"
2017/05/03 14:06:02 [crit] 29422#29422: *1 connect() to unix:/home/django/virtualenv/sio/SiO.sock failed (2: No such file or directory) while connecting to upstream, client: 158.39.197.123, server: 67.207.75.163, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/virtualenv/sio/SiO.sock:/", host: "67.207.75.163"
2017/05/03 14:11:51 [crit] 29422#29422: *5 connect() to unix:/home/django/virtualenv/sio/SiO.sock failed (2: No such file or directory) while connecting to upstream, client: 158.39.197.123, server: 67.207.75.163, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/virtualenv/sio/SiO.sock:/", host: "67.207.75.163"
2017/05/03 14:13:10 [crit] 29422#29422: *9 connect() to unix:/home/django/virtualenv/sio/SiO.sock failed (2: No such file or directory) while connecting to upstream, client: 158.39.197.123, server: 67.207.75.163, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/virtualenv/sio/SiO.sock:/", host: "67.207.75.163"
2017/05/03 14:25:34 [crit] 29422#29422: *11 connect() to unix:/home/django/virtualenv/sio/SiO.sock failed (2: No such file or directory) while connecting to upstream, client: 158.39.197.123, server: 67.207.75.163, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/virtualenv/sio/SiO.sock:/", host: "67.207.75.163"
2017/05/03 14:51:30 [crit] 712#712: *1 connect() to unix:/home/django/virtualenv/sio/SiO.sock failed (2: No such file or directory) while connecting to upstream, client: 158.39.197.123, server: 67.207.75.163, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/virtualenv/sio/SiO.sock:/", host: "67.207.75.163"
2017/05/03 15:00:41 [crit] 954#954: *1 connect() to unix:/home/django/virtualenv/sio/SiO/SiO.sock failed (2: No such file or directory) while connecting to upstream, client: 158.39.197.123, server: 67.207.75.163, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/virtualenv/sio/SiO/SiO.sock:/", host: "67.207.75.163"
2017/05/03 15:02:00 [crit] 1069#1069: *1 connect() to unix:/home/django/virtualenv/sio/SiO/SiO.sock failed (2: No such file or directory) while connecting to upstream, client: 158.39.197.123, server: 67.207.75.163, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/virtualenv/sio/SiO/SiO.sock:/", host: "67.207.75.163"
There is no .sock file anywhere in my project. I tried this fix.
Tree view of the project structure:
|-- SiO
| |-- calapp
| | |-- migrations
| | | |-- __pycache__
| | | | `-- __init__.cpython-35.pyc
| | | `-- __init__.py
| | |-- __pycache__
| | | |-- admin.cpython-35.pyc
| | | |-- __init__.cpython-35.pyc
| | | |-- models.cpython-35.pyc
| | | |-- urls.cpython-35.pyc
| | | `-- views.cpython-35.pyc
| | |-- static
| | | |-- css
| | | | |-- calendar.css
| | | | |-- responsive.css
| | | | `-- sidebar.css
| | | `-- js
| | | |-- calendar.js
| | | `-- jquery-1.12.4.min.js
| | |-- templates
| | | `-- calapp
| | | |-- calendar (copy).html
| | | `-- calendar.html
| | |-- admin.py
| | |-- apps.py
| | |-- forms.py
| | |-- __init__.py
| | |-- models.py
| | |-- tests.py
| | |-- urls.py
| | `-- views.py
| |-- chart
| | |-- migrations
| | | |-- __pycache__
| | | | `-- __init__.cpython-35.pyc
| | | `-- __init__.py
| | |-- __pycache__
| | | |-- admin.cpython-35.pyc
| | | |-- __init__.cpython-35.pyc
| | | |-- models.cpython-35.pyc
| | | |-- urls.cpython-35.pyc
| | | `-- views.cpython-35.pyc
| | |-- static
| | | |-- css
| | | | `-- chart.css
| | | `-- js
| | | `-- chart.js
| | |-- templates
| | | `-- chart
| | | `-- ChartView.html
| | |-- admin.py
| | |-- apps.py
| | |-- __init__.py
| | |-- models.py
| | |-- tests.py
| | |-- urls.py
| | `-- views.py
| |-- CoAdmin
| | |-- migrations
| | | |-- __pycache__
| | | | |-- 0001_initial.cpython-35.pyc
| | | | |-- 0002_auto_20170413_0316.cpython-35.pyc
| | | | |-- 0003_auto_20170413_1514.cpython-35.pyc
| | | | `-- __init__.cpython-35.pyc
| | | |-- 0001_initial.py
| | | |-- 0002_auto_20170413_0316.py
| | | |-- 0003_auto_20170413_1514.py
| | | `-- __init__.py
| | |-- __pycache__
| | | |-- admin.cpython-35.pyc
| | | |-- forms.cpython-35.pyc
| | | |-- __init__.cpython-35.pyc
| | | |-- models.cpython-35.pyc
| | | |-- serializers.cpython-35.pyc
| | | |-- urls.cpython-35.pyc
| | | `-- views.cpython-35.pyc
| | |-- static
| | | `-- css
| | | `-- signup.css
| | |-- templates
| | | `-- CoAdmin
| | | |-- admin_delete.html
| | | |-- admin_edit.html
| | | |-- admin_overview.html
| | | |-- InnsideSignup.html
| | | |-- password.html
| | | `-- signup.html
| | |-- admin.py
| | |-- apps.py
| | |-- forms.py
| | |-- __init__.py
| | |-- models.py
| | |-- serializers.py
| | |-- tests.py
| | |-- urls.py
| | `-- views.py
| |-- core
| | |-- migrations
| | | |-- __pycache__
| | | | `-- __init__.cpython-35.pyc
| | | `-- __init__.py
| | |-- __pycache__
| | | |-- admin.cpython-35.pyc
| | | |-- forms.cpython-35.pyc
| | | |-- __init__.cpython-35.pyc
| | | |-- models.cpython-35.pyc
| | | |-- urls.cpython-35.pyc
| | | `-- views.cpython-35.pyc
| | |-- static
| | | |-- css
| | | | |-- animate.css
| | | | |-- cover.css
| | | | |-- dashboard.css
| | | | |-- network.css
| | | | `-- profile.css
| | | |-- img
| | | | |-- logo.svg
| | | | `-- SiOLogo.png
| | | `-- js
| | | `-- picture.js
| | |-- templates
| | | `-- core
| | | |-- cover.html
| | | |-- dashboard.html
| | | |-- partial_settings_menu.html
| | | |-- password.html
| | | |-- profile.html
| | | `-- settings.html
| | |-- admin.py
| | |-- apps.py
| | |-- forms.py
| | |-- __init__.py
| | |-- models.py
| | |-- tests.py
| | |-- urls.py
| | `-- views.py
| |-- member
| | |-- migrations
| | | |-- __pycache__
| | | | |-- 0001_initial.cpython-35.pyc
| | | | `-- __init__.cpython-35.pyc
| | | |-- 0001_initial.py
| | | `-- __init__.py
| | |-- __pycache__
| | | |-- admin.cpython-35.pyc
| | | |-- forms.cpython-35.pyc
| | | |-- __init__.cpython-35.pyc
| | | |-- models.cpython-35.pyc
| | | |-- serializers.cpython-35.pyc
| | | |-- urls.cpython-35.pyc
| | | `-- views.cpython-35.pyc
| | |-- static
| | | `-- css
| | | |-- member_overview.css
| | | `-- member_signup.css
| | |-- templates
| | | `-- member
| | | |-- asoc_signup.html
| | | |-- member_confirm_delete.html
| | | |-- member_delete.html
| | | |-- member_edit.html
| | | |-- member_overview.html
| | | `-- member_signup.html
| | |-- admin.py
| | |-- apps.py
| | |-- forms.py
| | |-- __init__.py
| | |-- models.py
| | |-- serializers.py
| | |-- tests.py
| | |-- urls.py
| | `-- views.py
| |-- post
| | |-- migrations
| | | |-- __pycache__
| | | | |-- 0001_initial.cpython-35.pyc
| | | | |-- 0002_auto_20170413_1514.cpython-35.pyc
| | | | |-- 0003_remove_email_sendstatus.cpython-35.pyc
| | | | `-- __init__.cpython-35.pyc
| | | |-- 0001_initial.py
| | | |-- 0002_auto_20170413_1514.py
| | | |-- 0003_remove_email_sendstatus.py
| | | `-- __init__.py
| | |-- __pycache__
| | | |-- admin.cpython-35.pyc
| | | |-- __init__.cpython-35.pyc
| | | |-- mail.cpython-35.pyc
| | | |-- models.cpython-35.pyc
| | | |-- urls.cpython-35.pyc
| | | `-- views.cpython-35.pyc
| | |-- static
| | | |-- css
| | | | `-- post.css
| | | `-- javascript
| | | `-- post.js
| | |-- templates
| | | `-- post
| | | `-- post.html
| | |-- admin.py
| | |-- apps.py
| | |-- __init__.py
| | |-- mail.py
| | |-- models.py
| | |-- tests.py
| | |-- urls.py
| | `-- views.py
| |-- __pycache__
| | |-- __init__.cpython-35.pyc
| | |-- settings.cpython-35.pyc
| | |-- urls.cpython-35.pyc
| | `-- wsgi.cpython-35.pyc
| |-- static
| | |-- css
| | | |-- jquery.Jcrop.min.css
| | | `-- SiO.css
| | |-- img
| | | |-- sio-logo.jpg
| | | `-- user.png
| | `-- js
| | |-- date.js
| | |-- ga.js
| | |-- jquery.bullseye-1.0-min.js
| | |-- jquery.Jcrop.min.js
| | |-- jquery.selection.js
| | |-- jquery.typeahead.bundle.js
| | |-- SiO.js
| | `-- SiO.markdown.js
| |-- templates
| | |-- admin
| | | `-- chart_association.html
| | |-- 403.html
| | |-- 404.html
| | |-- 500.html
| | `-- base.html
| |-- __init__.py
| |-- settings.py
| |-- urls.py
| `-- wsgi.py
|-- staticfiles
| |-- admin
| | |-- css
| | | |-- base.css
| | | |-- changelists.css
| | | |-- dashboard.css
| | | |-- fonts.css
| | | |-- forms.css
| | | |-- login.css
| | | |-- rtl.css
| | | `-- widgets.css
| | |-- fonts
| | | |-- LICENSE.txt
| | | |-- README.txt
| | | |-- Roboto-Bold-webfont.woff
| | | |-- Roboto-Light-webfont.woff
| | | `-- Roboto-Regular-webfont.woff
| | |-- img
| | | |-- gis
| | | | |-- move_vertex_off.svg
| | | | `-- move_vertex_on.svg
| | | |-- calendar-icons.svg
| | | |-- icon-addlink.svg
| | | |-- icon-alert.svg
| | | |-- icon-calendar.svg
| | | |-- icon-changelink.svg
| | | |-- icon-clock.svg
| | | |-- icon-deletelink.svg
| | | |-- icon-no.svg
| | | |-- icon-unknown-alt.svg
| | | |-- icon-unknown.svg
| | | |-- icon-yes.svg
| | | |-- inline-delete.svg
| | | |-- LICENSE
| | | |-- README.txt
| | | |-- search.svg
| | | |-- selector-icons.svg
| | | |-- sorting-icons.svg
| | | |-- tooltag-add.svg
| | | `-- tooltag-arrowright.svg
| | `-- js
| | |-- admin
| | | |-- DateTimeShortcuts.js
| | | `-- RelatedObjectLookups.js
| | |-- vendor
| | | |-- jquery
| | | | |-- jquery.js
| | | | |-- jquery.min.js
| | | | `-- LICENSE-JQUERY.txt
| | | `-- xregexp
| | | |-- LICENSE-XREGEXP.txt
| | | |-- xregexp.js
| | | `-- xregexp.min.js
| | |-- actions.js
| | |-- actions.min.js
| | |-- calendar.js
| | |-- cancel.js
| | |-- change_form.js
| | |-- collapse.js
| | |-- collapse.min.js
| | |-- core.js
| | |-- inlines.js
| | |-- inlines.min.js
| | |-- jquery.init.js
| | |-- popup_response.js
| | |-- prepopulate_init.js
| | |-- prepopulate.js
| | |-- prepopulate.min.js
| | |-- SelectBox.js
| | |-- SelectFilter2.js
| | |-- timeparse.js
| | `-- urlify.js
| |-- css
| | |-- animate.css
| | |-- bootstrap-datetimepicker.css
| | |-- bootstrap.min.css
| | |-- calendar.css
| | |-- chart.css
| | |-- cover.css
| | |-- dashboard.css
| | |-- datetimepicker.css
| | |-- jquery.Jcrop.min.css
| | |-- member_overview.css
| | |-- member_signup.css
| | |-- network.css
| | |-- post.css
| | |-- profile.css
| | |-- responsive.css
| | |-- sidebar.css
| | |-- signup.css
| | `-- SiO.css
| |-- fonts
| | |-- glyphicons-halflings-regular.eot
| | |-- glyphicons-halflings-regular.svg
| | |-- glyphicons-halflings-regular.ttf
| | |-- glyphicons-halflings-regular.woff
| | `-- glyphicons-halflings-regular.woff2
| |-- img
| | |-- logo.svg
| | |-- sio-logo.jpg
| | |-- SiOLogo.png
| | `-- user.png
| |-- javascript
| | `-- post.js
| |-- js
| | |-- locales
| | | |-- bootstrap-datetimepicker.ar.js
| | | |-- bootstrap-datetimepicker.bg.js
| | | |-- bootstrap-datetimepicker.ca.js
| | | |-- bootstrap-datetimepicker.cs.js
| | | |-- bootstrap-datetimepicker.da.js
| | | |-- bootstrap-datetimepicker.de.js
| | | |-- bootstrap-datetimepicker.ee.js
| | | |-- bootstrap-datetimepicker.el.js
| | | |-- bootstrap-datetimepicker.es.js
| | | |-- bootstrap-datetimepicker.fi.js
| | | |-- bootstrap-datetimepicker.fr.js
| | | |-- bootstrap-datetimepicker.he.js
| | | |-- bootstrap-datetimepicker.hr.js
| | | |-- bootstrap-datetimepicker.hu.js
| | | |-- bootstrap-datetimepicker.id.js
| | | |-- bootstrap-datetimepicker.is.js
| | | |-- bootstrap-datetimepicker.it.js
| | | |-- bootstrap-datetimepicker.ja.js
| | | |-- bootstrap-datetimepicker.ko.js
| | | |-- bootstrap-datetimepicker.kr.js
| | | |-- bootstrap-datetimepicker.lt.js
| | | |-- bootstrap-datetimepicker.lv.js
| | | |-- bootstrap-datetimepicker.ms.js
| | | |-- bootstrap-datetimepicker.nb.js
| | | |-- bootstrap-datetimepicker.nl.js
| | | |-- bootstrap-datetimepicker.no.js
| | | |-- bootstrap-datetimepicker.pl.js
| | | |-- bootstrap-datetimepicker.pt-BR.js
| | | |-- bootstrap-datetimepicker.pt.js
| | | |-- bootstrap-datetimepicker.ro.js
| | | |-- bootstrap-datetimepicker.rs.js
| | | |-- bootstrap-datetimepicker.rs-latin.js
| | | |-- bootstrap-datetimepicker.ru.js
| | | |-- bootstrap-datetimepicker.sk.js
| | | |-- bootstrap-datetimepicker.sl.js
| | | |-- bootstrap-datetimepicker.sv.js
| | | |-- bootstrap-datetimepicker.sw.js
| | | |-- bootstrap-datetimepicker.th.js
| | | |-- bootstrap-datetimepicker.tr.js
| | | |-- bootstrap-datetimepicker.ua.js
| | | |-- bootstrap-datetimepicker.uk.js
| | | |-- bootstrap-datetimepicker.zh-CN.js
| | | `-- bootstrap-datetimepicker.zh-TW.js
| | |-- bootstrap-datetimepicker.js
| | |-- calendar.js
| | |-- chart.js
| | |-- date.js
| | |-- ga.js
| | |-- jquery-1.12.4.min.js
| | |-- jquery.bullseye-1.0-min.js
| | |-- jquery.Jcrop.min.js
| | |-- jquery.selection.js
| | |-- jquery.typeahead.bundle.js
| | |-- picture.js
| | |-- SiO.js
| | `-- SiO.markdown.js
| `-- rest_framework
| |-- css
| | |-- bootstrap.min.css
| | |-- bootstrap-tweaks.css
| | |-- default.css
| | `-- prettify.css
| |-- docs
| | |-- css
| | | |-- base.css
| | | |-- bootstrap.min.css
| | | |-- bootstrap-theme.min.css
| | | |-- font-awesome-4.0.3.css
| | | |-- highlight.css
| | | `-- jquery.json-view.min.css
| | |-- fonts
| | | |-- fontawesome-webfont.eot
| | | |-- fontawesome-webfont.svg
| | | |-- fontawesome-webfont.ttf
| | | |-- fontawesome-webfont.woff
| | | |-- glyphicons-halflings-regular.eot
| | | |-- glyphicons-halflings-regular.svg
| | | |-- glyphicons-halflings-regular.ttf
| | | |-- glyphicons-halflings-regular.woff
| | | `-- glyphicons-halflings-regular.woff2
| | |-- img
| | | |-- favicon.ico
| | | `-- grid.png
| | `-- js
| | |-- api.js
| | |-- base.js
| | |-- bootstrap.min.js
| | |-- highlight.pack.js
| | |-- jquery-1.10.2.min.js
| | `-- jquery.json-view.min.js
| |-- fonts
| | |-- glyphicons-halflings-regular.eot
| | |-- glyphicons-halflings-regular.svg
| | |-- glyphicons-halflings-regular.ttf
| | |-- glyphicons-halflings-regular.woff
| | `-- glyphicons-halflings-regular.woff2
| |-- img
| | |-- glyphicons-halflings.png
| | |-- glyphicons-halflings-white.png
| | `-- grid.png
| `-- js
| |-- ajax-form.js
| |-- bootstrap.min.js
| |-- coreapi-0.1.0.js
| |-- csrf.js
| |-- default.js
| |-- jquery-1.12.4.min.js
| `-- prettify-min.js
|-- manage.py
`-- requirements.txt
My gunicorn file is located in
/home/django/virtualenv/sio/bin/gunicorn
Content of /etc/systemd/system/gunicorn.service
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
User=django
Group=www-data
WorkingDirectory=/home/django/virtualenv/sio/SiO
ExecStart=/home/django/virtualenv/sio/bin/gunicorn --workers 3 --bind unix:/home/django/virtualenv/sio/SiO/SiO SiO.wsgi:application
[Install]
WantedBy=multi-user.target
and my /etc/nginx/sites-available/sio file
server {
listen 80;
server_name 67.207.75.163;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/django/virtualenv/sio/SiO;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/django/virtualenv/sio/SiO/SiO.sock;
}
}
The site works when trying to run using only the django built inn webserver. When trying to access using gunicorn I get a 502 error.
You're missing ".sock" in this line:
ExecStart=/home/django/virtualenv/sio/bin/gunicorn --workers 3 --bind unix:/home/django/virtualenv/sio/SiO/SiO SiO.wsgi:application
You're binding to a folder instead of a sock file, but you're telling nginx to look for /home/django/virtualenv/sio/SiO/SiO.sock
So, perhaps try this:
ExecStart=/home/django/virtualenv/sio/bin/gunicorn --workers 3 --bind unix:/home/django/virtualenv/sio/SiO/SiO.sock SiO.wsgi:application
EDIT: By the way, I'm a massive fan of this setup and can't recommend it highly enough - http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
Making the changes you suggested did not fix the problem, trying the guide you sent in a new VM did how ever fix everything. Thank you! It was excellent, normally digital ocean guides are my go-to but you have convinced me to look other places too :).

How to organize project using cmake and separated headers

I am currently starting a new project using C++ and CMake,
in my last project I organized the code the following:
src
|--foo
| |--bar.cpp
| |--bar.hpp
| |--CMakeLists.txt
|--baz
| |--anotherFoo
| | |--Bahama.cpp
| | |--Bahama.hpp
| | |--CMakeLists.txt
| |--baz.cpp
| |--baz.hpp
| |--CMakeLists.txt
|--CMakeLists.txt
so every subdirectory got its own CMakeLists.txt, which was included as library from other CMakeList files.
Now I want to separate the .hpp and the .cpp files.
Something like this:
src
|--foo
| |--bar.cpp
| |--CMakeLists.txt
|--baz
| |--anotherFoo
| | |--Bahama.cpp
| | |--CMakeLists.txt
| |--baz.cpp
| |--CMakeLists.txt
|--CMakeLists.txt
include
|--foo
| |--bar.hpp
| |--CMakeLists.txt
|--baz
| |--anotherFoo
| | |--Bahama.hpp
| | |--CMakeLists.txt
| |--baz.hpp
| |--CMakeLists.txt
|--CMakeLists.txt
What I am supposed to do with the CmakeLists files?
Do I also need a CMakeLists file in every subdirectory, like I did in my example above? Or is there another way to do this?
What do I write in this CMake files
In the future I also want to add documentation with doxygen, how can I enable Doxygen support via Cmake in a structure like this?
should also every subdirectory get its own?