I have a directory tree like this:
libs support db csv patterns support_qt helpers dialogs etc.
Now when I do the add_subdirectory in the support level, I can add db and patterns and the files are collected. However in db I added another add_subdirectory referencing the csv, but somehow this is ignored.
In support
set(SUPPORT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/support_defs.h ${CMAKE_CURRENT_SOURCE_DIR}/support_dll_api.h ${CMAKE_CURRENT_SOURCE_DIR}/supportlib_namespace.h ${CMAKE_CURRENT_SOURCE_DIR}/dll_main.cpp ) add_subdirectory (db) add_subdirectory (patterns) In db
set(SUPPORT_SOURCE ${SUPPORT_SOURCE} ${CMAKE_CURRENT_SOURCE_DIR}/column_types.h ${CMAKE_CURRENT_SOURCE_DIR}/dbcolumn.h ${CMAKE_CURRENT_SOURCE_DIR}/database_login.h ${CMAKE_CURRENT_SOURCE_DIR}/database_login.cpp ${CMAKE_CURRENT_SOURCE_DIR}/type_helper.h ${CMAKE_CURRENT_SOURCE_DIR}/type_helper.cpp PARENT_SCOPE ) add_subdirectory(csv) The above works fine but in csv
set(SUPPORT_SOURCE ${SUPPORT_SOURCE} ${CMAKE_CURRENT_SOURCE_DIR}/csv.h ${CMAKE_CURRENT_SOURCE_DIR}/csv.cpp PARENT_SCOPE ) But these files are not included in the build. So do I have to put the add_subdirectory calls all into the root file?
set(SUPPORT_SOURCE ${SUPPORT_SOURCE} ${CMAKE_CURRENT_SOURCE_DIR}/dbcolumn.h [...] CACHE INTERNAL "")But I am not sure how it works with a variable set multiple times.