File tree Expand file tree Collapse file tree 2 files changed +23
-23
lines changed
Expand file tree Collapse file tree 2 files changed +23
-23
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ INCLUDE(AddCFlagIfSupported)
3232INCLUDE (FindPkgConfig)
3333INCLUDE (FindThreads)
3434INCLUDE (FindStatNsec)
35+ INCLUDE (IdeSplitSources)
3536INCLUDE (FeatureSummary)
3637
3738# Build options
@@ -95,29 +96,6 @@ IF(MSVC)
9596 OPTION (MSVC_CRTDBG "Enable CRTDBG memory leak reporting" OFF )
9697ENDIF ()
9798
98- # This function splits the sources files up into their appropriate
99- # subdirectories. This is especially useful for IDEs like Xcode and
100- # Visual Studio, so that you can navigate into the libgit2_clar project,
101- # and see the folders within the tests folder (instead of just seeing all
102- # source and tests in a single folder.)
103- FUNCTION (IDE_SPLIT_SOURCES target )
104- IF (MSVC_IDE OR CMAKE_GENERATOR STREQUAL Xcode)
105- GET_TARGET_PROPERTY (sources ${target} SOURCES )
106- FOREACH (source ${sources} )
107- IF (source MATCHES ".*/" )
108- STRING (REPLACE ${libgit2_SOURCE_DIR} / "" rel ${source} )
109- IF (rel)
110- STRING (REGEX REPLACE "/([^/]*)$" "" rel ${rel} )
111- IF (rel)
112- STRING (REPLACE "/" "\\\\ " rel ${rel} )
113- SOURCE_GROUP (${rel} FILES ${source} )
114- ENDIF ()
115- ENDIF ()
116- ENDIF ()
117- ENDFOREACH ()
118- ENDIF ()
119- ENDFUNCTION ()
120-
12199FILE (STRINGS "${libgit2_SOURCE_DIR} /include/git2/version.h" GIT2_HEADER REGEX "^#define LIBGIT2_VERSION \" [^\" ]*\" $" )
122100
123101STRING (REGEX REPLACE "^.*LIBGIT2_VERSION \" ([0-9]+).*$" "\\ 1" LIBGIT2_VERSION_MAJOR "${GIT2_HEADER} " )
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 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 ()
You can’t perform that action at this time.
0 commit comments