diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..567609b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..3b04b23 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 2.8.11) + +project(screenoff) + +if(MINGW) + # Set compiler flags + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") + set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") +endif() + +# Create executable from source file(s) +add_executable(${CMAKE_PROJECT_NAME} screenoff.cpp) + +install(TARGETS "${CMAKE_PROJECT_NAME}" RUNTIME DESTINATION ".") +install(FILES "README.md" "LICENSE" DESTINATION ".") + +set(CPACK_GENERATOR "ZIP") +set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}") +set(CPACK_PACKAGE_VERSION_MAJOR "0") +set(CPACK_PACKAGE_VERSION_MINOR "0") +set(CPACK_PACKAGE_VERSION_PATCH "1") +set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") + +# This must always be last! +include(CPack) diff --git a/cmake/Toolchain-x86_64-w64-mingw32.cmake b/cmake/Toolchain-x86_64-w64-mingw32.cmake new file mode 100644 index 0000000..f5486c9 --- /dev/null +++ b/cmake/Toolchain-x86_64-w64-mingw32.cmake @@ -0,0 +1,17 @@ +# the name of the target operating system +SET(CMAKE_SYSTEM_NAME Windows) + +# which compilers to use for C and C++ +SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc) +SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++) +SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres) + +# here is the target environment located +SET(CMAKE_FIND_ROOT_PATH ~/mingw32) + +# adjust the default behaviour of the FIND_XXX() commands: +# search for programs in the build host directories +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +# for libraries and headers in the target directories +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)