diff options
| author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2020-07-02 17:27:03 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-02 17:27:03 -0400 |
| commit | 9c149534389845412fbfb305b8a6f00923009c4b (patch) | |
| tree | 0bb4cba597691aa9be0dc23bd1270e2bcbfde1bb /CMakeLists.txt | |
| parent | 2df3b35bebdb81c8e45c08d5a7af46e8fa32e07b (diff) | |
| parent | 288ce22e256f71ba01cea63aa03a4880e5b1612d (diff) | |
| download | splitfits-9c149534389845412fbfb305b8a6f00923009c4b.tar.gz | |
Merge pull request #4 from jhunkeler/circleci-project-setup
Circleci project setup
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ea12358..43f002c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,29 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.1...3.16) project(splitfits C) - set(CMAKE_C_STANDARD 99) +find_package(Git) +if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git") + execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --long --tags --dirty + OUTPUT_VARIABLE GIT_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) +else() + message(WARNING "git not found or directory is not a repository") + set(GIT_VERSION, "unknown") +endif() + add_executable(splitfits splitfits.c) +include_directories("${CMAKE_CURRENT_BINARY_DIR}") +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/version.h.in" + "${CMAKE_CURRENT_BINARY_DIR}/version.h" @ONLY) + +file(GLOB TEST_RUNNER "test*.sh") +file(COPY ${TEST_RUNNER} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +file(GLOB TEST_FRAMEWORK "tests") +file(COPY ${TEST_FRAMEWORK} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + + +add_custom_target(check "${CMAKE_CURRENT_BINARY_DIR}/test.sh") install(TARGETS splitfits - RUNTIME) + RUNTIME DESTINATION bin) |
