kinect/codes/Kinect2Sample-master/sample/Fusion/CMakeLists.txt

47 lines
1.5 KiB
CMake
Raw Normal View History

2024-03-07 09:11:31 +00:00
cmake_minimum_required( VERSION 3.6 )
# Create Project
project( Sample )
add_executable( Fusion app.h app.cpp main.cpp util.h KinectFusionHelper.h KinectFusionHelper.cpp )
# Set StartUp Project
set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "Fusion" )
# Find Package
set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ${CMAKE_MODULE_PATH} )
set( KinectSDK2_FUSION TRUE )
find_package( KinectSDK2 REQUIRED )
set( OpenCV_DIR "C:/Program Files/opencv/build" )
option( OpenCV_STATIC OFF )
find_package( OpenCV REQUIRED )
# Set Static Link Runtime Library
if( OpenCV_STATIC )
foreach( flag_var
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO )
if( ${flag_var} MATCHES "/MD" )
string( REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}" )
endif()
endforeach()
endif()
if( KinectSDK2_FOUND AND OpenCV_FOUND )
# Additional Include Directories
include_directories( ${KinectSDK2_INCLUDE_DIRS} )
include_directories( ${OpenCV_INCLUDE_DIRS} )
# Additional Library Directories
link_directories( ${KinectSDK2_LIBRARY_DIRS} )
link_directories( ${OpenCV_LIB_DIR} )
# Additional Dependencies
target_link_libraries( Fusion ${KinectSDK2_LIBRARIES} )
target_link_libraries( Fusion ${OpenCV_LIBS} )
# Post Build Event
add_custom_command( TARGET Fusion POST_BUILD ${KinectSDK2_COMMANDS} )
endif()