forked from osmandapp/OsmAnd-resources
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
58 lines (52 loc) · 2.15 KB
/
CMakeLists.txt
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
project(OsmAndCore_ResourcesBundle)
set(OsmAndCore_ResourcesBundle_src
"${CMAKE_CURRENT_BINARY_DIR}/gen/EmbeddedResourcesBundle.cpp"
)
if (CMAKE_HOST_WIN32 AND NOT CYGWIN)
add_custom_target(OsmAndCore_ResourcesBundle_VerifyPackagingList
bash
--login "${CMAKE_CURRENT_LIST_DIR}/verify-embed-resources-list.sh"
"${CMAKE_CURRENT_BINARY_DIR}"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "Verifying packaging list...")
add_custom_command(OUTPUT ${OsmAndCore_ResourcesBundle_src}
COMMAND bash ARGS --login "${CMAKE_CURRENT_LIST_DIR}/embed-resources.sh" "${CMAKE_CURRENT_BINARY_DIR}"
DEPENDS
"${CMAKE_CURRENT_LIST_DIR}/embed-resources.list"
"${CMAKE_CURRENT_LIST_DIR}/embed-resources.sh"
"${CMAKE_CURRENT_LIST_DIR}/embed-resources.py"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "Embedding resources...")
else()
add_custom_target(OsmAndCore_ResourcesBundle_VerifyPackagingList
"${CMAKE_CURRENT_LIST_DIR}/verify-embed-resources-list.sh"
"${CMAKE_CURRENT_BINARY_DIR}"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "Verifying packaging list...")
add_custom_command(OUTPUT ${OsmAndCore_ResourcesBundle_src}
COMMAND "${CMAKE_CURRENT_LIST_DIR}/embed-resources.sh" "${CMAKE_CURRENT_BINARY_DIR}"
DEPENDS
"${CMAKE_CURRENT_LIST_DIR}/embed-resources.list"
"${CMAKE_CURRENT_LIST_DIR}/embed-resources.sh"
"${CMAKE_CURRENT_LIST_DIR}/embed-resources.py"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "Embedding resources...")
endif()
if (CMAKE_SHARED_LIBS_ALLOWED_ON_TARGET)
add_library(OsmAndCore_ResourcesBundle_shared SHARED
${OsmAndCore_ResourcesBundle_src})
add_dependencies(OsmAndCore_ResourcesBundle_shared
OsmAndCore_ResourcesBundle_VerifyPackagingList)
endif()
if (CMAKE_STATIC_LIBS_ALLOWED_ON_TARGET)
add_library(OsmAndCore_ResourcesBundle_static STATIC
${OsmAndCore_ResourcesBundle_src})
add_dependencies(OsmAndCore_ResourcesBundle_static
OsmAndCore_ResourcesBundle_VerifyPackagingList)
if (CMAKE_COMPILER_FAMILY STREQUAL "msvc")
target_link_libraries(OsmAndCore_ResourcesBundle_static
LINK_PUBLIC
"-INCLUDE:___CoreResourcesEmbeddedBundle__FakeReferences"
)
endif()
endif()