[CMake] CMake does not find an header file, and ignores the classes found in several other header files.

Toronto Andrew andrew.louis93 at gmail.com
Sun Aug 5 20:13:44 EDT 2012


Roike! I finally got it to run with a bit of manual linker error fixing!

I`ve one more question though: 

CMake Warning at CMakeLists.txt:51 (ADD_EXECUTABLE):
  Cannot generate a safe linker search path for target CppSampleQt01 because
  there is a cycle in the constraint graph:

    dir 0 is [-DEIGEN_USE_NEW_STDVECTOR]
    dir 1 is [-DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET]
    dir 2 is [-DBOOST_ALL_NO_LIB]
    dir 3 is [-DFLANN_STATIC]
    dir 4 is [ /arch:SSE2]
    dir 5 is [C:/Qt/lib]
      dir 13 must precede it due to link library [QtOpenGL4.lib]
    dir 6 is [C:/Program Files (x86)/PCL 1.6.0/3rdParty/Boost/lib]
    dir 7 is [C:/Program Files (x86)/PCL 1.6.0/lib]
    dir 8 is [C:/Program Files (x86)/OpenNI/Lib]
    dir 9 is [C:/Program Files (x86)/PCL 1.6.0/3rdParty/VTK/lib/vtk-5.8]
    dir 10 is [C:/Program Files (x86)/PCL 1.6.0/3rdParty/FLANN/lib]
    dir 11 is [C:/Program Files (x86)/PCL 1.6.0/3rdParty/Qhull/lib]
    dir 12 is [C:/SimplonSample2/lib]
    dir 13 is [C:/Qt/4.8.0/lib]
      dir 5 must precede it due to link library [QtGui4.lib]

  Some of these libraries may not be found correctly.


CMake Warning at CMakeLists.txt:51 (ADD_EXECUTABLE):
  Cannot generate a safe linker search path for target CppSampleQt01 because
  there is a cycle in the constraint graph:

    dir 0 is [-DEIGEN_USE_NEW_STDVECTOR]
    dir 1 is [-DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET]
    dir 2 is [-DBOOST_ALL_NO_LIB]
    dir 3 is [-DFLANN_STATIC]
    dir 4 is [ /arch:SSE2]
    dir 5 is [C:/Qt/lib]
      dir 13 must precede it due to link library [QtOpenGLd4.lib]
    dir 6 is [C:/Program Files (x86)/PCL 1.6.0/3rdParty/Boost/lib]
    dir 7 is [C:/Program Files (x86)/PCL 1.6.0/lib]
    dir 8 is [C:/Program Files (x86)/OpenNI/Lib]
    dir 9 is [C:/Program Files (x86)/PCL 1.6.0/3rdParty/VTK/lib/vtk-5.8]
    dir 10 is [C:/Program Files (x86)/PCL 1.6.0/3rdParty/FLANN/lib]
    dir 11 is [C:/Program Files (x86)/PCL 1.6.0/3rdParty/Qhull/lib]
    dir 12 is [C:/SimplonSample2/lib]
    dir 13 is [C:/Qt/4.8.0/lib]
      dir 5 must precede it due to link library [QtGui4.lib]

  Some of these libraries may not be found correctly.


CMake Warning at CMakeLists.txt:51 (ADD_EXECUTABLE):
  Cannot generate a safe linker search path for target CppSampleQt01 because
  there is a cycle in the constraint graph:

    dir 0 is [-DEIGEN_USE_NEW_STDVECTOR]
    dir 1 is [-DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET]
    dir 2 is [-DBOOST_ALL_NO_LIB]
    dir 3 is [-DFLANN_STATIC]
    dir 4 is [ /arch:SSE2]
    dir 5 is [C:/Qt/lib]
      dir 13 must precede it due to link library [QtOpenGLd4.lib]
    dir 6 is [C:/Program Files (x86)/PCL 1.6.0/3rdParty/Boost/lib]
    dir 7 is [C:/Program Files (x86)/PCL 1.6.0/lib]
    dir 8 is [C:/Program Files (x86)/OpenNI/Lib]
    dir 9 is [C:/Program Files (x86)/PCL 1.6.0/3rdParty/VTK/lib/vtk-5.8]
    dir 10 is [C:/Program Files (x86)/PCL 1.6.0/3rdParty/FLANN/lib]
    dir 11 is [C:/Program Files (x86)/PCL 1.6.0/3rdParty/Qhull/lib]
    dir 12 is [C:/SimplonSample2/lib]
    dir 13 is [C:/Qt/4.8.0/lib]
      dir 5 must precede it due to link library [QtGui4.lib]

This stuff pops up when I try to include VTK and PCL as well, and I`m not
sure how to deal, any thoughts?

