diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index 940dd5e6aa..dcaedf98de 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -151,7 +151,7 @@ set_target_properties(${ENGINEX_CORE_LIB} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" VERSION "${ENGINEX_VERSION}" FOLDER "Internal" ) diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt index a3c9d58632..8ed7a91162 100644 --- a/extensions/CMakeLists.txt +++ b/extensions/CMakeLists.txt @@ -48,7 +48,7 @@ function(setup_cocos_extension_config target_name) PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" FOLDER "Extensions" ) diff --git a/external/glad/CMakeLists.txt b/external/glad/CMakeLists.txt index 1256ab7185..b6c0cd5539 100644 --- a/external/glad/CMakeLists.txt +++ b/external/glad/CMakeLists.txt @@ -30,6 +30,6 @@ set_target_properties(${target_name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" FOLDER "External" ) diff --git a/external/lua/plainlua/CMakeLists.txt b/external/lua/plainlua/CMakeLists.txt index 4d6320dd8e..83a68ffb52 100644 --- a/external/lua/plainlua/CMakeLists.txt +++ b/external/lua/plainlua/CMakeLists.txt @@ -46,30 +46,39 @@ set_target_properties(${target_name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" FOLDER "External" ) if(WIN32 OR MACOSX) - # tool:plainluac compiling bytecode - set(target_name plainluac) - add_executable(${target_name} ${LUA_CORE} ${LUA_SRC_PATH}/luac.c) - if(${LUA_VERSION} VERSION_GREATER_EQUAL "5.4.0") # !important: traditional lua bindings solution tolua++ not support yet - target_compile_definitions(${target_name} PUBLIC LUA_COMPAT_APIINTCASTS=1) - elseif(${LUA_VERSION} VERSION_GREATER_EQUAL "5.3.0") - target_compile_definitions(${target_name} - PUBLIC LUA_COMPAT_5_1=1 - PUBLIC LUA_COMPAT_5_2=1 - ) - elseif(${LUA_VERSION} VERSION_GREATER_EQUAL "5.2.0") - target_compile_definitions(${target_name} PUBLIC LUA_COMPAT_ALL=1) - endif() + + function (add_lua_bin target_name src_files) + add_executable(${target_name} ${src_files}) + if(${LUA_VERSION} VERSION_GREATER_EQUAL "5.4.0") # !important: traditional lua bindings solution tolua++ not support yet + target_compile_definitions(${target_name} PUBLIC LUA_COMPAT_APIINTCASTS=1) + elseif(${LUA_VERSION} VERSION_GREATER_EQUAL "5.3.0") + target_compile_definitions(${target_name} + PUBLIC LUA_COMPAT_5_1=1 + PUBLIC LUA_COMPAT_5_2=1 + ) + elseif(${LUA_VERSION} VERSION_GREATER_EQUAL "5.2.0") + target_compile_definitions(${target_name} PUBLIC LUA_COMPAT_ALL=1) + endif() - set_target_properties(${target_name} - PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" - FOLDER "Tools" - ) + target_link_libraries(${target_name} plainlua) + + set_target_properties(${target_name} + PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" + FOLDER "Tools" + ) + endfunction() + + # tool:luac the lua bytecode compiler + add_lua_bin(luac "${LUA_SRC_PATH}/luac.c;${LUA_SRC_PATH}/ldump.c;${LUA_SRC_PATH}/lopcodes.c") + + # tool:lua the lua interpreter + add_lua_bin(lua "${LUA_SRC_PATH}/lua.c") endif() diff --git a/external/ogg/CMakeLists.txt b/external/ogg/CMakeLists.txt index 443b94c8a4..1fac7f9d99 100644 --- a/external/ogg/CMakeLists.txt +++ b/external/ogg/CMakeLists.txt @@ -47,6 +47,6 @@ set_target_properties(${target_name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" FOLDER "External" ) diff --git a/external/pugixml/CMakeLists.txt b/external/pugixml/CMakeLists.txt index 744a4907f1..6cd8b0b5f5 100644 --- a/external/pugixml/CMakeLists.txt +++ b/external/pugixml/CMakeLists.txt @@ -27,7 +27,7 @@ set_target_properties(${target_name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" FOLDER "External" )