Visual c++ CMake在配置期间不导入所有ITK库
我正在做一个项目,在ITK中使用。我使用CMake来自动化构建过程,但似乎CMake在配置/生成步骤中遗漏了某些ITK库。我目前正在使用ITK库中的其他标题,没有任何问题。项目的CMake中没有配置错误消息 我的项目的CMakeLists.txt文件:Visual c++ CMake在配置期间不导入所有ITK库,visual-c++,cmake,itk,Visual C++,Cmake,Itk,我正在做一个项目,在ITK中使用。我使用CMake来自动化构建过程,但似乎CMake在配置/生成步骤中遗漏了某些ITK库。我目前正在使用ITK库中的其他标题,没有任何问题。项目的CMake中没有配置错误消息 我的项目的CMakeLists.txt文件: #PROJECT(REGISTRATION) # # List of source files CMAKE_MINIMUM_REQUIRED(VERSION 2.8) # Top of file: the name of the program
#PROJECT(REGISTRATION)
#
# List of source files
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
# Top of file: the name of the program
PROJECT(MultiObjModelToUSReg)
INCLUDE_REGULAR_EXPRESSION("^.*$")
FIND_PACKAGE( ITK REQUIRED)
IF( ITK_FOUND )
INCLUDE( ${USE_ITK_FILE} )
ENDIF( ITK_FOUND )
# Directories to search for #include (add more if needed)
# (ITK is already included through the use of INCLUDE(${ITK_USE_FILE})
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
src
)
# Name of the executable
#SET(MultiObjModelToUSReg MultiObjModelToUSReg_EXE)
# All source files (only .cxx, not .h or .txx)
SET(MultiObjModelToUSReg_SRCS
src/Utilities.cpp
src/MultiObjModel.cpp
src/USVolume.cpp
src/Registration.cpp
src/BoneProbabilityMap.cpp
#src/MultiObjModelToUSRegistration.cpp
#src/USRegistrationDialog.cpp
#src/MainPanel.cpp
#src/ModelRegistration.cxx
)
#only .h files that use QT_ macros!
#SET(MultiObjModelToUSReg_HEADERS
#src/USRegistrationDialog.h
#src/MainPanel.h
#src/ModelRegistration.h)
#SET(MultiObjModelToUSReg_FORMS
##ui/USRegistrationDialog.ui
##ui/MainPanel.ui
#ui/ModelRegistration.ui)
#SET(MultiObjModelToUSReg_RESOURCES)
# These two lines will compile and link your executable
#ADD_EXECUTABLE(MultiObjModelToUSReg
#${MultiObjModelToUSReg_EXE}
#${MultiObjModelToUSReg_SRCS}
#${MultiObjModelToUSReg_HEADERS_MOC}
#${MultiObjModelToUSReg_FORMS_HEADERS}
#${MultiObjModelToUSReg_RESOURCES_RCC}
#)
ADD_LIBRARY(MultiObjModelToUSReg STATIC ${MultiObjModelToUSReg_SRCS})
TARGET_LINK_LIBRARIES(MultiObjModelToUSReg ${ITK_LIBRARIES} )
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
ENABLE_TESTING()
INCLUDE(CTEST)
IF (BUILD_TESTING)
ADD_SUBDIRECTORY (Test)
ENDIF (BUILD_TESTING)
CMake的无错误输出:
Check for working C compiler using: Visual Studio 9 2008
Check for working C compiler using: Visual Studio 9 2008 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 9 2008
Check for working CXX compiler using: Visual Studio 9 2008 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Configuring done
Generating done
<>但是,当我在Visual C++ 2008中编译:
1>------ Build started: Project: MultiObjModelToUSReg, Configuration: Debug Win32 ------
1>Compiling...
1>BoneProbabilityMap.cpp
1>..\src\BoneProbabilityMap.cpp(8) : fatal error C1083: Cannot open include file: 'itkDiscreteGaussianImageFilter.h': No such file or directory
1>Build log was saved at "file://c:\MultiObjModelToUSReg\bin\MultiObjModelToUSReg.dir\Debug\BuildLog.htm"
1>MultiObjModelToUSReg - 1 error(s), 0 warning(s)
2>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug Win32 ------
2>Project not selected to build for this solution configuration
========== Build: 0 succeeded, 1 failed, 12 up-to-date, 1 skipped ==========
虽然有一个变通方法可以手动将其添加到项目的配置中,但我需要与其他人协作,以便使构建过程自动化
任何帮助都将不胜感激!(我是Stackoverflow的新手,如果我有什么不清楚的地方,请告诉我)。您需要使用ITK\u build\u ALL\u MODULES=ON构建ITK。您在这里解决了以前的问题吗?@RogerRowland不,我无法解决它。我认为这个问题更为核心,因为它不起作用。你是用ITK_build_ALL_MODULES=ON构建ITK的吗?@DavidDoria谢谢!我的硬盘没有足够的空间,所以第一次我不得不省略它。我回去检查了我需要的所有模块(即过滤),到目前为止,它对我很有效。再次感谢你的建议!伟大的请接受下面的答案,这样问题就不再显示为没有答案。