summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CPack/DEPENDENCIES.cmake
blob: 0aef92569f8bacd37446a9b0456c9e31ab916323 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp"
    "int test_lib();")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp"
    "#include \"test_lib.hpp\"\nint test_lib() {return 0;}")
add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp")

file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
    "#include \"test_lib.hpp\"\nint main() {return test_lib();}")
add_executable(test_prog "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
target_link_libraries(test_prog test_lib)

install(TARGETS test_prog DESTINATION foo COMPONENT applications)
install(TARGETS test_prog DESTINATION foo_auto COMPONENT applications_auto)
install(FILES CMakeLists.txt DESTINATION bar COMPONENT headers)
install(TARGETS test_lib DESTINATION bas COMPONENT libs)
install(TARGETS test_lib DESTINATION bas_auto COMPONENT libs_auto)

set(CPACK_PACKAGE_NAME "dependencies")