diff options
Diffstat (limited to 'cmake/IdeSplitSources.cmake')
-rw-r--r-- | cmake/IdeSplitSources.cmake | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/cmake/IdeSplitSources.cmake b/cmake/IdeSplitSources.cmake index e2e09b4ce..4f928ac08 100644 --- a/cmake/IdeSplitSources.cmake +++ b/cmake/IdeSplitSources.cmake @@ -1,22 +1,22 @@ # This function splits the sources files up into their appropriate # subdirectories. This is especially useful for IDEs like Xcode and -# Visual Studio, so that you can navigate into the libgit2_clar project, +# Visual Studio, so that you can navigate into the libgit2_tests project, # and see the folders within the tests folder (instead of just seeing all # source and tests in a single folder.) -FUNCTION(IDE_SPLIT_SOURCES target) - IF(MSVC_IDE OR CMAKE_GENERATOR STREQUAL Xcode) - GET_TARGET_PROPERTY(sources ${target} SOURCES) - FOREACH(source ${sources}) - IF(source MATCHES ".*/") - STRING(REPLACE ${libgit2_SOURCE_DIR}/ "" rel ${source}) - IF(rel) - STRING(REGEX REPLACE "/([^/]*)$" "" rel ${rel}) - IF(rel) - STRING(REPLACE "/" "\\\\" rel ${rel}) - SOURCE_GROUP(${rel} FILES ${source}) - ENDIF() - ENDIF() - ENDIF() - ENDFOREACH() - ENDIF() -ENDFUNCTION() +function(IDE_SPLIT_SOURCES target) + if(MSVC_IDE OR CMAKE_GENERATOR STREQUAL Xcode) + get_target_property(sources ${target} SOURCES) + foreach(source ${sources}) + if(source MATCHES ".*/") + string(REPLACE ${PROJECT_SOURCE_DIR}/ "" rel ${source}) + if(rel) + string(REGEX REPLACE "/([^/]*)$" "" rel ${rel}) + if(rel) + string(REPLACE "/" "\\\\" rel ${rel}) + source_group(${rel} FILES ${source}) + endif() + endif() + endif() + endforeach() + endif() +endfunction() |