[Insight-users] VXL compiler errors when ITK is found by CMake

David Doria daviddoria at gmail.com
Thu May 3 18:16:36 EDT 2012


I have ITK built in ~/build/ITK, and VXL installed to ~/bin/share/vxl/cmake/.

Below is a demo project that only uses VUL (from VXL) that has a very
simple CMakeLists.txt. I have VXL_DIR and ITK_DIR set in the project
to match where they are installed. If I leave the ITK find_package
commented, it builds correctly. If I uncomment it, I get compiler
errors (/home/doriad/bin/include/vxl/core/vul/vul_file.h:120:46:
error: operator '&&' has no right operand).

Here is the CMakeLists.txt
----------------------------------

cmake_minimum_required(VERSION 2.6)

Project(VULBasics)

FIND_PACKAGE(VXL REQUIRED)
INCLUDE(${VXL_CMAKE_DIR}/UseVXL.cmake)

# FIND_PACKAGE(ITK REQUIRED)
# INCLUDE(${ITK_USE_FILE})

ADD_EXECUTABLE(VULBasics VULBasics.cpp)
TARGET_LINK_LIBRARIES(VULBasics vul)

And the VULBasics.cpp
-------------------------------

#include <vul/vul_file.h>

int main(int argc, char **argv)
{
  vul_file::exists("test");
  return 0;
}

You can see from the error that it is indeed using the vul_file.h from
the VXL install, so I don't understand why finding ITK with CMake
would break anything. Any ideas?

David


More information about the Insight-users mailing list