Skip to content

Commit 9285a05

Browse files
committed
adjust install targets
1 parent a0a67d0 commit 9285a05

5 files changed

Lines changed: 27 additions & 10 deletions

File tree

CMakeLists.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,26 +231,28 @@ if (PHASAR_BUILD_IR)
231231
add_subdirectory(test)
232232
endif()
233233

234-
# Install Phasar executable and libraries
235-
# install(TARGETS phasar-llvm
236-
# RUNTIME DESTINATION bin
237-
# LIBRARY DESTINATION lib
238-
# ARCHIVE DESTINATION lib
239-
# )
234+
# Install targets of phasar-llvm, other executables, and libraries are to be
235+
# found in the individual subdirectories of tools/
236+
240237
# Install Phasar include directory
241238
install(DIRECTORY include/
242239
DESTINATION include
243-
FILES_MATCHING PATTERN "*.h"
240+
FILES_MATCHING
241+
PATTERN "*.def"
242+
PATTERN "*.h"
244243
)
244+
245245
# Install the header only json container
246246
install(DIRECTORY external/json/single_include/nlohmann/
247247
DESTINATION include
248248
FILES_MATCHING PATTERN "*.hpp"
249249
)
250+
250251
# Install the gtest header files (TODO this installation dependency should be eliminated)
251252
install(DIRECTORY external/googletest/googletest/include/gtest/
252253
DESTINATION include/gtest
253254
)
255+
254256
# Install Phasar utils helper scripts
255257
install(DIRECTORY utils/
256258
DESTINATION bin
@@ -259,6 +261,7 @@ install(DIRECTORY utils/
259261
GROUP_EXECUTE GROUP_READ
260262
WORLD_EXECUTE WORLD_READ
261263
)
264+
262265
# Install the Phasar config files into ~/.config/phasar/
263266
install(DIRECTORY config/
264267
DESTINATION $ENV{HOME}/.config/phasar

tools/example-tool/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ target_link_libraries(myphasartool
3838
${CMAKE_THREAD_LIBS_INIT}
3939
${CLANG_LIBRARIES}
4040
${llvm_libs}
41-
gtest
4241
)
4342

4443
if(NOT PHASAR_IN_TREE)
@@ -50,3 +49,9 @@ endif()
5049

5150
set(LLVM_LINK_COMPONENTS
5251
)
52+
53+
install(TARGETS myphasartool
54+
RUNTIME DESTINATION bin
55+
LIBRARY DESTINATION lib
56+
ARCHIVE DESTINATION lib
57+
)

tools/example-tool/myphasartool.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ int main(int argc, const char **argv) {
3232
auto &lg = lg::get();
3333
if (argc < 2 || !boost::filesystem::exists(argv[1]) ||
3434
boost::filesystem::is_directory(argv[1])) {
35-
std::cerr << "usage: <prog> <ir file>\n";
35+
std::cerr << "myphasartool\n"
36+
"A small PhASAR-based example program\n\n"
37+
"Usage: myphasartool <LLVM IR file>\n";
3638
return 1;
3739
}
3840
initializeLogger(false);

tools/phasar-llvm/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,9 @@ endif()
5252

5353
set(LLVM_LINK_COMPONENTS
5454
)
55+
56+
install(TARGETS phasar-llvm
57+
RUNTIME DESTINATION bin
58+
LIBRARY DESTINATION lib
59+
ARCHIVE DESTINATION lib
60+
)

tools/phasar-llvm/phasar-llvm.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ int main(int argc, const char **argv) {
238238
Strategy = AnalysisStrategy::WholeProgram;
239239
}
240240
if (!PhasarConfig::VariablesMap().count("module")) {
241-
std::cout << "At least on LLVM target module is required!\n";
241+
std::cout << "At least on LLVM target module is required!\n"
242+
"Specify a LLVM target module or re-run with '--help'\n";
242243
return 0;
243244
}
244245
ProjectIRDB IRDB(

0 commit comments

Comments
 (0)