-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added CMake project for compiling and packaging
- Loading branch information
1 parent
eb70c52
commit 368f1fb
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |