target_include_directories vs include_directories

Hello,

There is a problem with calling include_directories for all modules.

include_directories (${MAIN_MOD_DIR})

Since it is a global setting for all imported targets, it also populates the include directory for NECI.

When I now compile OpenMolcas with embedded NECI I get an error like:

/home/weser/code/OpenMolcas/External/NECI/src/real_time_init.F90:34:24:

     use constants, only: dp, n_int, int64, lenof_sign, inum_runs, stdout
                        1
Error: Symbol ‘dp’ referenced at (1) not found in module ‘constants’

because both programs have a module called constants.

If the include directories were instead a PUBLIC property of the target libmolcas it should work without problems.

Edited by Oskar Weser