mirror of https://github.com/dnomd343/ClearDNS
Dnomd343
2 years ago
6 changed files with 51 additions and 8 deletions
@ -1,7 +1,9 @@ |
|||||
/bin/ |
/bin/ |
||||
/.idea/ |
/.idea/ |
||||
/assets/*.txt |
|
||||
/src/target/ |
/src/target/ |
||||
/cmake-build/ |
/cmake-build/ |
||||
/cmake-build-debug/ |
/cmake-build-debug/ |
||||
/cmake-build-release/ |
/cmake-build-release/ |
||||
|
|
||||
|
/assets/*.txt |
||||
|
/include/constant.h |
||||
|
@ -1,6 +1,45 @@ |
|||||
cmake_minimum_required(VERSION 2.8.12) |
cmake_minimum_required(VERSION 2.8.12) |
||||
project(cleardns) |
|
||||
|
|
||||
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) |
project(cleardns LANGUAGES C) |
||||
|
|
||||
|
set(CMAKE_C_STANDARD 99) |
||||
|
|
||||
|
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/) |
||||
|
|
||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror") |
||||
|
|
||||
|
############################################################### |
||||
|
|
||||
|
if(NOT CMAKE_BUILD_TYPE) |
||||
|
set(CMAKE_BUILD_TYPE Release) |
||||
|
endif() |
||||
|
|
||||
|
if(NOT CMAKE_EXE_LINKER_FLAGS) |
||||
|
set(CMAKE_EXE_LINKER_FLAGS -static) |
||||
|
endif() |
||||
|
|
||||
|
############################################################### |
||||
|
|
||||
|
macro(git_tag _tag) |
||||
|
find_package(Git QUIET) |
||||
|
if (GIT_FOUND) |
||||
|
execute_process( |
||||
|
COMMAND ${GIT_EXECUTABLE} describe --tags |
||||
|
OUTPUT_VARIABLE ${_tag} |
||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE |
||||
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} |
||||
|
) |
||||
|
endif() |
||||
|
endmacro() |
||||
|
|
||||
|
set(VERSION "") |
||||
|
git_tag(VERSION) |
||||
|
if(VERSION STREQUAL "") # without git tag |
||||
|
message(FATAL_ERROR "Git command not found") |
||||
|
endif() |
||||
|
|
||||
|
############################################################### |
||||
|
|
||||
add_subdirectory(src) |
add_subdirectory(src) |
||||
|
|
||||
|
############################################################### |
||||
|
Loading…
Reference in new issue