Ok so before I do something wrong, let's review some points:
1. My mistake I explained in my previous point drove me to simply set OGRE_SOURCE to the root of the Ogre source directory and OGRE_BUILD to the directory of the CMake build (which in my case is the same as OGRE_SOURCE). This totally fix the CMake related problem, so I think it's better this way and it will work for any other additional dependencies that need to find Ogre and use FindOgre.
It would be good, I think to add to Ogre Procedural documentation that in case you have sources of Ogre and want to do as I did ( do add_subdirectory( ogre) then add_subdirectory( ogre_procedural) , then you should just set OGRE_SOURCE and OGRE_BUILD.
2. On the include problem, I can't see any good solution to keep everybody happy (without modifying Ogre itself). There are basically two ways:
A. Don't use the OGRE/ folder. This is the simple way because unfortunately sources directories don't match SDK directories on this point, so there is only one other way to make it work in both case, that is...
B. Use a macro for Ogre includes. Something that would allow you to do:
With OGRE_HEADER defined in a specific header that is generated at the CMake processing (using the configure() CMake function).
Then OGRE_HEADER would be defined as either :
Code: Select all
#define OGRE_HEADER( header_path__ ) "header_path__"
or
Code: Select all
#define OGRE_HEADER( header_path__ ) "OGRE/header_path__"
Depending on if CMake detected that it was a OGRE_SOURCE-based Ogre find, or an OGRE_HOME-based one.
So before putting more efforts in this, Mikachu, what do you prefer? I can easily do both obviously.
The problem is that the first solution don't ease users doing OGRE/blah, as said previously, but we can't change Ogre itself on this point AND I think the user of OgreProcedural should have an independent way of including Ogre, so in his code he should be able to use "OGRE/blah.h" while OgreProcedural use "blah.h".
The second solution, if you add an option on CMake, will be interesting for users as they will be able to choose, but frankly I don't think it's good for developers, maintenance and clarity. But that solves the problem too.
I'm fine if you prefer one or the other solution, I just want to be able to upgrade OgreProcedural without having to patch it.
What do you think?