File: CMakeLists.txt

package info (click to toggle)
cmake 4.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 152,336 kB
  • sloc: ansic: 403,896; cpp: 303,920; sh: 4,105; python: 3,583; yacc: 3,106; lex: 1,279; f90: 538; asm: 471; lisp: 375; cs: 270; java: 266; fortran: 239; objc: 215; perl: 213; xml: 198; makefile: 111; javascript: 83; pascal: 63; tcl: 55; php: 25; ruby: 22
file content (74 lines) | stat: -rw-r--r-- 1,932 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
set(CMAKE_SKIP_RPATH OFF)

# Import targets from the install tree.
include(${Import_BINARY_DIR}/../Root/install-RUNTIME_DEPENDENCY_SET/targets.cmake)

add_executable(exe1 main.c)
add_executable(exe2 main.c)

if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
  set_target_properties(exe1 exe2 PROPERTIES
    # Multiple MACOSX_BUNDLE executables are allowed on non-macOS platforms.
    MACOSX_BUNDLE TRUE
    )
endif()

add_library(sublib1 SHARED sublib1.c)
target_link_libraries(sublib1 PRIVATE dep6)

add_library(sublib2 SHARED sublib2.c)
target_link_libraries(sublib2 PRIVATE dep7)

foreach(i exe1 exe2)
  target_link_libraries(${i} PRIVATE
    dep1
    dep2
    dep3
    dep4
    dep5
    dep10
    dep11
    dep12
    sublib1
    sublib2
    )
endforeach()

add_library(lib SHARED lib.c)
target_link_libraries(lib PRIVATE dep8)

add_library(mod MODULE mod.c)
target_link_libraries(mod PRIVATE dep9)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
  set_target_properties(mod PROPERTIES
    SKIP_BUILD_RPATH TRUE
    )
endif()

set(_framework_args)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
  set(_framework_args FRAMEWORK DESTINATION subdir/frameworks)
endif()
install(TARGETS exe1 exe2 lib mod sublib1
  RUNTIME_DEPENDENCIES
    PRE_INCLUDE_REGEXES "$<1:dep([2-9]|1[012])>"
    PRE_EXCLUDE_REGEXES "$<1:.*>"
    POST_INCLUDE_REGEXES "$<1:(bin|lib)/(lib)?dep3>"
    POST_EXCLUDE_REGEXES "$<1:(bin|lib)/(lib)?dep[34]>"
    POST_INCLUDE_FILES "$<TARGET_FILE:dep10>" "$<TARGET_FILE:dep11>"
    POST_EXCLUDE_FILES "$<TARGET_FILE:dep11>" "$<TARGET_FILE:dep12>"
    DIRECTORIES "$<TARGET_FILE_DIR:dep9>"
  RUNTIME DESTINATION "$<1:subdir/bin>"
  LIBRARY DESTINATION "$<1:subdir/lib>"
  ${_framework_args}
  )

install(TARGETS lib
  RUNTIME_DEPENDENCIES
    PRE_INCLUDE_REGEXES dep8
    PRE_EXCLUDE_REGEXES ".*"
    DIRECTORIES "$<TARGET_FILE_DIR:dep8>"
  ${_framework_args}
  )

install(SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/check_installed.cmake")