add_subdirectory(src/bindings)
endif()
+#-----------------------------------------------------------------------------#
+# Package configuration
+#
+# Export CVC4 targets to support find_package(CVC4) in other cmake projects.
+
+include(CMakePackageConfigHelpers)
+
+install(EXPORT cvc4-targets
+ FILE CVC4Targets.cmake
+ NAMESPACE CVC4::
+ DESTINATION lib/cmake/CVC4)
+
+configure_package_config_file(
+ ${CMAKE_SOURCE_DIR}/cmake/CVC4Config.cmake.in
+ ${CMAKE_BINARY_DIR}/cmake/CVC4Config.cmake
+ INSTALL_DESTINATION lib/cmake/CVC4
+)
+
+write_basic_package_version_file(
+ ${CMAKE_CURRENT_BINARY_DIR}/CVC4ConfigVersion.cmake
+ VERSION ${CVC4_RELEASE_STRING}
+ COMPATIBILITY SameMinorVersion
+)
+
+install(FILES
+ ${CMAKE_BINARY_DIR}/cmake/CVC4Config.cmake
+ ${CMAKE_BINARY_DIR}/CVC4ConfigVersion.cmake
+ DESTINATION lib/cmake/CVC4
+)
+
+
#-----------------------------------------------------------------------------#
# Print build configuration
set_source_files_properties(${LIBCVC4_GEN_SRCS} PROPERTIES GENERATED TRUE)
add_library(cvc4 ${LIBCVC4_SRCS} ${LIBCVC4_GEN_SRCS})
-install(TARGETS cvc4 DESTINATION lib)
+target_include_directories(cvc4
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<INSTALL_INTERFACE:include>
+)
+
+install(TARGETS cvc4
+ EXPORT cvc4-targets
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
set_target_properties(cvc4 PROPERTIES SOVERSION ${CVC4_SOVERSION})
target_compile_definitions(cvc4
# Add library/include dependencies
if(ENABLE_VALGRIND)
- target_include_directories(cvc4 PUBLIC ${Valgrind_INCLUDE_DIR})
+ target_include_directories(cvc4 PRIVATE ${Valgrind_INCLUDE_DIR})
endif()
if(USE_ABC)
target_link_libraries(cvc4 ${ABC_LIBRARIES})
- target_include_directories(cvc4 PUBLIC ${ABC_INCLUDE_DIR})
+ target_include_directories(cvc4 PRIVATE ${ABC_INCLUDE_DIR})
endif()
if(USE_CADICAL)
target_link_libraries(cvc4 ${CaDiCaL_LIBRARIES})
- target_include_directories(cvc4 PUBLIC ${CaDiCaL_INCLUDE_DIR})
+ target_include_directories(cvc4 PRIVATE ${CaDiCaL_INCLUDE_DIR})
endif()
if(USE_CLN)
target_link_libraries(cvc4 ${CLN_LIBRARIES})
- target_include_directories(cvc4 PUBLIC ${CLN_INCLUDE_DIR})
+ target_include_directories(cvc4 PUBLIC $<BUILD_INTERFACE:${CLN_INCLUDE_DIR}>)
endif()
if(USE_CRYPTOMINISAT)
target_link_libraries(cvc4 ${CryptoMiniSat_LIBRARIES})
- target_include_directories(cvc4 PUBLIC ${CryptoMiniSat_INCLUDE_DIR})
+ target_include_directories(cvc4 PRIVATE ${CryptoMiniSat_INCLUDE_DIR})
endif()
if(USE_DRAT2ER)
target_link_libraries(cvc4 ${Drat2Er_LIBRARIES})
- target_include_directories(cvc4 PUBLIC ${Drat2Er_INCLUDE_DIR})
+ target_include_directories(cvc4 PRIVATE ${Drat2Er_INCLUDE_DIR})
endif()
if(USE_GLPK)
target_link_libraries(cvc4 ${GLPK_LIBRARIES})
- target_include_directories(cvc4 PUBLIC ${GLPK_INCLUDE_DIR})
+ target_include_directories(cvc4 PRIVATE ${GLPK_INCLUDE_DIR})
endif()
if(USE_LFSC)
target_link_libraries(cvc4 ${LFSC_LIBRARIES})
- target_include_directories(cvc4 PUBLIC ${LFSC_INCLUDE_DIR})
+ target_include_directories(cvc4 PRIVATE ${LFSC_INCLUDE_DIR})
endif()
if(USE_SYMFPU)
- target_include_directories(cvc4 PUBLIC ${SymFPU_INCLUDE_DIR})
+ target_include_directories(cvc4
+ PUBLIC $<BUILD_INTERFACE:${SymFPU_INCLUDE_DIR}>)
endif()
# Note: When linked statically GMP needs to be linked after CLN since CLN
# depends on GMP.
target_link_libraries(cvc4 ${GMP_LIBRARIES})
-target_include_directories(cvc4 PUBLIC ${GMP_INCLUDE_DIR})
+target_include_directories(cvc4 PUBLIC $<BUILD_INTERFACE:${GMP_INCLUDE_DIR}>)
# Add rt library
# Note: For glibc < 2.17 we have to additionally link against rt (man clock_gettime).