Commit 4156598a authored by Aaron Bray's avatar Aaron Bray
Browse files

Initial CMake Improvements

Issues: dbghelp, system use, vulkan, openvr
parent 744321ae
set( CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_MODULE_PATH} )
include(ExternalProject)
include(imstkSolveDependencies)
......@@ -9,54 +8,16 @@ if(NOT GIT_EXECUTABLE)
find_package(Git REQUIRED)
endif()
#-----------------------------------------------------------------------------
# Output Directories
#-----------------------------------------------------------------------------
if(NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${${PROJECT_NAME}_LIB_DIR})
endif()
if(NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${${PROJECT_NAME}_LIB_DIR})
endif()
if(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${${PROJECT_NAME}_BIN_DIR})
endif()
mark_as_superbuild(
VARS
CMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH
CMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH
CMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH
ALL_PROJECTS
)
#-----------------------------------------------------------------------------
# Search Directories
#-----------------------------------------------------------------------------
list(APPEND CMAKE_LIBRARY_PATH
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}
${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}
)
list(APPEND CMAKE_PROGRAM_PATH
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}
)
list(APPEND CMAKE_INCLUDE_PATH "") # Populated in each External_*.cmake
mark_as_superbuild(
VARS
CMAKE_LIBRARY_PATH
CMAKE_PROGRAM_PATH
CMAKE_INCLUDE_PATH
ALL_PROJECTS
)
#-----------------------------------------------------------------------------
# CMake global args
#-----------------------------------------------------------------------------
mark_as_superbuild(
VARS
CMAKE_BUILD_TYPE
CMAKE_DEBUG_POSTFIX
CMAKE_INSTALL_PREFIX
CMAKE_MODULE_PATH
CMAKE_PREFIX_PATH
CMAKE_C_COMPILER
CMAKE_CXX_COMPILER
CMAKE_C_FLAGS
......
......@@ -5,7 +5,6 @@ include(imstkAddExternalProject)
imstk_add_external_project( Assimp
GIT_REPOSITORY https://gitlab.kitware.com/iMSTK/assimp.git
GIT_TAG ce3d6a91d2e0e945493c0fdeb162b50c9034e5f9
INSTALL_COMMAND ${SKIP_STEP_COMMAND}
CMAKE_CACHE_ARGS
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
-DASSIMP_BUILD_ASSIMP_TOOLS:BOOL=OFF
......
......@@ -5,9 +5,6 @@ include(imstkAddExternalProject)
imstk_add_external_project( Eigen
GIT_REPOSITORY https://github.com/eigenteam/eigen-git-mirror.git
GIT_TAG 3.3.3
CONFIGURE_COMMAND ${SKIP_STEP_COMMAND}
BUILD_COMMAND ${SKIP_STEP_COMMAND}
INSTALL_COMMAND ${SKIP_STEP_COMMAND}
RELATIVE_INCLUDE_PATH ""
DEPENDENCIES ""
#VERBOSE
......
......@@ -16,18 +16,17 @@ set(FTD2XX_EXTRACT_DIR ${FTD2XX_PREFIX}/ftd2xx-2.12.18)
set(ftd2xx_libdir "i386")
if(${CMAKE_GENERATOR} MATCHES "Win64")
set(ftd2xx_libdir "amd64")
set(ftd2xx_dll_suffix "64")
endif()
set(copy_ftd2xx_dll_command
set(copy_ftd2xx_headers_command
${CMAKE_COMMAND} -E copy
${FTD2XX_EXTRACT_DIR}/${ftd2xx_libdir}/ftd2xx${ftd2xx_dll_suffix}.dll
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/ftd2xx.dll
${FTD2XX_EXTRACT_DIR}/ftd2xx.h
${CMAKE_INSTALL_PREFIX}/include/ftd2xx.h
)
set(copy_ftd2xx_lib_command
${CMAKE_COMMAND} -E copy
${FTD2XX_EXTRACT_DIR}/${ftd2xx_libdir}/ftd2xx.lib
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/ftd2xx.lib
${CMAKE_INSTALL_PREFIX}/lib/ftd2xx.lib
)
#-----------------------------------------------------------------------------
......@@ -44,8 +43,8 @@ imstk_add_external_project( FTD2XX
CONFIGURE_COMMAND ${SKIP_STEP_COMMAND}
BUILD_COMMAND ${SKIP_STEP_COMMAND}
INSTALL_COMMAND
${copy_ftd2xx_lib_command}
COMMAND ${copy_ftd2xx_dll_command}
COMMAND ${copy_ftd2xx_headers_command}
COMMAND ${copy_ftd2xx_lib_command}
RELATIVE_INCLUDE_PATH "/"
#VERBOSE
)
......@@ -5,7 +5,6 @@ include(imstkAddExternalProject)
imstk_add_external_project( GoogleTest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG dc043e1ca6bd509a92452ed54e817b6979869372
INSTALL_COMMAND ${SKIP_STEP_COMMAND}
CMAKE_CACHE_ARGS
-DBUILD_GMOCK:BOOL=ON
-DBUILD_GTEST:BOOL=ON
......
......@@ -10,7 +10,6 @@ include(imstkAddExternalProject)
imstk_add_external_project( LibNiFalcon
GIT_REPOSITORY https://gitlab.kitware.com/iMSTK/libnifalcon.git
GIT_TAG 47586d4e21c987fb9e3ce822bf707c53e8fc4e52
INSTALL_COMMAND ${SKIP_STEP_COMMAND}
CMAKE_CACHE_ARGS
-DBUILD_TESTING:BOOL=OFF
-DBUILD_EXAMPLES:BOOL=OFF
......
......@@ -14,28 +14,19 @@ set(Libusb_EXTRACT_DIR ${Libusb_PREFIX}/libusb-1.0.20)
# Set install commands
#-----------------------------------------------------------------------------
set(libusb_libdir "MS32")
set(libusb_exedir "bin32")
if(${CMAKE_GENERATOR} MATCHES "Win64")
set(libusb_libdir "MS64")
set(libusb_exedir "bin64")
endif()
set(copy_libusb_lib_command
${CMAKE_COMMAND} -E copy
${Libusb_EXTRACT_DIR}/${libusb_libdir}/dll/libusb-1.0.lib
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/libusb-1.0.lib
set(copy_libusb_headers_command
${CMAKE_COMMAND} -E copy_directory
${Libusb_EXTRACT_DIR}/include
${CMAKE_INSTALL_PREFIX}/include
)
set(copy_libusb_dll_command
${CMAKE_COMMAND} -E copy
${Libusb_EXTRACT_DIR}/${libusb_libdir}/dll/libusb-1.0.dll
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/libusb-1.0.dll
)
set(copy_libusb_pdb_command
set(copy_libusb_lib_command
${CMAKE_COMMAND} -E copy
${Libusb_EXTRACT_DIR}/${libusb_libdir}/dll/libusb-1.0.pdb
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/libusb-1.0.pdb
${Libusb_EXTRACT_DIR}/${libusb_libdir}/static/libusb-1.0.lib
${CMAKE_INSTALL_PREFIX}/lib/libusb-1.0.lib
)
#-----------------------------------------------------------------------------
......@@ -52,9 +43,8 @@ imstk_add_external_project( Libusb
CONFIGURE_COMMAND ${SKIP_STEP_COMMAND}
BUILD_COMMAND ${SKIP_STEP_COMMAND}
INSTALL_COMMAND
${copy_libusb_lib_command}
COMMAND ${copy_libusb_dll_command}
COMMAND ${copy_libusb_pdb_command}
COMMAND ${copy_libusb_headers_command}
COMMAND ${copy_libusb_lib_command}
RELATIVE_INCLUDE_PATH "include/libusb-1.0"
#VERBOSE
)
......@@ -7,7 +7,6 @@ imstk_add_external_project( PThreads
GIT_TAG 26bdc33be9786a9ffbfcec806c857ea208c37201
CMAKE_CACHE_ARGS
-DBUILD_TESTING:BOOL=OFF
INSTALL_COMMAND ${SKIP_STEP_COMMAND}
RELATIVE_INCLUDE_PATH "include"
DEPENDENCIES ""
#VERBOSE
......
......@@ -2,13 +2,33 @@
# Add External Project
#-----------------------------------------------------------------------------
include(imstkAddExternalProject)
imstk_define_external_dirs( SCCD )
if(MSVC)
set(config_dir "$(Configuration)")
endif()
set(copy_sccd_headers_command
${CMAKE_COMMAND} -E copy_directory
${SCCD_SOURCE_DIR}/inc
${CMAKE_INSTALL_PREFIX}/include
)
set(copy_sccd_lib_command
${CMAKE_COMMAND} -E copy
${SCCD_BINARY_DIR}/src/${config_dir}/sccd$<$<CONFIG:Debug>:d>.lib
${CMAKE_INSTALL_PREFIX}/lib
)
imstk_add_external_project( SCCD
GIT_REPOSITORY https://gitlab.kitware.com/iMSTK/SCCD.git
GIT_TAG 760854d53f4db6fd1d1a073aabd2d3ecb32506b5
INSTALL_COMMAND ${SKIP_STEP_COMMAND}
CMAKE_CACHE_ARGS
-DBUILD_SAMPLE_APP:BOOL=OFF
RELATIVE_INCLUDE_PATH "inc"
INSTALL_COMMAND
COMMAND ${copy_sccd_headers_command}
COMMAND ${copy_sccd_lib_command}
DEPENDENCIES
Eigen
#VERBOSE
......
......@@ -5,7 +5,6 @@ include(imstkAddExternalProject)
imstk_add_external_project( SFML
GIT_REPOSITORY https://github.com/SFML/SFML.git
GIT_TAG 2.4.2
INSTALL_COMMAND ${SKIP_STEP_COMMAND}
CMAKE_CACHE_ARGS
-DSFML_BUILD_AUDIO:BOOL=ON
-DSFML_BUILD_GRAPHICS:BOOL=OFF
......
......@@ -6,7 +6,6 @@ include(imstkAddExternalProject)
imstk_add_external_project( Uncrustify
GIT_REPOSITORY https://github.com/uncrustify/uncrustify.git
GIT_TAG uncrustify-0.64
INSTALL_COMMAND ${SKIP_STEP_COMMAND}
CMAKE_CACHE_ARGS
RELATIVE_INCLUDE_PATH ""
DEPENDENCIES ""
......
......@@ -4,6 +4,7 @@
set(VRPN_DEPENDENCIES "LibNiFalcon")
if(WIN32)
list(APPEND VRPN_DEPENDENCIES "Libusb")
list(APPEND VRPN_DEPENDENCIES "FTD2XX")
endif(WIN32)
#-----------------------------------------------------------------------------
......@@ -32,14 +33,13 @@ include(imstkAddExternalProject)
imstk_add_external_project( VRPN
GIT_REPOSITORY https://gitlab.kitware.com/iMSTK/vrpn.git
GIT_TAG ae5672fc163d9753ac9fa559b5c862ed9e32e6ff
INSTALL_COMMAND ${SKIP_STEP_COMMAND}
CMAKE_CACHE_ARGS
-DBUILD_TESTING:BOOL=OFF
-DVRPN_SUBPROJECT_BUILD:BOOL=ON
-DVRPN_BUILD_CLIENTS:BOOL=OFF
-DVRPN_BUILD_CLIENT_LIBRARY:BOOL=ON
-DVRPN_BUILD_SERVER_LIBRARY:BOOL=ON
-DVRPN_INSTALL:BOOL=OFF
-DVRPN_INSTALL:BOOL=ON
-DVRPN_BUILD_PYTHON:BOOL=OFF
-DVRPN_USE_GPM_MOUSE:BOOL=OFF
-DVRPN_USE_LIBUSB_1_0:BOOL=ON
......
......@@ -12,8 +12,7 @@ endif(${${PROJECT_NAME}_ENABLE_VR})
include(imstkAddExternalProject)
imstk_add_external_project( VTK
GIT_REPOSITORY https://gitlab.kitware.com/vtk/vtk.git
GIT_TAG v8.2.0
INSTALL_COMMAND ${SKIP_STEP_COMMAND}
GIT_TAG master
CMAKE_ARGS
-DBUILD_EXAMPLES:BOOL=OFF
-DBUILD_TESTING:BOOL=OFF
......@@ -34,6 +33,7 @@ imstk_add_external_project( VTK
-DVTK_WRAP_PYTHON:BOOL=OFF
-DVTK_OPENVR_OBJECT_FACTORY:BOOL=OFF
-DVTK_LEGACY_REMOVE:BOOL=ON
-DVTK_BUILD_TESTING:STRING=OFF
DEPENDENCIES ${VTK_DEPENDENCIES}
RELATIVE_INCLUDE_PATH ""
#VERBOSE
......
......@@ -10,7 +10,6 @@ include(imstkAddExternalProject)
imstk_add_external_project( VegaFEM
GIT_REPOSITORY https://gitlab.kitware.com/iMSTK/VegaFEM-CMake.git
GIT_TAG 7bc1bda6a873e2cf4486f9ec3fe6b7b90da76941
INSTALL_COMMAND ${SKIP_STEP_COMMAND}
CMAKE_CACHE_ARGS
-DVegaFEM_ENABLE_PTHREADS_SUPPORT:BOOL=ON
-DVegaFEM_ENABLE_OpenGL_SUPPORT:BOOL=OFF
......
#-----------------------------------------------------------------------------
# Add External Project
#-----------------------------------------------------------------------------
if(MSVC)
set(config_dir "$(Configuration)")
endif()
include(imstkAddExternalProject)
imstk_define_external_dirs( g3log )
imstk_add_external_project( g3log
GIT_REPOSITORY https://gitlab.kitware.com/iMSTK/g3log.git
GIT_TAG 6c1698c4f7db6b9e4246ead38051f9866ea3ac06
CMAKE_CACHE_ARGS
-DADD_FATAL_EXAMPLE:BOOL=OFF
INSTALL_COMMAND ${SKIP_STEP_COMMAND}
INSTALL_COMMAND
COMMAND ${CMAKE_COMMAND} -E copy_directory ${g3log_SOURCE_DIR}/src/g3log ${CMAKE_INSTALL_PREFIX}/include/g3log
COMMAND ${CMAKE_COMMAND} -E copy ${g3log_BINARY_DIR}/${config_dir}/g3logger$<$<CONFIG:Debug>:d>.lib ${CMAKE_INSTALL_PREFIX}/lib/
RELATIVE_INCLUDE_PATH "src"
DEPENDENCIES ""
#VERBOSE
......
......@@ -5,7 +5,6 @@ include(imstkAddExternalProject)
imstk_add_external_project( glfw
GIT_REPOSITORY https://github.com/glfw/glfw.git
GIT_TAG 3.2.1
INSTALL_COMMAND ${SKIP_STEP_COMMAND}
RELATIVE_INCLUDE_PATH ""
DEPENDENCIES ""
#VERBOSE
......
......@@ -5,7 +5,6 @@ include(imstkAddExternalProject)
imstk_add_external_project( gli
GIT_REPOSITORY https://gitlab.kitware.com/iMSTK/gli.git
GIT_TAG 0.8.2
INSTALL_COMMAND ${SKIP_STEP_COMMAND}
RELATIVE_INCLUDE_PATH ""
DEPENDENCIES ""
#VERBOSE
......
......@@ -5,7 +5,6 @@ include(imstkAddExternalProject)
imstk_add_external_project( glm
GIT_REPOSITORY https://gitlab.kitware.com/iMSTK/glm.git
GIT_TAG 0.9.8.3
INSTALL_COMMAND ${SKIP_STEP_COMMAND}
RELATIVE_INCLUDE_PATH ""
DEPENDENCIES ""
#VERBOSE
......
......@@ -2,12 +2,32 @@
# Add External Project
#-----------------------------------------------------------------------------
include(imstkAddExternalProject)
imstk_define_external_dirs( imgui )
# Gather up headers for install
set(imgui_H_FILES ${imgui_SOURCE_DIR}/imconfig.h
${imgui_SOURCE_DIR}/imgui.h
${imgui_SOURCE_DIR}/imstb_rectpack.h
${imgui_SOURCE_DIR}/imstb_textedit.h
${imgui_SOURCE_DIR}/imstb_truetype.h
)
set(make_imgui_dir_command
${CMAKE_COMMAND} -E make_directory
${CMAKE_INSTALL_PREFIX}/include/imgui/
)
set(copy_imgui_headers_command
${CMAKE_COMMAND} -E copy
${imgui_H_FILES}
${CMAKE_INSTALL_PREFIX}/include/imgui/
)
imstk_add_external_project( imgui
GIT_REPOSITORY https://gitlab.kitware.com/iMSTK/imgui.git
GIT_TAG v1.65
CONFIGURE_COMMAND ${SKIP_STEP_COMMAND}
BUILD_COMMAND ${SKIP_STEP_COMMAND}
INSTALL_COMMAND ${SKIP_STEP_COMMAND}
INSTALL_COMMAND
COMMAND ${make_imgui_dir_command}
COMMAND ${copy_imgui_headers_command}
RELATIVE_INCLUDE_PATH ""
DEPENDENCIES ""
#VERBOSE
......
if(NOT WIN32)
message(WARNING "System not supported. For nownly Windows is supported for External_OPENVR.cmake.")
return()
endif()
set(_version "1.0.9")
#-----------------------------------------------------------------------------
# Set project prefix path
#-----------------------------------------------------------------------------
......@@ -36,15 +30,20 @@ elseif(UNIX)
set(openvr_dllname "libopenvr_api.so")
endif()
set(copy_openvr_headers_command
${CMAKE_COMMAND} -E copy_directory
${OPENVR_EXTRACT_DIR}/headers
${CMAKE_INSTALL_PREFIX}/include
)
set(copy_openvr_dll_command
${CMAKE_COMMAND} -E copy
${openvr_dlldir}/${openvr_dllname}
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${openvr_dllname}
${CMAKE_INSTALL_PREFIX}/bin/${openvr_dllname}
)
set(copy_openvr_lib_command
${CMAKE_COMMAND} -E copy
${openvr_libdir}/${openvr_libname}
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${openvr_libname}
${CMAKE_INSTALL_PREFIX}/lib/${openvr_libname}
)
#-----------------------------------------------------------------------------
......@@ -61,7 +60,8 @@ imstk_add_external_project( openvr
CONFIGURE_COMMAND ${SKIP_STEP_COMMAND}
BUILD_COMMAND ${SKIP_STEP_COMMAND}
INSTALL_COMMAND
${copy_openvr_lib_command}
COMMAND ${copy_openvr_headers_command}
COMMAND ${copy_openvr_lib_command}
COMMAND ${copy_openvr_dll_command}
RELATIVE_INCLUDE_PATH "headers"
#VERBOSE
......
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