diff options
-rw-r--r-- | cmake/FindCLN.cmake | 5 | ||||
-rw-r--r-- | cmake/FindCVC4.cmake | 11 | ||||
-rw-r--r-- | cmake/FindGMP.cmake | 7 | ||||
-rw-r--r-- | cmake/FindZ3.cmake | 9 | ||||
-rw-r--r-- | cmake/jsoncpp.cmake | 1 | ||||
-rw-r--r-- | libdevcore/CMakeLists.txt | 2 | ||||
-rw-r--r-- | libsolidity/CMakeLists.txt | 6 |
7 files changed, 31 insertions, 10 deletions
diff --git a/cmake/FindCLN.cmake b/cmake/FindCLN.cmake index f2234bb4..0b574ab9 100644 --- a/cmake/FindCLN.cmake +++ b/cmake/FindCLN.cmake @@ -1,3 +1,8 @@ find_library(CLN_LIBRARY NAMES cln) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(CLN DEFAULT_MSG CLN_LIBRARY) + +if(CLN_FOUND AND NOT TARGET CLN::CLN) + add_library(CLN::CLN UNKNOWN IMPORTED) + set_property(TARGET CLN::CLN PROPERTY IMPORTED_LOCATION ${CLN_LIBRARY}) +endif() diff --git a/cmake/FindCVC4.cmake b/cmake/FindCVC4.cmake index 2649d7c7..887b907b 100644 --- a/cmake/FindCVC4.cmake +++ b/cmake/FindCVC4.cmake @@ -14,12 +14,19 @@ if (USE_CVC4) set(CVC4_LIBRARIES ${CVC4_LIBRARY}) if (CLN_FOUND) - set(CVC4_LIBRARIES ${CVC4_LIBRARIES} ${CLN_LIBRARY}) + set(CVC4_LIBRARIES ${CVC4_LIBRARIES} CLN::CLN) endif () if (GMP_FOUND) - set(CVC4_LIBRARIES ${CVC4_LIBRARIES} ${GMP_LIBRARY}) + set(CVC4_LIBRARIES ${CVC4_LIBRARIES} GMP::GMP) endif () + + if (NOT TARGET CVC4::CVC4) + add_library(CVC4::CVC4 UNKNOWN IMPORTED) + set_property(TARGET CVC4::CVC4 PROPERTY IMPORTED_LOCATION ${CVC4_LIBRARY}) + set_property(TARGET CVC4::CVC4 PROPERTY INTERFACE_LINK_LIBRARIES ${CVC4_LIBRARIES}) + set_property(TARGET CVC4::CVC4 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CVC4_INCLUDE_DIR}) + endif() endif() else() set(CVC4_FOUND FALSE) diff --git a/cmake/FindGMP.cmake b/cmake/FindGMP.cmake index 8abe354c..c3a02654 100644 --- a/cmake/FindGMP.cmake +++ b/cmake/FindGMP.cmake @@ -1,3 +1,8 @@ -find_library(GMP_LIBRARY NAMES gmp ) +find_library(GMP_LIBRARY NAMES gmp) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GMP DEFAULT_MSG GMP_LIBRARY) + +if(GMP_FOUND AND NOT TARGET GMP::GMP) + add_library(GMP::GMP UNKNOWN IMPORTED) + set_property(TARGET GMP::GMP PROPERTY IMPORTED_LOCATION ${GMP_LIBRARY}) +endif() diff --git a/cmake/FindZ3.cmake b/cmake/FindZ3.cmake index c017cac2..ad34cbc3 100644 --- a/cmake/FindZ3.cmake +++ b/cmake/FindZ3.cmake @@ -1,9 +1,14 @@ if (USE_Z3) find_path(Z3_INCLUDE_DIR NAMES z3++.h PATH_SUFFIXES z3) - find_library(Z3_LIBRARY NAMES z3 ) + find_library(Z3_LIBRARY NAMES z3) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Z3 DEFAULT_MSG Z3_LIBRARY Z3_INCLUDE_DIR) + + if (NOT TARGET Z3::Z3) + add_library(Z3::Z3 UNKNOWN IMPORTED) + set_property(TARGET Z3::Z3 PROPERTY IMPORTED_LOCATION ${Z3_LIBRARY}) + set_property(TARGET Z3::Z3 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Z3_INCLUDE_DIR}) + endif() else() set(Z3_FOUND FALSE) endif() -# TODO: Create IMPORTED library for Z3. diff --git a/cmake/jsoncpp.cmake b/cmake/jsoncpp.cmake index 318a526e..4db7b9c3 100644 --- a/cmake/jsoncpp.cmake +++ b/cmake/jsoncpp.cmake @@ -51,5 +51,6 @@ ExternalProject_Add(jsoncpp-project add_library(jsoncpp STATIC IMPORTED) file(MAKE_DIRECTORY ${JSONCPP_INCLUDE_DIR}) # Must exist. set_property(TARGET jsoncpp PROPERTY IMPORTED_LOCATION ${JSONCPP_LIBRARY}) +set_property(TARGET jsoncpp PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${JSONCPP_INCLUDE_DIR}) set_property(TARGET jsoncpp PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${JSONCPP_INCLUDE_DIR}) add_dependencies(jsoncpp jsoncpp-project) diff --git a/libdevcore/CMakeLists.txt b/libdevcore/CMakeLists.txt index 01a8bcc6..e3ebc20b 100644 --- a/libdevcore/CMakeLists.txt +++ b/libdevcore/CMakeLists.txt @@ -12,7 +12,7 @@ set(sources ) add_library(devcore ${sources}) -target_link_libraries(devcore PRIVATE jsoncpp ${Boost_FILESYSTEM_LIBRARIES} ${Boost_REGEX_LIBRARIES} ${Boost_SYSTEM_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries(devcore PUBLIC jsoncpp ${Boost_FILESYSTEM_LIBRARIES} ${Boost_REGEX_LIBRARIES} ${Boost_SYSTEM_LIBRARIES} Threads::Threads) target_include_directories(devcore PUBLIC "${CMAKE_SOURCE_DIR}") target_include_directories(devcore SYSTEM PUBLIC ${Boost_INCLUDE_DIRS}) add_dependencies(devcore solidity_BuildInfo.h) diff --git a/libsolidity/CMakeLists.txt b/libsolidity/CMakeLists.txt index 43d61c86..e67facb3 100644 --- a/libsolidity/CMakeLists.txt +++ b/libsolidity/CMakeLists.txt @@ -50,7 +50,6 @@ set(sources find_package(Z3 QUIET) if (${Z3_FOUND}) - include_directories(${Z3_INCLUDE_DIR}) add_definitions(-DHAVE_Z3) message("Z3 SMT solver found. This enables optional SMT checking with Z3.") set(z3_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/formal/Z3Interface.cpp") @@ -60,7 +59,6 @@ endif() find_package(CVC4 QUIET) if (${CVC4_FOUND}) - include_directories(${CVC4_INCLUDE_DIR}) add_definitions(-DHAVE_CVC4) message("CVC4 SMT solver found. This enables optional SMT checking with CVC4.") set(cvc4_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/formal/CVC4Interface.cpp") @@ -77,9 +75,9 @@ add_library(solidity ${sources} ${z3_SRCS} ${cvc4_SRCS}) target_link_libraries(solidity PUBLIC yul evmasm langutil devcore ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) if (${Z3_FOUND}) - target_link_libraries(solidity PUBLIC ${Z3_LIBRARY}) + target_link_libraries(solidity PUBLIC Z3::Z3) endif() if (${CVC4_FOUND}) - target_link_libraries(solidity PUBLIC ${CVC4_LIBRARIES}) + target_link_libraries(solidity PUBLIC CVC4::CVC4) endif() |