clandmark icon indicating copy to clipboard operation
clandmark copied to clipboard

CMake variables CLANDMARK_INCLUDE_DIRS and CLANDMARK_LIBRARIES not set

Open mrjogo opened this issue 9 years ago • 5 comments

I've installed CLandmark to my system (OS X 10.11.1; make install), but when I try to use the library with my CMake file, it fails because find_package(clandmark REQUIRED) doesn't set CLANDMARK_INCLUDE_DIRS or CLANDMARK_LIBRARIES (I based my CMake on the example from http://cmp.felk.cvut.cz/~uricamic/clandmark/#snippets_cmake_example, so I expect that won't work either).

mrjogo avatar Dec 22 '15 16:12 mrjogo

Hi @mrjogo,

just to avoid possible confusion, was the library successfully compiled?

uricamic avatar Dec 23 '15 09:12 uricamic

Yes, using default CMake options.

I could be missing a step to set up CMake after installing CLandmark using make install. Using this trivial CMakeLists.txt:

cmake_minimum_required(VERSION 2.8)
project(test_clandmark)

find_package(clandmark REQUIRED)

MESSAGE(STATUS "CLANDMARK_INCLUDE_DIRS: " ${CLANDMARK_INCLUDE_DIRS})
MESSAGE(STATUS "CLANDMARK_LIBRARIES: " ${CLANDMARK_LIBRARIES})

Creates the following output (you can see the variables aren't set):

$ cmake ..
-- The C compiler identification is AppleClang 5.1.0.5030040
-- The CXX compiler identification is AppleClang 5.1.0.5030040
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CLANDMARK_INCLUDE_DIRS: 
-- CLANDMARK_LIBRARIES: 
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ruddick/Desktop/test_clandmark/build

Thanks!

mrjogo avatar Dec 23 '15 17:12 mrjogo

And do you see clandmark_DIR and flandmark_DIR variables in CMake?

If anything fails, you can specify the include directories and libraries manually by adding the libclandmark/ folder to the includes and both clandmark and flandmark dynamic libraries...

uricamic avatar Dec 25 '15 17:12 uricamic

I output all the CMake variables from the above CMakeLists.txt, and here were the clandmark ones:

-- clandmark_CONFIG=/usr/local/lib/cmake/clandmark/clandmarkConfig.cmake
-- clandmark_CONSIDERED_CONFIGS=/usr/local/lib/cmake/clandmark/clandmarkConfig.cmake
-- clandmark_CONSIDERED_VERSIONS=1.5
-- clandmark_DIR=/usr/local/lib/cmake/clandmark
-- clandmark_FOUND=1
-- clandmark_VERSION=1.5
-- clandmark_VERSION_COUNT=2
-- clandmark_VERSION_MAJOR=1
-- clandmark_VERSION_MINOR=5
-- clandmark_VERSION_PATCH=0
-- clandmark_VERSION_TWEAK=0

Interestingly, when I add find_package(flandmark REQUIRED), I get the following error, despite flandmark also having been installed:

CMake Error at CMakeLists.txt:5 (find_package):
  By not providing "Findflandmark.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "flandmark", but CMake did not find one.

  Could not find a package configuration file provided by "flandmark" with
  any of the following names:

    flandmarkConfig.cmake
    flandmark-config.cmake

  Add the installation prefix of "flandmark" to CMAKE_PREFIX_PATH or set
  "flandmark_DIR" to a directory containing one of the above files.  If
  "flandmark" provides a separate development package or SDK, be sure it has
  been installed.

I can certainly work around this, but it seems that something's going wrong with the install (I'm afraid I'm not familiar enough with CMake or your library to diagnose what).

mrjogo avatar Dec 25 '15 20:12 mrjogo

Ok, thanks for the error messages, I will try to fix this.

uricamic avatar Dec 25 '15 22:12 uricamic