Skip to content

Commit

Permalink
Minimal infrastructure for a CMake-based build
Browse files Browse the repository at this point in the history
Simplistic recipe:

mkdir build
cd build
cmake ..
make
make install
  • Loading branch information
mih committed Oct 19, 2014
1 parent ab6319d commit 8d5c583
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
16 changes: 16 additions & 0 deletions console/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 8d5c583

Please sign in to comment.