Skip to content

CMakeFile generates StaConfig.hh in source tree instead of build tree #264

@hzeller

Description

@hzeller

The CMake file in sta generates its config in STA_HOME instead of CMAKE_CURRENT_BINARY_DIR.

Because of that, if cmake is run and then bazel is run, the compiler finds the wrong StaConfig.hh and complains about tclreadline not found (because that is not compiled into the bazel build yet). The bazel build generates its own version, but because the cmake configure creates that in the wrong place, it will mess up things.

So what I believe should be done is:

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -392,7 +392,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
   )
 
 ###########################################################

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions