no message
parent
526c77dd0e
commit
5e65ec6a72
|
@ -6,6 +6,14 @@ message("current make is " ${CMAKE_MAKE_PROGRAM})
|
||||||
enable_language(CXX)
|
enable_language(CXX)
|
||||||
project(generallib)
|
project(generallib)
|
||||||
add_subdirectory(general)
|
add_subdirectory(general)
|
||||||
|
|
||||||
|
find_package(libevent REQUIRED)
|
||||||
|
set(EVENT__HAVE_LIBEVENT 1)
|
||||||
|
|
||||||
|
message(STATUS "libevent include: ${libevent_INCLUDE_DIR}")
|
||||||
|
message(STATUS "libevent lib: ${libevent_LIBRARIES}")
|
||||||
|
message(STATUS "libevent lib Dirs: ${libevent_LIB_DIRS}")
|
||||||
|
message(STATUS "library files : " $<TARGET_OBJECTS:General>
|
||||||
SET(SRC_SDK sdk_main.c test/src/heapsort/main.c)#生成动态库需要至少包含一个源文件
|
SET(SRC_SDK sdk_main.c test/src/heapsort/main.c)#生成动态库需要至少包含一个源文件
|
||||||
add_library(generallib STATIC $<TARGET_OBJECTS:General> ${SRC_SDK})
|
add_library(generallib STATIC $<TARGET_OBJECTS:General> ${SRC_SDK})
|
||||||
message("CMAKE_BINARY_DIR is " ${CMAKE_BINARY_DIR})
|
message("CMAKE_BINARY_DIR is " ${CMAKE_BINARY_DIR})
|
||||||
|
@ -17,12 +25,7 @@ target_link_libraries(generallib public
|
||||||
libevent.a
|
libevent.a
|
||||||
-Wl,--no-whole-archive
|
-Wl,--no-whole-archive
|
||||||
)
|
)
|
||||||
find_package(libevent REQUIRED)
|
|
||||||
set(EVENT__HAVE_LIBEVENT 1)
|
|
||||||
|
|
||||||
message(STATUS "libevent include: ${libevent_INCLUDE_DIR}")
|
|
||||||
message(STATUS "libevent lib: ${libevent_LIBRARIES}")
|
|
||||||
message(STATUS "libevent lib Dirs: ${libevent_LIB_DIRS}")
|
|
||||||
|
|
||||||
message("current path is" ${CMAKE_CURRENT_SOURCE_DIR})
|
message("current path is" ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
IF (WIN32)
|
IF (WIN32)
|
||||||
|
@ -30,12 +33,12 @@ IF (WIN32)
|
||||||
message("using clang")
|
message("using clang")
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
message("using gcc")
|
message("using gcc")
|
||||||
#add_custom_command (
|
add_custom_command (
|
||||||
# TARGET generallib POST_BUILD
|
TARGET generallib POST_BUILD
|
||||||
# COMMAND ar -x
|
COMMAND ar -x
|
||||||
# ${CMAKE_CURRENT_SOURCE_DIR}/libd/libevent.a
|
${CMAKE_CURRENT_SOURCE_DIR}/libd/libevent.a
|
||||||
# COMMENT "package library ar -x ${CMAKE_CURRENT_SOURCE_DIR}/libd/libevent.a "
|
COMMENT "package library ar -x ${CMAKE_CURRENT_SOURCE_DIR}/libd/libevent.a "
|
||||||
# )
|
)
|
||||||
add_custom_command (
|
add_custom_command (
|
||||||
TARGET generallib POST_BUILD
|
TARGET generallib POST_BUILD
|
||||||
COMMAND ar rc libgeneral.a *.obj
|
COMMAND ar rc libgeneral.a *.obj
|
||||||
|
|
Loading…
Reference in New Issue