12345678910111213141516171819202122232425262728293031323334353637383940 |
- cmake_minimum_required(VERSION 2.8)
-
- # git current hash
- execute_process(COMMAND git log --pretty=format:%h -n 1
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- OUTPUT_VARIABLE GIT_SHA1)
-
- execute_process(COMMAND git symbolic-ref -q --short HEAD
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- OUTPUT_VARIABLE GIT_REF_NAME)
- if ("${GIT_REF_NAME}" EQUAL "")
- execute_process(COMMAND git describe --tags --exact-match
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- OUTPUT_VARIABLE GIT_REF_NAME)
- endif()
- string(STRIP "${GIT_REF_NAME}" GIT_REF_NAME)
- string(STRIP "${GIT_SHA1}" GIT_SHA1)
- add_definitions(-DGIT_SHA1=${GIT_SHA1} -DGIT_REF_NAME=${GIT_REF_NAME})
-
-
- set(PROJECT_NAME nfc_cpptools)
- project(${PROJECT_NAME})
-
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
- if(CMAKE_BUILD_TYPE STREQUAL "Debug")
- message(STATUS "Debug build")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb -g3")
- else()
- message(STATUS "Release build")
- endif()
-
- add_subdirectory(libnfc_cpptools)
- add_subdirectory(cli)
- #add_subdirectory(gui)
-
- find_package(GTest)
- if (GTEST_FOUND)
- enable_testing()
- add_subdirectory(tests)
- endif (GTEST_FOUND)
|