]>
Commit | Line | Data |
---|---|---|
eae0bfdc PP |
1 | # This function splits the sources files up into their appropriate |
2 | # subdirectories. This is especially useful for IDEs like Xcode and | |
3 | # Visual Studio, so that you can navigate into the libgit2_clar project, | |
4 | # and see the folders within the tests folder (instead of just seeing all | |
5 | # source and tests in a single folder.) | |
6 | FUNCTION(IDE_SPLIT_SOURCES target) | |
7 | IF(MSVC_IDE OR CMAKE_GENERATOR STREQUAL Xcode) | |
8 | GET_TARGET_PROPERTY(sources ${target} SOURCES) | |
9 | FOREACH(source ${sources}) | |
10 | IF(source MATCHES ".*/") | |
11 | STRING(REPLACE ${libgit2_SOURCE_DIR}/ "" rel ${source}) | |
12 | IF(rel) | |
13 | STRING(REGEX REPLACE "/([^/]*)$" "" rel ${rel}) | |
14 | IF(rel) | |
15 | STRING(REPLACE "/" "\\\\" rel ${rel}) | |
16 | SOURCE_GROUP(${rel} FILES ${source}) | |
17 | ENDIF() | |
18 | ENDIF() | |
19 | ENDIF() | |
20 | ENDFOREACH() | |
21 | ENDIF() | |
22 | ENDFUNCTION() |