From: Adam Malinowski Date: Wed, 1 Jun 2016 06:51:14 +0000 (+0200) Subject: Add basic structure of project X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F25%2F95225%2F1;p=test%2Ftools%2Fscreenshooter.git Add basic structure of project Change-Id: I9115543610ad62c43a11ba16dcd1cb5e66a4aab1 --- diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..f714041 --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Adam Malinowski diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..01058f8 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,59 @@ +# Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# @file CMakeLists.txt +# @author Adam Malinowski +# + +############################# Check minimum CMake version ##################### + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3) +PROJECT("screenshooter") +set(SCREENSHOOTER_VERSION 0.0.1) + +############################# cmake packages ################################## + +INCLUDE(FindPkgConfig) +INCLUDE(CheckCXXCompilerFlag) + +############################# install dirs ################################## + +SET(BIN_INSTALL_DIR + "${CMAKE_INSTALL_PREFIX}/bin" + CACHE PATH + "Binary installation directory") + +############################# compiler flags ################################## + +SET(CMAKE_CXX_FLAGS_PROFILING "-O0 -g -pg") +SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -ggdb") +SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -g") +SET(CMAKE_CXX_FLAGS_CCOV "-O2 -g --coverage") + +# Set compiler warning flags +ADD_DEFINITIONS("-Werror") # Make all warnings into errors. +ADD_DEFINITIONS("-Wall") # Generate all warnings +ADD_DEFINITIONS("-Wextra") # Generate even more extra warnings + +# Don't export symbols by default +ADD_DEFINITIONS("-fvisibility=hidden") + + +IF (CMAKE_BUILD_TYPE MATCHES "DEBUG") + ADD_DEFINITIONS("-DBUILD_TYPE_DEBUG") +ENDIF (CMAKE_BUILD_TYPE MATCHES "DEBUG") + +SET(TARGET_SCREENSHOOTER "screenshooter") + +ADD_SUBDIRECTORY(src) diff --git a/packaging/screenshooter.changes b/packaging/screenshooter.changes new file mode 100644 index 0000000..bc560e8 --- /dev/null +++ b/packaging/screenshooter.changes @@ -0,0 +1,2 @@ +* Mon May 23 2016 Adam Malinowski 0.0.1 +- Initial release diff --git a/packaging/screenshooter.spec b/packaging/screenshooter.spec new file mode 100644 index 0000000..f8e38d6 --- /dev/null +++ b/packaging/screenshooter.spec @@ -0,0 +1,28 @@ +Name: screenshooter +Summary: Tool for taking screenshots +Version: 0.0.1 +Release: 1 +Group: Development/Tools +License: Apache-2.0 +URL: http://www.tizen.org +Source0: %{name}_%{version}.tar.gz +BuildRequires: cmake + +BuildRoot: %{_tmppath}/%{name}_%{version}-build + +%description +Tool for taking screeenshots from command-line. + +%prep +%setup -q -n %{name}-%{version} + +%build +cmake -DCMAKE_INSTALL_PREFIX=/usr +%__make + +%install +rm -rf %{buildroot} +%make_install + +%files +%{_bindir}/%{name} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..891b200 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,44 @@ +# Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# @file src/CMakeLists.txt +# @author Adam Malinowski +# + +FIND_PACKAGE(PkgConfig) + +PKG_CHECK_MODULES(SCREENSHOOTER_DEP + REQUIRED + ) + +SET(SCREENSHOOTER_PATH + ${PROJECT_SOURCE_DIR}/src + ) + +SET(SCREENSHOOTER_SOURCES + ${SCREENSHOOTER_PATH}/main.c + ) + +INCLUDE_DIRECTORIES( + ${SCREENSHOOTER_PATH} + ${SCREENSHOOTER_DEP_INCLUDE_DIRS} + ) + +ADD_EXECUTABLE(${TARGET_SCREENSHOOTER} ${SCREENSHOOTER_SOURCES}) + +TARGET_LINK_LIBRARIES(${TARGET_SCREENSHOOTER} + ${SCREENSHOOTER_DEP_LIBRARIES} + ) + +INSTALL(TARGETS ${TARGET_SCREENSHOOTER} DESTINATION ${BIN_INSTALL_DIR}) diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..9112e55 --- /dev/null +++ b/src/main.c @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ +/** + * @file src/main.cpp + * @author Adam Malinowski + * @brief Main source file of screenshooter + */ + +#include + +int main(int argc, const char **argv) { + (void) argc; + (void) argv; + + return EXIT_SUCCESS; +}