Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
979a5c12
Commit
979a5c12
authored
Oct 23, 2015
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3483 from ethomson/cmake_xcode
cmake: split sources into original paths for Xcode and MSVC
parents
e324005e
7208ff4d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
CMakeLists.txt
+9
-9
No files found.
CMakeLists.txt
View file @
979a5c12
...
...
@@ -137,13 +137,13 @@ FUNCTION(TARGET_OS_LIBRARIES target)
ENDIF
()
ENDFUNCTION
()
#
For the MSVC IDE, this function splits up the source files like windows
#
explorer does. This is esp. useful with the libgit2_clar project, were
#
usually 2 or more files share the same name. Sadly, this file grouping
#
is a per-directory option in cmake and not per-target, resulting in
#
empty virtual folders "tests" for the git2.dll
FUNCTION
(
MSVC
_SPLIT_SOURCES target
)
IF
(
MSVC_IDE
)
#
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,
#
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
".*/"
)
...
...
@@ -560,7 +560,7 @@ IF(MSVC AND GIT_ARCH_64 AND NOT BUILD_SHARED_LIBS)
SET_TARGET_PROPERTIES
(
git2 PROPERTIES STATIC_LIBRARY_FLAGS
"/MACHINE:x64"
)
ENDIF
()
MSVC
_SPLIT_SOURCES
(
git2
)
IDE
_SPLIT_SOURCES
(
git2
)
IF
(
SONAME
)
SET_TARGET_PROPERTIES
(
git2 PROPERTIES VERSION
${
LIBGIT2_VERSION_STRING
}
)
...
...
@@ -629,7 +629,7 @@ IF (BUILD_CLAR)
TARGET_LINK_LIBRARIES(libgit2_clar
${
GSSAPI_LIBRARIES
}
)
TARGET_LINK_LIBRARIES(libgit2_clar
${
ICONV_LIBRARIES
}
)
TARGET_OS_LIBRARIES(libgit2_clar)
MSVC
_SPLIT_SOURCES(libgit2_clar)
IDE
_SPLIT_SOURCES(libgit2_clar)
IF (MSVC_IDE)
# Precompiled headers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment