mirror of
https://github.com/libgit2/libgit2.git
synced 2026-01-25 11:06:32 +00:00
Our custom CMake module currently live in "cmake/Modules". As the "cmake/" directory doesn't contain anything except the "Modules" directory, it doesn't really make sense to have the additional intermediate directory. So let's instead move the modules one level up into the "cmake/" top level directory.
23 lines
811 B
CMake
23 lines
811 B
CMake
# 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 ".*/")
|
|
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()
|