From 8d5c5835bb1243dd9d975770adb135ab2d581022 Mon Sep 17 00:00:00 2001 From: Michael Hanke Date: Sun, 19 Oct 2014 20:11:43 +0200 Subject: [PATCH] Minimal infrastructure for a CMake-based build Simplistic recipe: mkdir build cd build cmake .. make make install --- CMakeLists.txt | 17 +++++++++++++++++ console/CMakeLists.txt | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 console/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..ef8324d7 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,17 @@ +project(dcm2niix) + +cmake_minimum_required(VERSION 2.6) +# +# Zlib +# +find_package(ZLIB) + +# Predefined permission set to enforce proper permissions +# during install even if files in the sources have different +# settings +set(FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) + +## +## Sub-projects +## +add_subdirectory(console) diff --git a/console/CMakeLists.txt b/console/CMakeLists.txt new file mode 100644 index 00000000..3381d8f4 --- /dev/null +++ b/console/CMakeLists.txt @@ -0,0 +1,16 @@ +project(console) +set(PROGRAMS dcm2niix) + +add_executable(dcm2niix + main_console.cpp + nii_dicom.cpp + nifti1_io_core.cpp + nii_ortho.cpp + nii_dicom_batch.cpp) +if(ZLIB_FOUND) + TARGET_LINK_LIBRARIES(dcm2niix z) +else(ZLIB_FOUND) + ADD_DEFINITIONS(-DmyDisableZlib) +endif(ZLIB_FOUND) + +install(TARGETS ${PROGRAMS} DESTINATION bin)