Commit 51ff4efa authored by Aaron Bray's avatar Aaron Bray

Fix bugs in imstkconfig.cmake support

- Support debug config
- disable imgui search in find for config
parent a9b46329
Pipeline #165699 passed with stage
......@@ -23,5 +23,5 @@ imstk_find_libary(PhysX PhysXPvdSDK _static${physx_release_type}_64 _staticDEBUG
imstk_find_package(PhysX)
message(STATUS "PhysX include : ${PHYSX_INCLUDE_DIRS}")
message(STATUS "PhysX libraries : ${PHYSX_LIBRARIES}")
#message(STATUS "PhysX include : ${PHYSX_INCLUDE_DIRS}")
#message(STATUS "PhysX libraries : ${PHYSX_LIBRARIES}")
......@@ -6,24 +6,26 @@ imstk_find_header(imgui imgui.h imgui)
imstk_find_header_package(imgui)
#message(STATUS "imgui includes : ${IMGUI_INCLUDE_DIRS}")
#-----------------------------------------------------------------------------
# Find Source
# Since imgui has no CMake, code is pulled into an iMSTK component directly
#-----------------------------------------------------------------------------
find_path(IMGUI_SOURCE_DIR
NAMES
imgui.cpp
PATHS
${CMAKE_BINARY_DIR}/../External/imgui/src
NO_DEFAULT_PATH
)
mark_as_advanced(IMGUI_SOURCE_DIR)
#message(STATUS "imgui source : ${IMGUI_SOURCE_DIR}")
if(FIND_IMGUI_SOURCE)
#-----------------------------------------------------------------------------
# Find Source
# Since imgui has no CMake, code is pulled into an iMSTK component directly
#-----------------------------------------------------------------------------
find_path(IMGUI_SOURCE_DIR
NAMES
imgui.cpp
PATHS
${CMAKE_BINARY_DIR}/../External/imgui/src
NO_DEFAULT_PATH
)
mark_as_advanced(IMGUI_SOURCE_DIR)
#message(STATUS "imgui source : ${IMGUI_SOURCE_DIR}")
#-----------------------------------------------------------------------------
# Find package
#-----------------------------------------------------------------------------
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(imgui
REQUIRED_VARS
IMGUI_SOURCE_DIR)
#-----------------------------------------------------------------------------
# Find package
#-----------------------------------------------------------------------------
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(imgui
REQUIRED_VARS
IMGUI_SOURCE_DIR)
endif()
......@@ -32,7 +32,7 @@ macro(imstk_find_header package header)
else()
set(_SEARCH_DIR ${PACKAGE_PREFIX_DIR}/include/${sub_dir})
endif()
message(STATUS "Searching for : ${_SEARCH_DIR}/${header}")
#message(STATUS "Searching for : ${_SEARCH_DIR}/${header}")
find_path(${package}_INCLUDE_DIR
NAMES
......@@ -42,13 +42,13 @@ macro(imstk_find_header package header)
NO_DEFAULT_PATH
)
else()
message(STATUS "I am looking in system for ${package}")
#message(STATUS "I am looking in system for ${package}")
find_path(${package}_INCLUDE_DIR
NAMES
${header}
)
endif()
message(STATUS "Found it : ${${package}_INCLUDE_DIR}/${header}")
#message(STATUS "Found it : ${${package}_INCLUDE_DIR}/${header}")
if (EXISTS ${${package}_INCLUDE_DIR}/${header})
......@@ -58,7 +58,7 @@ macro(imstk_find_header package header)
else()
message(FATAL_ERROR "Could not find ${${package}_INCLUDE_DIR}/${header}")
endif()
message(STATUS "${package}_INCLUDE_DIRS : ${${package}_INCLUDE_DIRS}")
#message(STATUS "${package}_INCLUDE_DIRS : ${${package}_INCLUDE_DIRS}")
unset(${package}_INCLUDE_DIR CACHE)
endmacro()
......@@ -83,7 +83,7 @@ macro(imstk_find_libary package library)
string(STRIP ${release_postfix} release_postfix)
list(GET extra_macro_args 1 debug_postfix)
string(STRIP ${debug_postfix} debug_postfix)
message(STATUS "Looking for ${package} libraries ${library}${release_postfix} and ${library}${debug_postfix}")
#message(STATUS "Looking for ${package} libraries ${library}${release_postfix} and ${library}${debug_postfix}")
endif()
# Should I look in system locations?
......@@ -100,11 +100,10 @@ macro(imstk_find_libary package library)
if(${package}_LIB_DIR)
set(_SEARCH_DIR ${${package}_ROOT_DIR}/${${package}_LIB_DIR})
endif()
#message(STATUS "Looking for ${package} libs in ${_SEARCH_DIR}")
else()
set(_SEARCH_DIR ${PACKAGE_PREFIX_DIR}/lib)
endif()
#message(STATUS "Looking for ${package} libs in ${_SEARCH_DIR}")
unset(${PACKAGE}_LIBRARY_${library}-RELEASE CACHE)
string(TOUPPER ${package} PACKAGE)
......@@ -146,21 +145,23 @@ macro(imstk_find_libary package library)
endif()
#message(STATUS "Looking for Release Library : ${library}${release_postfix} in ${_SEARCH_DIR}")
if (EXISTS ${${PACKAGE}_LIBRARY_${library}-RELEASE})
#message(STATUS "${PACKAGE}_LIBRARY_${library}-RELEASE : ${${PACKAGE}_LIBRARY_${library}-RELEASE}")
list(APPEND ${PACKAGE}_LIBRARIES optimized ${${PACKAGE}_LIBRARY_${library}-RELEASE})
list(APPEND ${PACKAGE}_RELEASE_LIBRARIES ${${PACKAGE}_LIBRARY_${library}-RELEASE})
endif()
mark_as_advanced(${PACKAGE}_LIBRARY_${library}-RELEASE)
#message(STATUS "Libraries : ${${PACKAGE}_RELEASE_LIBRARIES}")
#message(STATUS "Release Libraries : ${${PACKAGE}_RELEASE_LIBRARIES}")
#message(STATUS "Looking for Debug Library : ${library}${debug_postfix} in ${_SEARCH_DIR}")
if (EXISTS ${${PACKAGE}_LIBRARY_${library}-DEBUG})
#message(STATUS "${PACKAGE}_LIBRARY_${library}-DEBUG : ${${PACKAGE}_LIBRARY_${library}-DEBUG}")
list(APPEND ${PACKAGE}_LIBRARIES debug ${${PACKAGE}_LIBRARY_${library}-DEBUG})
list(APPEND ${PACKAGE}_DEBUG_LIBRARIES ${${PACKAGE}_LIBRARY_${library}-DEBUG})
endif()
mark_as_advanced(${PACKAGE}_LIBRARY_${library}-DEBUG)
#message(STATUS "Libraries : ${${PACKAGE}_DEBUG_LIBRARIES}")
#message(STATUS "Debug Libraries : ${${PACKAGE}_DEBUG_LIBRARIES}")
endmacro()
#-----------------------------------------------------------------------------
......
......@@ -17,6 +17,7 @@ set(iMSTK_BUILD_TESTING @iMSTK_BUILD_TESTING@)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/modules")
include(${CMAKE_CURRENT_LIST_DIR}/modules/imstkFind)
include(CMakeFindDependencyMacro)
set(CMAKE_DEBUG_POSTFIX @CMAKE_DEBUG_POSTFIX@)
# Assimp
find_package( Assimp REQUIRED )
......@@ -56,7 +57,7 @@ find_package( Libusb REQUIRED)
if(iMSTK_ENABLE_VR)
add_definitions( -DiMSTK_ENABLE_VR )
find_package( openvr REQUIRED )
else()
endif()
# PhysX
find_package(PhysX REQUIRED)
......@@ -114,7 +115,7 @@ else()
RenderingCore
RenderingOpenGL2
RenderingVolume
RenderingVolumeOpenGL2
RenderingVolumeOpenGL2)
endif()
# glfw, gli
......
......@@ -201,6 +201,10 @@ find_package( g3log REQUIRED )
# glm
find_package( glm REQUIRED)
# imgui
# iMSTK actually includes and compiles imgui code
# As imgui does not have any cmake support
# So tell our find_package to also find the imgui source directory
set(FIND_IMGUI_SOURCE ON)
find_package( imgui REQUIRED )
# LibNiFalcon
find_package( LibNiFalcon REQUIRED)
......
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