diff --git a/CMakeLists.txt b/CMakeLists.txt index be6dd678..24d22d27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,6 +129,29 @@ if(BUILD_TESTING) add_subdirectory("test") endif() +# The following folder layout is mostly for MSVC +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +set_target_properties(FLAC grabbag getopt replaygain_analysis replaygain_synthesis utf8 PROPERTIES FOLDER Libraries) +if(BUILD_CXXLIBS) + set_target_properties(FLAC++ PROPERTIES FOLDER Libraries) +endif() +if(BUILD_PROGRAMS) + set_target_properties(flacapp metaflac PROPERTIES FOLDER Programs) +endif() +if(BUILD_TESTING) + set_target_properties(test_libFLAC test_libs_common test_picture test_seeking test_streams test_cuesheet PROPERTIES FOLDER Tests) + if(BUILD_CXXLIBS) + set_target_properties(test_libFLAC++ PROPERTIES FOLDER Tests) + endif() +endif() +if(BUILD_EXAMPLES) + set_target_properties(decode_file decode_file_cxx encode_file encode_file_cxx PROPERTIES FOLDER Examples) +endif() +if(BUILD_UTILS) + set_target_properties(flacdiff flactimer PROPERTIES FOLDER Utils) +endif() + configure_file(config.cmake.h.in config.h) if(INSTALL_CMAKE_CONFIG_MODULE) diff --git a/src/flac/CMakeLists.txt b/src/flac/CMakeLists.txt index c227cd87..40034502 100644 --- a/src/flac/CMakeLists.txt +++ b/src/flac/CMakeLists.txt @@ -13,6 +13,7 @@ add_executable(flacapp $<$:../../include/share/win_utf8_io.h> $<$:../share/win_utf8_io/win_utf8_io.c>) set_property(TARGET flacapp PROPERTY RUNTIME_OUTPUT_NAME flac) +set_property(TARGET flacapp PROPERTY PROJECT_LABEL "flac") target_link_libraries(flacapp FLAC getopt diff --git a/src/libFLAC++/CMakeLists.txt b/src/libFLAC++/CMakeLists.txt index ec27835c..91330098 100644 --- a/src/libFLAC++/CMakeLists.txt +++ b/src/libFLAC++/CMakeLists.txt @@ -16,6 +16,7 @@ add_library(FLAC++ metadata.cpp stream_decoder.cpp stream_encoder.cpp) +set_property(TARGET FLAC++ PROPERTY PROJECT_LABEL "libFLAC++") target_compile_definitions(FLAC++ PRIVATE $<$:FLACPP_API_EXPORTS> PUBLIC $<$>:FLAC__NO_DLL>) diff --git a/src/libFLAC/CMakeLists.txt b/src/libFLAC/CMakeLists.txt index 44a3519d..6fffeb42 100644 --- a/src/libFLAC/CMakeLists.txt +++ b/src/libFLAC/CMakeLists.txt @@ -80,6 +80,7 @@ add_library(FLAC $<$:ogg_encoder_aspect.c> $<$:ogg_helper.c> $<$:ogg_mapping.c>) +set_property(TARGET FLAC PROPERTY PROJECT_LABEL "libFLAC") if(TARGET FLAC-asm) target_sources(FLAC PRIVATE $) endif()