File tree 2 files changed +23
-0
lines changed 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ INCLUDE(CheckStructHasMember)
32
32
INCLUDE (AddCFlagIfSupported)
33
33
INCLUDE (FindPkgConfig)
34
34
INCLUDE (FindStatNsec)
35
+ INCLUDE (IdeSplitSources)
35
36
36
37
# Build options
37
38
#
Original file line number Diff line number Diff line change
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 git2_tests 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 ${CMAKE_CURRENT_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 ()
You can’t perform that action at this time.
0 commit comments