-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
bundle-install.cmake.in
49 lines (43 loc) · 1.15 KB
/
bundle-install.cmake.in
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
cmake_minimum_required(VERSION 3.18)
message("Create bundled lib...")
# Find lib.exe
find_program(lib_tool lib.exe)
# remove @PROJECT_NAME@_full.lib
execute_process(
COMMAND ${CMAKE_COMMAND} -E rm -f ortools_full.lib
#COMMAND ${CMAKE_COMMAND} -E false
COMMAND_ECHO STDOUT
COMMAND_ERROR_IS_FATAL ANY
WORKING_DIRECTORY "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@"
)
set(DEPS absl_*.lib zlib*.lib re2.lib *protobuf*.lib)
if (@BUILD_Cbc@)
set(DEPS ${DEPS} Cbc*.lib)
endif()
if (@BUILD_Cgl@)
set(DEPS ${DEPS} Cgl.lib)
endif()
if (@BUILD_Clp@)
set(DEPS ${DEPS} Clp*.lib)
endif()
if (@BUILD_Osi@)
set(DEPS ${DEPS} Osi*.lib)
endif()
if (@BUILD_CoinUtils@)
set(DEPS ${DEPS} CoinUtils.lib)
endif()
if (@BUILD_SCIP@)
set(DEPS ${DEPS} libscip.lib)
endif()
if (@BUILD_GLPK@)
set(DEPS ${DEPS} libglpk.lib)
endif()
# Bundle all .lib into @PROJECT_NAME@_full.lib
execute_process(
COMMAND ${lib_tool} /NOLOGO /OUT:@PROJECT_NAME@_full.lib @[email protected] ${DEPS}
#COMMAND ${CMAKE_COMMAND} -E false
COMMAND_ECHO STDOUT
COMMAND_ERROR_IS_FATAL ANY
WORKING_DIRECTORY "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@"
)
message("Create bundled lib...DONE")