PROJECT(CppSampleQt01)

FIND_PACKAGE(PCL 1.3 REQUIRED)
FIND_PACKAGE(Qt4 REQUIRED)

FIND_LIBRARY(SIMPLONLIB lv.simplon lib)
FIND_LIBRARY(SIMPLONIMGPROC lv.simplon.imgproc lib)

SET(CppSampleQt01_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/include/lv.simplon.class.cpp camera.cpp main.cpp
mainwindow.cpp osdep.cpp paint.cpp)
SET(CppSampleQt01_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/include/lv.simplon.class.h camera.h mainwindow.h
osdep.h paint.h)
SET(CppSampleQt01_RESOURCES icons.qrc)

SET(QExtSerialPort_HEADERS QExtSerialPort/src/qextwineventnotifier_p.h 
						QExtSerialPort/src/qextserialport_p.h 
						QExtSerialPort/src/qextserialport_global.h 
						QExtSerialPort/src/qextserialport.h 
						QExtSerialPort/src/qextserialenumerator_p.h 
						QExtSerialPort/src/qextserialenumerator.h)
SET(QExtSerialPort_SOURCES QExtSerialPort/src/qextserialenumerator.cpp
					QExtSerialPort/src/qextserialport.cpp
					QExtSerialPort/src/qextwineventnotifier_p.cpp)
					
if (WIN32)
	#Check syntax for this. QExt... may need to be wrapped in parentheses. 
	LIST(APPEND QExtSerialPort_SOURCES
QExtSerialPort/src/qextserialport_win.cpp) 
	#SET(QExtSerialPort_SOURCES ${QExtSerialPort_SOURCES}
QExtSerialPort/src/qextserialport_win.cpp)
	#  add_definitions(-DWINVER=0x0501) # needed for mingw (dbt business??
	LINK_LIBRARIES(${QT_QTGUI_LIBRARY} setupapi advapi32 user32)
endif(WIN32)

if (UNIX)
	LIST(APPEND QExtSerialPort_SOURCES
QExtSerialPort/src/qextserialport_unix.cpp)
endif (UNIX)

if (OSX)
	LINK_LIBRARIES(framework IOKit)
	LIST(APPEND QExtSerialPort_SOURCES
QExtSerialPort/src/qextserialport_osx.cpp)
endif (OSX)

QT4_WRAP_CPP(CppSampleQt01_HEADERS_MOC ${CppSampleQt01_HEADERS}
${QExtSerialPort_HEADERS})
	
FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})

INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${PCL_DEFINITIONS} ${QT_DEFINITIONS})

LINK_DIRECTORIES(${PCL_DEFINITIONS})

INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include QExtSerialPort/src )
ADD_EXECUTABLE(CppSampleQt01 ${CppSampleQt01_SOURCES}
				${QExtSerialPort_SOURCES}
				${CppSampleQt01_HEADERS_MOC}
				${CppSampleQt01_RESOURCES_RCC})

TARGET_LINK_LIBRARIES(CppSampleQt01 ${PCL_LIBRARIES} ${SIMPLONLIB}
${SIMPLONIMGPROC} QVTK)

PS: I owe you a beer whenever you are in Toronto! I really appreciate all
the helpful info!



--
View this message in context: http://cmake.3232098.n2.nabble.com/CMake-does-not-find-an-header-file-and-ignores-the-classes-found-in-several-other-header-files-tp7581066p7581079.html
Sent from the CMake mailing list archive at Nabble.com.


More information about the CMake mailing list