[CMake] Fix `install()` commands (#8879)
authorAndres Noetzli <andres.noetzli@gmail.com>
Tue, 14 Jun 2022 16:15:25 +0000 (09:15 -0700)
committerGitHub <noreply@github.com>
Tue, 14 Jun 2022 16:15:25 +0000 (09:15 -0700)
This fixes two issues related to `install()` commands:

- It removes the installation of object files from the parser. Before,
  `make install` would add unnecessary object files to the library
  directory.
- It ensures that all artifacts related to the `cvc5` target are
  installed in the library directory. DLL files [count as `RUNTIME`
  artifacts](https://cmake.org/cmake/help/latest/command/install.html),
  so `libcvc5.dll` was not installed in the `lib/` directory with `make
  install`.

src/CMakeLists.txt
src/parser/CMakeLists.txt

index 71c8d7993bcef223947f6372af27cf36f7753b41..1a46f4b74c0d1c593bde67844ac454fa743d151b 100644 (file)
@@ -1334,8 +1334,7 @@ target_include_directories(cvc5
 )
 install(TARGETS cvc5
   EXPORT cvc5-targets
-  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
-  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+  DESTINATION ${CMAKE_INSTALL_LIBDIR}
 )
 
 include(GenerateExportHeader)
index 5a6ff2da03adeaa7b9b42b3ae48b6e8125961e75..4a672b1c1ce7cc8340ccc1d6ebbb163c188c7266 100644 (file)
@@ -120,7 +120,7 @@ set_target_properties(cvc5parser PROPERTIES OUTPUT_NAME cvc5parser)
 target_link_libraries(cvc5parser PRIVATE cvc5)
 target_link_libraries(cvc5parser PRIVATE ANTLR3)
 
-install(TARGETS cvc5parser-objs cvc5parser
+install(TARGETS cvc5parser
   EXPORT cvc5-targets
   DESTINATION ${CMAKE_INSTALL_LIBDIR})