Commit 9d58024b authored by Stefan Philips's avatar Stefan Philips

[FIX] CMake doesn't break when OpenIGTLink library isn't found.

parent e2c80b30
...@@ -34,24 +34,25 @@ GET_FILENAME_COMPONENT( MODULE_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME ) ...@@ -34,24 +34,25 @@ GET_FILENAME_COMPONENT( MODULE_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME )
# --------------------------------------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------------------------------------
# 1: FindPackage( LibYouNeed ) # 1: FindPackage( LibYouNeed )
Find_Package( OpenIGTLink ) Find_Package( OpenIGTLink QUIET )
# 2: INCLUDE_DIRECTORIES( ${LIBYOUNEED_INCLUDE_DIR} ) IF( OpenIGTLink_FOUND )
INCLUDE_DIRECTORIES( ${OpenIGTLink_INCLUDE_DIRS} ) # 2: INCLUDE_DIRECTORIES( ${LIBYOUNEED_INCLUDE_DIR} )
INCLUDE_DIRECTORIES( ${OpenIGTLink_INCLUDE_DIRS} )
# 3: LINK_DIRECTORIES( ${LIBYOUNEED_LIBRARY_DIRS} )
LINK_DIRECTORIES( ${OpenIGTLink_LIBRARY_DIRS} ) # 3: LINK_DIRECTORIES( ${LIBYOUNEED_LIBRARY_DIRS} )
# 4: Add ${LIBYOUNEED_LIBRARY} as _MODULE_DEPENDENCIES parameter to SETUP_MODULE LINK_DIRECTORIES( ${OpenIGTLink_LIBRARY_DIRS} )
# 4: Add ${LIBYOUNEED_LIBRARY} as _MODULE_DEPENDENCIES parameter to SETUP_MODULE
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Setup for compilation # ---------------------------------------------------------------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------------------------------------------------------------- # Setup for compilation
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Let this function do the job. It sets up tests and copies shaders automatically. It additionally configures the stylecheck mechanism for this
# module. # Let this function do the job. It sets up tests and copies shaders automatically. It additionally configures the stylecheck mechanism for this
SETUP_MODULE( ${MODULE_NAME} # name of the module # module.
"${CMAKE_CURRENT_SOURCE_DIR}" # where to find the source ${CMAKE_CURRENT_SOURCE_DIR} is a good idea here mostly SETUP_MODULE( ${MODULE_NAME} # name of the module
${OpenIGTLink_LIBRARIES} # does your module need additional libs to compile? "${CMAKE_CURRENT_SOURCE_DIR}" # where to find the source ${CMAKE_CURRENT_SOURCE_DIR} is a good idea here mostly
"" # do you want to exclude files from stylechecking? (externals for example) ${OpenIGTLink_LIBRARIES} # does your module need additional libs to compile?
) "" # do you want to exclude files from stylechecking? (externals for example)
)
ENDIF( OpenIGTLink_FOUND )
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment