util/codestyle.sh: Add CMakeLists.txt whitespace and caps rules and apply them

This commit is contained in:
Perttu Ahola 2014-09-24 14:28:10 +03:00
parent 3157198a30
commit dfd2865d3a
3 changed files with 14 additions and 9 deletions

View File

@ -18,8 +18,8 @@ include_directories("3rdparty/smallsha1")
# Global options
#
SET(BUILD_SERVER TRUE CACHE BOOL "Build server")
SET(BUILD_CLIENT TRUE CACHE BOOL "Build client")
set(BUILD_SERVER TRUE CACHE BOOL "Build server")
set(BUILD_CLIENT TRUE CACHE BOOL "Build client")
#
# Urho3D dependency
@ -57,7 +57,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
# Security / crash protection
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all")
IF(BUILD_CLIENT)
if(BUILD_CLIENT)
# Client
set(CLIENT_EXE_NAME buildat_client)
set(CLIENT_SRCS
@ -74,15 +74,15 @@ IF(BUILD_CLIENT)
add_executable(${CLIENT_EXE_NAME} ${CLIENT_SRCS})
TARGET_LINK_LIBRARIES(${CLIENT_EXE_NAME}
target_link_libraries(${CLIENT_EXE_NAME}
c55lib
smallsha1
${ABSOLUTE_PATH_LIBS}
${LINK_LIBS_ONLY}
)
ENDIF(BUILD_CLIENT)
endif(BUILD_CLIENT)
IF(BUILD_SERVER)
if(BUILD_SERVER)
# Server
set(SERVER_EXE_NAME buildat_server)
set(SERVER_SRCS
@ -102,11 +102,11 @@ IF(BUILD_SERVER)
)
add_executable(${SERVER_EXE_NAME} ${SERVER_SRCS})
TARGET_LINK_LIBRARIES(${SERVER_EXE_NAME}
target_link_libraries(${SERVER_EXE_NAME}
c55lib
smallsha1
dl
${ABSOLUTE_PATH_LIBS}
${LINK_LIBS_ONLY}
)
ENDIF(BUILD_SERVER)
endif(BUILD_SERVER)

View File

@ -16,7 +16,6 @@ Buildat TODO
that Lua will dictate the function/object design)
- Move self-contained library-like Lua functions from client/app.cpp to a
reusable location so that they can be used from server-side Lua in the future
- util/codestyle.sh: Add some CMakeLists.txt formatting (case, whitespace)
- Proper whitelisting sandbox for Urho3D's Lua API
- Update testmodules/minigame to urho3d
- New things in deps.txt?

View File

@ -44,3 +44,9 @@ sed -i -e 's/" + /"+/g' $header_files $cpp_files
sed -i -e 's/" *+$/"+/g' $header_files $cpp_files
sed -i -e 's/^\(\t\+\) \+/\1\t\t/g' $header_files $cpp_files
# Format CMake too
cmake_files="$script_dir"/../CMakeLists.txt
sed -i -e 's/\(^[ \t]*\)\([A-Za-z_]\+\)[ \t]*(/\1\L\2(/' $cmake_files
sed -i -e 's/([\t ]\+\([A-Za-z_${)]\)/(\1/g' $cmake_files
sed -i -e 's/\([A-Za-z_}(]\)[\t ]\+)/\1)/g' $cmake_files