File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ SET(GFLAGS_SOURCES_DIR ${THIRD_PARTY_PATH}/gflags)
18
18
SET (GFLAGS_INSTALL_DIR ${THIRD_PARTY_PATH} /install/gflags )
19
19
SET (GFLAGS_INCLUDE_DIR "${GFLAGS_INSTALL_DIR} /include" CACHE PATH "gflags include directory." FORCE )
20
20
IF (WIN32 )
21
- set (GFLAGS_LIBRARIES "${GFLAGS_INSTALL_DIR} /lib/gflags .lib" CACHE FILEPATH "GFLAGS_LIBRARIES" FORCE )
21
+ set (GFLAGS_LIBRARIES "${GFLAGS_INSTALL_DIR} /lib/libgflags .lib" CACHE FILEPATH "GFLAGS_LIBRARIES" FORCE )
22
22
ELSE (WIN32 )
23
23
set (GFLAGS_LIBRARIES "${GFLAGS_INSTALL_DIR} /lib/libgflags.a" CACHE FILEPATH "GFLAGS_LIBRARIES" FORCE )
24
24
ENDIF (WIN32 )
@@ -45,7 +45,13 @@ ExternalProject_Add(
45
45
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
46
46
-DCMAKE_BUILD_TYPE:STRING=${THIRD_PARTY_BUILD_TYPE}
47
47
)
48
-
48
+ IF (WIN32 )
49
+ IF (NOT EXISTS "${GFLAGS_INSTALL_DIR} /lib/libgflags.lib" )
50
+ add_custom_command (TARGET extern_gflags POST_BUILD
51
+ COMMAND cmake -E rename ${GFLAGS_INSTALL_DIR} /lib/gflags_static.lib ${GFLAGS_INSTALL_DIR} /lib/libgflags.lib
52
+ )
53
+ ENDIF ()
54
+ ENDIF (WIN32 )
49
55
ADD_LIBRARY (gflags STATIC IMPORTED GLOBAL )
50
56
SET_PROPERTY (TARGET gflags PROPERTY IMPORTED_LOCATION ${GFLAGS_LIBRARIES} )
51
57
ADD_DEPENDENCIES (gflags extern_gflags )
@@ -60,3 +66,4 @@ IF(WITH_C_API)
60
66
INSTALL (FILES ${GFLAGS_LIBRARIES} DESTINATION third_party/gflags/lib )
61
67
ENDIF ()
62
68
ENDIF ()
69
+
You can’t perform that action at this time.
0 commit comments