Skip to content

Commit

Permalink
Optimize project dir
Browse files Browse the repository at this point in the history
  • Loading branch information
owent committed Jun 20, 2024
1 parent e47951d commit ddbdd4e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion atframework/atframe_utils
2 changes: 1 addition & 1 deletion atframework/cmake-toolset
2 changes: 1 addition & 1 deletion sample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ foreach(SAMPLE_SRC_FILE IN LISTS SAMPLE_SRC_LIST)

target_compile_options(${SAMPLE_SRC_BIN_NAME} PRIVATE ${PROJECT_LIBATBUS_PRIVATE_COMPILE_OPTIONS})

set_property(TARGET ${SAMPLE_SRC_BIN_NAME} PROPERTY FOLDER "atframework/sample/atbus")
if(MSVC)
set_property(TARGET ${SAMPLE_SRC_BIN_NAME} PROPERTY FOLDER "atframework/sample/atbus")
add_target_properties(${SAMPLE_SRC_BIN_NAME} LINK_FLAGS /NODEFAULTLIB:library)
endif()
endforeach()
6 changes: 2 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,8 @@ target_compile_definitions(${PROJECT_LIBATBUS_LIB_LINK} PRIVATE ATBUS_MACRO_BUIL
target_compile_options(${PROJECT_LIBATBUS_LIB_LINK} PRIVATE ${PROJECT_LIBATBUS_PRIVATE_COMPILE_OPTIONS})
target_link_libraries(${PROJECT_LIBATBUS_LIB_LINK} PUBLIC ${PROJECT_LIBATBUS_PUBLIC_LINK_NAMES})

if(MSVC)
set_property(TARGET ${PROJECT_LIBATBUS_LIB_LINK} PROPERTY FOLDER "atframework/atbus")
set_property(TARGET "${PROJECT_LIBATBUS_LIB_LINK}-protocol" PROPERTY FOLDER "atframework/atbus")
endif()
set_property(TARGET ${PROJECT_LIBATBUS_LIB_LINK} PROPERTY FOLDER "atframework/atbus")
set_property(TARGET "${PROJECT_LIBATBUS_LIB_LINK}-protocol" PROPERTY FOLDER "atframework/atbus")

set(PROJECT_LIBATBUS_EXPORT_TARGETS "${PROJECT_LIBATBUS_LIB_LINK}" "${PROJECT_LIBATBUS_LIB_LINK}-protocol")
add_library("atframework::${PROJECT_LIBATBUS_LIB_LINK}-protocol" ALIAS "${PROJECT_LIBATBUS_LIB_LINK}-protocol")
Expand Down
4 changes: 1 addition & 3 deletions src/libatbus.macro.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,4 @@ add_custom_command(
add_custom_target("atbus-generate-protocol" SOURCES "${PROJECT_LIBATBUS_GENERATED_DIR}/include/libatbus_protocol.pb.h"
"${PROJECT_LIBATBUS_GENERATED_DIR}/src/libatbus_protocol.pb.cc")

if(MSVC)
set_property(TARGET "atbus-generate-protocol" PROPERTY FOLDER "atframework/atbus")
endif()
set_property(TARGET "atbus-generate-protocol" PROPERTY FOLDER "atframework/atbus")
4 changes: 1 addition & 3 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ foreach(TOOLS_SRC_FILE IN LISTS TOOLS_SRC_LIST)
target_link_libraries("${TOOLS_SRC_BIN_NAME}" atframework::atbus)
target_include_directories("${TOOLS_SRC_BIN_NAME}" PRIVATE "$<BUILD_INTERFACE:${PROJECT_TOOLS_INC_DIR}>")

if(MSVC)
set_property(TARGET "${TOOLS_SRC_BIN_NAME}" PROPERTY FOLDER "atframework/tools/atbus")
endif()
set_property(TARGET "${TOOLS_SRC_BIN_NAME}" PROPERTY FOLDER "atframework/tools/atbus")

install(
TARGETS "${TOOLS_SRC_BIN_NAME}"
Expand Down

0 comments on commit ddbdd4e

Please sign in to comment.