Skip to content

Commit

Permalink
fix pre_build
Browse files Browse the repository at this point in the history
  • Loading branch information
hggq committed Nov 14, 2024
1 parent cf11693 commit b60657d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,13 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/viewsrc/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/websockets/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

add_executable(paozhu_pre ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpcli/autopickmethod.cpp ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpserver/src/md5.cpp)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/bin/paozhu_empty)
file(REMOVE_RECURSE ${CMAKE_CURRENT_SOURCE_DIR}/bin/paozhu_empty)
endif ()
#EXECUTE_PROCESS(COMMAND rm ${CMAKE_CURRENT_SOURCE_DIR}/bin/paozhu_empty)
set(PAOZHU_PRE paozhu_pre)
add_executable(${PAOZHU_PRE} ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpcli/autopickmethod.cpp ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpserver/src/md5.cpp)
add_executable(paozhu_empty ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpcli/autoemptymethod.cpp)



Expand Down Expand Up @@ -193,11 +199,12 @@ endif()
if (ENABLE_WIN_VCPKG STREQUAL "ON")
else ()
add_custom_command(
TARGET paozhu_pre
TARGET paozhu_empty paozhu
PRE_BUILD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
COMMAND echo "-- controls method --"
COMMAND paozhu_pre ${CMAKE_CURRENT_SOURCE_DIR}/
COMMAND ${PAOZHU_PRE} ${CMAKE_CURRENT_SOURCE_DIR}/
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_SOURCE_DIR}/bin/paozhu_empty
)
endif()

Expand Down

0 comments on commit b60657d

Please sign in to comment.