-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmake: get_subdir_var_files: Do not prepend dirname for absolute paths #3176
Conversation
@PaulWessel Please try if this PR can solve the problem in #3130. |
OK, do I change
and do I set set (SUPPL_EXTRA_DIRS newsuppl) |
YES.
I think both should work. |
With newsuppl I get this:
With full path I get this:
So the latter seems allowable but requires a binary directory specified. Do they mean the BUILD dir? |
I just realize that your SUPPL_PROGS_SRCS may be incorrect. You should only list the modules in SUPPL_PROGS_SRCS. For any header files and non-module C files, you should list them either in SUPPL_HEADERS or SUPPL_LIB_SRCS. |
Yes, moving that correctly works (this is with newsuppl link).
So this works for the relative path. |
The full syntax of add_subdirectory is
So we can specify the binary directory explicitly. For the full path case, I think the binary directory is required. |
So while gsfml.so is built, it is the supplements.so that has the functions and list of moduleinfo for that library. It works, but ideally the glue should be in gsfml.so. That means the moduleinfo file must skip adding the modules if SUPPL_NAME is set |
Yes I guess since it is all the same binary dir that might work. |
Sorry, in the supplement dir CMakefile I now have this
Delete the SUPPL_NAME, right? I added
and it builds gmt_gsfhl_glue.c in the build/src/newsuppl dir. However, there will have to be some changes to your macro to also separate out the gsfml modules into a gmt_gsfml_moduleinfo.h file in that directory. |
Ideally, it should be SUPPL_LIB_NAME, not SHARED_LIB_NAME.
and |
Couple of issues with that:
setting |
We use SHARED_LIB_NAME to set it to supplements in the main CMakeLists.txt file so it seems reasonable to set it to something else if we want to build a separate shared library, no? |
In case you want to play with it, here is the gsfml src directory (here called gsfml). |
Your concerns above are addressed in #3177. |
Check if a file is an absolute path before prepending the dirname.
Also update the indentations of the GET_SUBDIR_LIST macro.