From 0a3dcbd476672f2bc73d7153423cc785d4415505 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Sat, 4 Apr 2020 16:12:41 -0700 Subject: [PATCH] more cmake --- CMakeLists.txt | 13 +++++-------- util/StaConfig.hh.cmake | 2 +- util/Zlib.hh | 6 +++--- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 14ce2eb8..6c36b631 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -551,12 +551,6 @@ find_package(TCL) # Zlib include(FindZLIB) -# Translate cmake bool to StaConfig.h ifdef bool -if (ZLIB_FOUND) - set(ZLIB 1) -else() - set(ZLIB 0) -endif() ################################################################ # @@ -675,10 +669,13 @@ target_link_libraries(sta OpenSTA sta_swig ${TCL_LIBRARY} - ZLIB - CUDD_LIB + ${ZLIB_LIBRARIES} ) +if (CUDD_LIB) +target_link_libraries(sta ${CUDD_LIB}) +endif() + message(STATUS "STA executable: ${STA_HOME}/app/sta") # g++ std::thread apparently still needs -pthreads. diff --git a/util/StaConfig.hh.cmake b/util/StaConfig.hh.cmake index 395df2a2..dc4ae102 100644 --- a/util/StaConfig.hh.cmake +++ b/util/StaConfig.hh.cmake @@ -2,7 +2,7 @@ #define STA_GIT_SHA1 "${STA_GIT_SHA1}" -#define ZLIB ${ZLIB} +#cmakedefine ZLIB_FOUND #define CUDD ${CUDD} diff --git a/util/Zlib.hh b/util/Zlib.hh index 37aac991..30dcba0b 100644 --- a/util/Zlib.hh +++ b/util/Zlib.hh @@ -21,11 +21,11 @@ #include "StaConfig.hh" // ZLIB -#if ZLIB +#ifdef ZLIB_FOUND #include -#else // ZLIB +#else // ZLIB_FOUND #include @@ -36,4 +36,4 @@ #define gzprintf fprintf #define Z_NULL nullptr -#endif // ZLIB +#endif // ZLIB_FOUND