aboutsummaryrefslogtreecommitdiff
path: root/src/CmakeModule.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-03-21 14:56:51 +0100
committerdec05eba <dec05eba@protonmail.com>2018-03-21 14:58:31 +0100
commit23117906c571714b0b55caf35cf9f876d1f9fa2e (patch)
tree21574306de1efb6eafd2af48f5188bf9e3550dd8 /src/CmakeModule.cpp
parentb44ff4ec7d2c2458aab04b5daf79134e5d284f6e (diff)
Add sub projects (should be used with git submodules)
Fix issue where static lib dependencies are not built correctly because their dynamic lib dependencies are not propagated to dependant project
Diffstat (limited to 'src/CmakeModule.cpp')
-rw-r--r--src/CmakeModule.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/CmakeModule.cpp b/src/CmakeModule.cpp
index 990bf36..eeb8a9c 100644
--- a/src/CmakeModule.cpp
+++ b/src/CmakeModule.cpp
@@ -53,12 +53,15 @@ namespace sibs
}
string dynamicLinkerFlags;
- // TODO: If project contains no source files, then we shouldn't override this function
- dynamicLinkerFlagCallbackFunc = [&dynamicLinkerFlags](const string &linkerFlag)
+ // TODO: If project contains no source files, then we shouldn't override this function... why?
+ if(!dynamicLinkerFlagCallbackFunc || config.getPackageType() != PackageType::STATIC)
{
- dynamicLinkerFlags += " ";
- dynamicLinkerFlags += linkerFlag;
- };
+ dynamicLinkerFlagCallbackFunc = [&dynamicLinkerFlags](const string &linkerFlag)
+ {
+ dynamicLinkerFlags += " ";
+ dynamicLinkerFlags += linkerFlag;
+ };
+ }
// TODO: Create a cmake module that contains library/include path for the dependencies (https://cmake.org/Wiki/CMake:How_To_Find_Libraries).
// Modify the project CMakeLists.txt and add: list(APPEND CMAKE_MODULE_PATH "PathToDependenciesCmakeModulesGoesHere").