From 7fdd4abe3b4784a890d44f4c4636681eeeb19d8e Mon Sep 17 00:00:00 2001 From: David Hunter Date: Tue, 23 Sep 2025 21:17:49 -0600 Subject: [PATCH 1/2] This adds various file to the project. This is mostly so that graphical IDEs like Visual studio can actually see and edit various files like the headers in the include directory. One addition uses the new VS_SOLUTION_ITEMS property in cmake. This adds files to the "solution" file of the generated Visual Studio solution. This is not guarded because setting this stuff has no effect on any other cmake generators. --- CMakeLists.txt | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e05f888..bce27c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,12 @@ if(WIN32) add_compile_definitions(NOMINMAX) endif() +# By default we don't want the Visual Studio default "sources" and "headers" folders, the following put's everything directly in the project +if (MSVC) + source_group( " " REGULAR_EXPRESSION .*) +endif() + + # The `reader` component. add_library( ifc-reader STATIC @@ -58,6 +64,7 @@ add_library( src/ifc-dom/stmts.cxx src/ifc-dom/syntax.cxx src/ifc-dom/types.cxx + src/ifc-dom/common.hxx ) add_library(Microsoft.IFC::DOM ALIAS ifc-dom) set_property(TARGET ifc-dom PROPERTY EXPORT_NAME DOM) @@ -87,6 +94,7 @@ if(BUILD_PRINTER) ifc-printer src/ifc-printer/main.cxx src/ifc-printer/printer.cxx + src/ifc-printer/printer.hxx src/assert.cxx ) target_link_libraries(ifc-printer PRIVATE ifc-dom ifc-reader) @@ -105,3 +113,32 @@ include(CTest) if(BUILD_TESTING) add_subdirectory(test) endif() + +# Add include headers +add_custom_target(ifc-include SOURCES + include/ifc/abstract-sgraph.hxx + include/ifc/assertions.hxx + include/ifc/basic-types.hxx + include/ifc/file.hxx + include/ifc/index-utils.hxx + include/ifc/operators.hxx + include/ifc/pathname.hxx + include/ifc/pp-forms.hxx + include/ifc/reader.hxx + include/ifc/source-word.hxx + include/ifc/tooling.hxx + include/ifc/underlying.hxx + include/ifc/util.hxx + include/ifc/version.hxx + include/ifc/dom/node.hxx +) + +set( SolutionItems + .clang-format + .gitignore + CMakePresets.json + LICENSE.txt + README.md + vcpkg.json) +set_property(DIRECTORY APPEND PROPERTY VS_SOLUTION_ITEMS ${SolutionItems}) +source_group("Solution Items" FILES ${SolutionItems}) From 784895ab9f390e259a4b8f3a7aa7927bcd5446da Mon Sep 17 00:00:00 2001 From: David Hunter Date: Wed, 24 Sep 2025 08:21:20 -0600 Subject: [PATCH 2/2] Use a guard more specific to Visual Studio --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bce27c1..a8711ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ if(WIN32) endif() # By default we don't want the Visual Studio default "sources" and "headers" folders, the following put's everything directly in the project -if (MSVC) +if (${CMAKE_GENERATOR} MATCHES "^Visual Studio") source_group( " " REGULAR_EXPRESSION .*) endif()