From 82858c01ef924ce5ff9c39c55dfd3eaec6d398df Mon Sep 17 00:00:00 2001 From: Akiko Date: Sun, 7 Jun 2015 14:41:48 +0200 Subject: [PATCH] - started cmake buildsystem --- CMakeLists.txt | 24 ++++++++++++++++++++++++ Scripts/code_counter.sh | 38 ++++++++++++++++++++++++++++++++++++++ cmake_distclean.sh | 8 ++++++++ 3 files changed, 70 insertions(+) create mode 100644 CMakeLists.txt create mode 100755 Scripts/code_counter.sh create mode 100755 cmake_distclean.sh diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..0f421f3 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,24 @@ +CMAKE_MINIMUM_REQUIRED (VERSION 3.0) +PROJECT (Genesis3D) + +# includes and outputs +SET (CMAKE_INCLUDE_CURRENT_DIR on) +INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}) +SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) +SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/plugin) +SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) + +# compiler settings +IF (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") +MESSAGE ("Unix-like system: ${CMAKE_SYSTEM_NAME}") +SET (CMAKE_CXX_FLAGS "-std=c++1y -pthread -fdiagnostics-color=always -W -Wall -Wextra -Os") +SET (CMAKE_C_FLAGS "-std=c11 -pthread -fdiagnostics-color=always -W -Wall -Wextra -Os") +ELSEIF (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") +MESSAGE ("Windows-like system: ${CMAKE_SYSTEM_NAME}") +SET (CMAKE_CXX_FLAGS "-std=c++1y -W -Wall -Wextra -Os") +SET (CMAKE_C_FLAGS "-std=c11 -W -Wall -Wextra -Os") +ELSE () +MESSAGE (FATAL_ERROR "unsupported system: ${CMAKE_SYSTEM_NAME}") +ENDIF () + +ADD_SUBDIRECTORY (G3D) diff --git a/Scripts/code_counter.sh b/Scripts/code_counter.sh new file mode 100755 index 0000000..0ed195d --- /dev/null +++ b/Scripts/code_counter.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +# code counter +LOG="/tmp/log.$$" +LINES=0 +C=0 + +find| grep "\.c$" >$LOG +find| grep "\.cpp$" >>$LOG +find| grep "\.cxx$" >>$LOG +find| grep "\.h$" >>$LOG +find| grep "\.hpp$" >>$LOG +find| grep "\.hxx$" >>$LOG +find| grep "\.sh$" >>$LOG +find| grep "\.S$" >>$LOG +find| grep "\.ts$" >>$LOG +find| grep "\.ui$" >>$LOG +find| grep "\.qrc$" >>$LOG +find| grep "\.bat$" >>$LOG +find| grep "\.cmake$" >>$LOG +find| grep "CMakeLists.txt" >>$LOG +while read L +do + C=$((C+1)) + W=$(cat $L|wc -l) + S=$(cat $L|wc -c) + SIZE=$((SIZE+S)) + LINES=$((LINES+W)) +done <$LOG +rm $LOG + +echo +echo "--- SOURCE CODE SUMMARY ---" +echo "source path: $(pwd)" +echo "source files: $C" +echo "lines of code: $LINES" +echo "size of code: $SIZE bytes" +echo diff --git a/cmake_distclean.sh b/cmake_distclean.sh new file mode 100755 index 0000000..011a598 --- /dev/null +++ b/cmake_distclean.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +rm -rf CMakeCache.txt +rm -rf CMakeFiles/ +rm -rf Makefile +rm -rf cmake_install.cmake + +Scripts/code_counter.sh -- 2.15.1