Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,19 @@ target_link_libraries(ifc-dom PUBLIC ifc-reader)
target_compile_features(ifc-dom PUBLIC cxx_std_23)
target_include_directories(ifc-dom PUBLIC "\$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>")

# The `ifc` tool executable.
add_executable(
ifc
src/tools/ifc.cxx
)
add_executable(Microsoft.IFC::Tool ALIAS ifc)
set_property(TARGET ifc PROPERTY EXPORT_NAME Tool)
target_compile_features(ifc PUBLIC cxx_std_23)
target_link_libraries(ifc ifc-reader)
target_include_directories(ifc PUBLIC "\$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>")
option(BUILD_TOOLS "Build the ifc tool executable" ON)
if(BUILD_TOOLS)
# The `ifc` tool executable.
add_executable(
ifc
src/tools/ifc.cxx
)
add_executable(Microsoft.IFC::Tool ALIAS ifc)
set_property(TARGET ifc PROPERTY EXPORT_NAME Tool)
target_compile_features(ifc PUBLIC cxx_std_23)
target_link_libraries(ifc ifc-reader)
target_include_directories(ifc PUBLIC "\$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>")
endif()

# The IFC SDK comprises the `reader`, the `dom`, and the tool.
add_library(SDK INTERFACE)
Expand Down
10 changes: 6 additions & 4 deletions cmake/install-rules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ install(
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)

install(
TARGETS ifc
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
)
if(TARGET ifc)
install(
TARGETS ifc
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing endif()?

Copy link
Author

@SunBlack SunBlack Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sorry, the same thing happened to me two days ago with other changes, where I was in C++-CMake syntax mix mode rather than plain CMake syntax mode 😅

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addition: Undecided whether to indent with 2 or 4 tabs; this does not seem to be consistent across the CMake files.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sorry, the same thing happened to me two days ago with other changes, where I was in C++-CMake syntax mix mode rather than plain CMake syntax mode 😅

:-)
I would have expected a local build to catch it.

endif()

install(
TARGETS ifc-dom ifc-reader SDK
Expand Down
Loading