diff --git a/CMakeFiles/Docs.cmake b/CMakeFiles/Docs.cmake index 4ae5ddad2..51aebbea4 100644 --- a/CMakeFiles/Docs.cmake +++ b/CMakeFiles/Docs.cmake @@ -99,3 +99,7 @@ ADD_CUSTOM_COMMAND(OUTPUT share/man/ DEPENDS ${FBVF} ${HELP_SRC} ${CMAKE_CURRENT_BINARY_DIR}/lexicon_filter) ADD_CUSTOM_TARGET(BUILD_MANUALS ALL DEPENDS share/man/) + +# Group docs targets into a DocsTargets folder +SET_PROPERTY(TARGET doc BUILD_MANUALS + PROPERTY FOLDER cmake/DocTargets) diff --git a/CMakeFiles/Install.cmake b/CMakeFiles/Install.cmake index 5b7b1f5af..0d7180095 100644 --- a/CMakeFiles/Install.cmake +++ b/CMakeFiles/Install.cmake @@ -175,7 +175,12 @@ INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/share/man/ # done; INSTALL(FILES ${MANUALS} DESTINATION ${mandir}/man1/) - - # $v $(INSTALL) -m 644 share/lynx.lss $(DESTDIR)$(datadir)/fish/ INSTALL(FILES share/lynx.lss DESTINATION ${rel_datadir}/fish/) + +# Group install targets into a InstallTargets folder +SET_PROPERTY(TARGET CHECK-FISH-BUILD-VERSION-FILE build_fish_pc + test_invocation test_fishscript + test_prep tests_buildroot_target + build_lexicon_filter + PROPERTY FOLDER cmake/InstallTargets) diff --git a/CMakeFiles/Tests.cmake b/CMakeFiles/Tests.cmake index e565b270b..9a13a6758 100644 --- a/CMakeFiles/Tests.cmake +++ b/CMakeFiles/Tests.cmake @@ -102,3 +102,10 @@ ADD_CUSTOM_TARGET(test_fishscript ADD_CUSTOM_TARGET(test_high_level DEPENDS test_invocation test_fishscript) ADD_DEPENDENCIES(test test_high_level) + +# Group test targets into a TestTargets folder +SET_PROPERTY(TARGET test test_low_level test_high_level tests_dir + test_invocation test_fishscript test_prep + tests_buildroot_target build_lexicon_filter + symlink_functions + PROPERTY FOLDER cmake/TestTargets) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b54ec043..cc9ab5113 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,17 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.1) # We are C++11. SET(CMAKE_CXX_STANDARD 11) +# Hide the CMake Rules directories in Xcode projects. +SOURCE_GROUP("CMake Rules" REGULAR_EXPRESSION "^$") + +# Put source and header files at top level under targets. +SOURCE_GROUP("Source Files" REGULAR_EXPRESSION "^$") +SOURCE_GROUP("Header Files" REGULAR_EXPRESSION "^$") +SOURCE_GROUP("Builtins" REGULAR_EXPRESSION "builtin_.*") + +# Support folders. +SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON) + # All objects that the system needs to build fish, except fish.cpp SET(FISH_SRCS src/autoload.cpp src/builtin.cpp src/builtin_bg.cpp src/builtin_bind.cpp @@ -30,6 +41,9 @@ SET(FISH_SRCS src/wgetopt.cpp src/wildcard.cpp src/wutil.cpp ) +# Header files are just globbed. +FILE(GLOB FISH_HEADERS src/*.h) + # Set up the version target. # This creates the file FISH-BUILD-VERSION-FILE which is only modified if necessary. ADD_CUSTOM_COMMAND(OUTPUT "FISH-BUILD-VERSION-FILE" @@ -74,6 +88,7 @@ ENDFUNCTION(FISH_LINK_DEPS) # Define libfish.a. ADD_LIBRARY(fishlib STATIC ${FISH_SRCS}) +TARGET_SOURCES(fishlib PRIVATE ${FISH_HEADERS}) TARGET_LINK_LIBRARIES(fishlib ${CURSES_LIBRARIES} Threads::Threads ${PCRE2_LIB} muparser)