Skip to content

Commit 754dc62

Browse files
committed
tclreadline cmake
Signed-off-by: James Cherry <[email protected]>
1 parent 81c6837 commit 754dc62

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

CMakeLists.txt

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
337337
find_package(TCL)
338338

339+
# Referenced by util/StaConfig.hh.cmake
339340
set(TCL_READLINE 0)
340341
# check for tclReadline
341342
if (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()
363370
endif()
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-
522525
if (ZLIB_LIBRARIES)
523526
target_link_libraries(OpenSTA ${ZLIB_LIBRARIES})
524527
endif()
525528

526-
target_link_libraries(OpenSTA )
527-
528529
target_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
541548
set(CXX_FLAGS -Wall -Wextra -pedantic -Wcast-qual -Wredundant-decls -Wformat-security)
542549

0 commit comments

Comments
 (0)