@@ -336,6 +336,7 @@ add_custom_command(OUTPUT ${STA_TCL_INIT}
336336# Do not use REQUIRED because it also requires TK, which is not used by OpenSTA.
337337find_package (TCL)
338338
339+ # Referenced by util/StaConfig.hh.cmake
339340set (TCL_READLINE 0)
340341# check for tclReadline
341342if (USE_TCL_READLINE)
@@ -352,13 +353,19 @@ if (USE_TCL_READLINE)
352353 )
353354 if (TCL_READLINE_LIBRARY)
354355 message (STATUS "TCL readline library: ${TCL_READLINE_LIBRARY} " )
355- # Referenced by StaConfig.hh.cmake
356- set (TCL_READLINE 1 )
356+ else ()
357+ message ( STATUS "TCL readline library: NOT FOUND" )
357358 endif ()
358359
359360 find_path (TCL_READLINE_INCLUDE tclreadline.h)
360361 if (TCL_READLINE_INCLUDE)
361362 message (STATUS "TCL readline header: ${TCL_READLINE_INCLUDE} /tclreadline.h" )
363+ else ()
364+ message (STATUS "TCL readline header: NOT FOUND" )
365+ endif ()
366+
367+ if (TCL_READLINE_LIBRARY AND TCL_READLINE_INCLUDE)
368+ set (TCL_READLINE 1)
362369 endif ()
363370endif ()
364371
@@ -515,28 +522,28 @@ target_link_libraries(OpenSTA
515522 ${CUDD_LIB}
516523 )
517524
518- if (TCL_READLINE_LIBRARY)
519- target_link_libraries (OpenSTA ${TCL_READLINE_LIBRARY} )
520- endif ()
521-
522525if (ZLIB_LIBRARIES)
523526 target_link_libraries (OpenSTA ${ZLIB_LIBRARIES} )
524527endif ()
525528
526- target_link_libraries (OpenSTA )
527-
528529target_include_directories (OpenSTA
529530 PUBLIC
530531 include
531532 ${TCL_INCLUDE_PATH}
532- ${TCL_READLINE_INCLUDE}
533533
534534 PRIVATE
535535 include /sta
536536 ${STA_HOME}
537537 ${CUDD_INCLUDE}
538538 )
539539
540+ if (TCL_READLINE)
541+ target_link_libraries (OpenSTA ${TCL_READLINE_LIBRARY} )
542+ target_include_directories (OpenSTA
543+ PUBLIC
544+ ${TCL_READLINE_INCLUDE} )
545+ endif ()
546+
540547# common to gcc/clang
541548set (CXX_FLAGS -Wall -Wextra -pedantic -Wcast-qual -Wredundant-decls -Wformat-security)
542549
0 commit comments