| 1 |
cmake_minimum_required(VERSION 3.2) |
| 2 |
project(minimac4 VERSION 4.1.6) |
| 3 |
|
| 4 |
if(NOT CMAKE_BUILD_TYPE) |
| 5 |
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose build type (Debug|Release|RelWithDebInfo|MinSizeRel)" FORCE) |
| 6 |
endif() |
| 7 |
|
| 8 |
set(CMAKE_CXX_STANDARD 11) |
| 9 |
|
| 10 |
add_definitions(-DVERSION="${PROJECT_VERSION}") |
| 11 |
|
| 12 |
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;${CMAKE_FIND_LIBRARY_SUFFIXES}") # Prefer libz.a when both are available |
| 13 |
|
| 14 |
#find_package(OpenMP) |
| 15 |
#if (OPENMP_FOUND) |
| 16 |
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") |
| 17 |
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") |
| 18 |
#endif() |
| 19 |
|
| 20 |
|
| 21 |
find_package(Threads) |
| 22 |
find_library(OMPP_LIBRARY omp) |
| 23 |
find_package(savvy REQUIRED) |
| 24 |
|
| 25 |
add_executable(minimac4 |
| 26 |
src/dosage_writer.cpp src/dosage_writer.hpp |
| 27 |
src/hidden_markov_model.cpp src/hidden_markov_model.hpp |
| 28 |
src/input_prep.cpp src/input_prep.hpp |
| 29 |
src/recombination.cpp src/recombination.hpp |
| 30 |
src/unique_haplotype.cpp src/unique_haplotype.hpp |
| 31 |
src/main.cpp) |
| 32 |
|
| 33 |
target_link_libraries(minimac4 savvy ${OMPP_LIBRARY} Threads::Threads) |
| 34 |
|
| 35 |
add_custom_target(manuals |
| 36 |
COMMAND help2man --output "${CMAKE_BINARY_DIR}/minimac4.1" "${CMAKE_BINARY_DIR}/minimac4") |
| 37 |
|
| 38 |
if(BUILD_TESTS) |
| 39 |
enable_testing() |
| 40 |
add_test(simple_test ${CMAKE_SOURCE_DIR}/test/simple-test.sh ${CMAKE_BINARY_DIR}/minimac4 m4_simple_test_output ${CMAKE_SOURCE_DIR}/test/input/ref_panel.vcf ${CMAKE_SOURCE_DIR}/test/input/tar_panel.vcf) |
| 41 |
add_test(haploid_and_diploid_test ${CMAKE_SOURCE_DIR}/test/simple-test.sh ${CMAKE_BINARY_DIR}/minimac4 m4_haploid_and_diploid_test_output ${CMAKE_SOURCE_DIR}/test/input/ref_panel_with_haploid_sample.vcf ${CMAKE_SOURCE_DIR}/test/input/tar_panel_with_haploid_sample.vcf) |
| 42 |
endif() |
| 43 |
|
| 44 |
install(TARGETS minimac4 RUNTIME DESTINATION bin) |
| 45 |
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/minimac4.1 |
| 46 |
DESTINATION share/man/man1 |
| 47 |
OPTIONAL) |
| 48 |
|
| 49 |
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) |
| 50 |
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) |
| 51 |
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) |
| 52 |
include(CPack) |