Skip to content

Commit

Permalink
Add option to use FindDCMTK modules or not.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Abadie committed Oct 21, 2015
1 parent 10173a9 commit 7b5ff72
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.0.2)

project(QTDCM VERSION "2.1.0")

Expand All @@ -14,6 +14,14 @@ else()
endif()
mark_as_advanced(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)

option(DCMTK_FIND_PACKAGE_USE_CONFIG_ONLY
"Do not use any FindDCMTK.cmake module found in the CMAKE_MODULE_PATH to find DCMTK."
OFF)

if(DCMTK_FIND_PACKAGE_USE_CONFIG_ONLY)
set(DCMTK_FIND_PACKAGE_STATEGY NO_MODULE)
endif()

set(${PROJECT_NAME}_CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${${PROJECT_NAME}_CMAKE_MODULE_PATH}")

Expand Down
2 changes: 1 addition & 1 deletion example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.0.2)

project(dicom)

Expand Down
8 changes: 4 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.0.2)

project(qtdcm)

Expand All @@ -7,10 +7,10 @@ find_package( Qt5 REQUIRED COMPONENTS Core Widgets Network)
get_target_property(QT5_QMAKE_EXECUTABLE Qt5::qmake LOCATION)
get_filename_component(QT5_BINARY_DIR ${QT5_QMAKE_EXECUTABLE} PATH)

find_package(DCMTK REQUIRED)
find_package(DCMTK REQUIRED ${DCMTK_FIND_PACKAGE_STATEGY})
include_directories(${DCMTK_INCLUDE_DIRS})

if(APPLE)
if(APPLE AND NOT DCMTK_FIND_PACKAGE_USE_CONFIG_ONLY)
include(FixDCMTKMacInstall)
FixDCMTKMacInstall()
endif()
Expand Down Expand Up @@ -146,7 +146,7 @@ target_link_libraries(${PROJECT_NAME} ${${PROJECT_NAME}_LIBRARIES})
source_group("Header Files" REGULAR_EXPRESSION .*\\.h\$)
source_group("Generated Files" FILES ${${PROJECT_NAME}_MOC_SRCS})

if(APPLE)
if(APPLE AND NOT DCMTK_FIND_PACKAGE_USE_CONFIG_ONLY)
include(FixDCMTKMacLink)
FixDCMTKMacLibLink(${PROJECT_NAME})
endif()
Expand Down

0 comments on commit 7b5ff72

Please sign in to comment.