Skip to content

Instantly share code, notes, and snippets.

@marcinwol
Created June 20, 2015 03:44
Show Gist options
  • Save marcinwol/e91122c9f26306b33cce to your computer and use it in GitHub Desktop.
Save marcinwol/e91122c9f26306b33cce to your computer and use it in GitHub Desktop.
Basic CMakeLists.txt for compiled DCMTK 3.6.1
# This is example of the cmake file that can be used for basic compilation of a C++11 program
# that uses DCMTK 3.6.1 in ubuntu 14.04
# Compilation instructions are here:
# https://gist.github.com/marcinwol/089d4a91f1a1279e33f9
cmake_minimum_required(VERSION 2.8)
# name of the cpp project
project(testDMCTK)
# cpp flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
#add_definitions(-DHAVE_CONFIG_H)
# set where the compiled dcmtk 3.6.1 was installed.
SET(DCMTK_DIR "/home/m/dcmtk361")
# specify include path where dcmtk header files can be found
INCLUDE_DIRECTORIES(${DCMTK_DIR}/include)
# specify library folder where dcmtk libraries can be found
LINK_DIRECTORIES(${DCMTK_DIR}/lib)
# your source files.
set(SOURCE_FILES main.cpp)
# specify executable file
add_executable(testDMCTK ${SOURCE_FILES})
# link dcmtk library files with your execectubale.
# REMEMBER: order of the link libraries matters!
target_link_libraries(testDMCTK dcmpstat dcmdsig dcmsr
dcmimage dcmimgle dcmqrdb dcmnet dcmtls
dcmdata oflog ofstd pthread z tiff)
@jorgetoctaguano
Copy link

A question please in the case that it is for an Android project in qt as it would be the CMakeLists.txt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment