From 16b6bbb21cb565212a2130c4fa5f21a421bb82af Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Thu, 17 Apr 2025 16:43:00 -0700 Subject: [PATCH] Put generated StaConfig.hh into build artifacts. (#230) Before, the cmake configure_file() for the StaConfig.hh header, that make only sense for the particular cmake configuration as it contains specific defines for that build configuration, ended up in the original source tree. With this fix, it is a build artifact inside build/. Tested, that the final `make install` properly copies the StaConfig.hh to the correct location. Signed-off-by: Henner Zeller --- .gitignore | 2 -- CMakeLists.txt | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 01ec0da2..c57d983a 100644 --- a/.gitignore +++ b/.gitignore @@ -15,8 +15,6 @@ cmake-build-debug build pvt -include/sta/StaConfig.hh - app/sta app/libOpenSTA.* app/sta.exe diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f28b74e..ed9615bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -389,7 +389,7 @@ message(STATUS "SSTA: ${SSTA}") # configure a header file to pass some of the CMake settings configure_file(${STA_HOME}/util/StaConfig.hh.cmake - ${STA_HOME}/include/sta/StaConfig.hh + ${CMAKE_CURRENT_BINARY_DIR}/include/sta/StaConfig.hh ) ########################################################### @@ -464,6 +464,7 @@ target_include_directories(sta_swig PRIVATE ${STA_HOME} ${TCL_INCLUDE_PATH} + ${CMAKE_CURRENT_BINARY_DIR}/include/sta ) ########################################################### @@ -515,6 +516,7 @@ target_include_directories(OpenSTA include ${TCL_INCLUDE_PATH} ${FLEX_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR}/include/sta PRIVATE include/sta @@ -582,6 +584,7 @@ install(TARGETS OpenSTA DESTINATION lib) # include install(DIRECTORY include/sta DESTINATION include) +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/sta DESTINATION include) ################################################################ @@ -589,6 +592,7 @@ add_custom_target(sta_tags etags -o TAGS ${STA_SOURCE} */*.hh include/sta/*.hh + ${CMAKE_CURRENT_BINARY_DIR}/include/sta/*.hh ${SWIG_FILES} ${STA_TCL_FILES} ${SWIG_TCL_FILES}