-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
28 lines (23 loc) · 938 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
cmake_minimum_required (VERSION 2.6)
project (bindash)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -fopenmp")
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast -fopenmp") # fast floating point arithmetics
add_executable (bindash ./src/bindash.cpp)
target_link_libraries(bindash -lm)
target_link_libraries(bindash -lz)
# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Get the "not version-controlled" changes with respect to the working branch
execute_process(
COMMAND git diff HEAD --shortstat
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_DIFF_SHORTSTAT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
add_definitions("-DGIT_COMMIT_HASH=${GIT_COMMIT_HASH}")
add_definitions("-DGIT_DIFF_SHORTSTAT=${GIT_DIFF_SHORTSTAT}")