1

I am trying to load a cmake project via the CLion IDE (which is a cracking piece of work by the way) but for some reason I cannot locate a certain directory, even though they're all located in /usr/local/.

The following error is returned

Error:The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: Simbody_INCLUDE_DIR used as include directory in directory /path/to/source

For reference I am trying to compile a simple example in the simbody physics library: https://github.com/simbody/simbody

Now for whatever reason, this must be an issue with CMake in CLion since I can generate the makefiles (using Unix Makefiles albeit on OS X) using the CMake standalone GUI.

The default cmake files from simbody can be found here: https://github.com/simbody/simbody/blob/master/cmake/SampleCMakeLists.txt

But in essence my CMakeLists.txt looks as such

# CMakeLists.txt for making a Simbody-using executable.
# This shows how to use the provided SimbodyConfig.cmake to locate a Simbody
# installation on your machine so you can use it from your own code.

cmake_minimum_required(VERSION 2.8)
project(projectx)

# Main source (and) header files
set(my_source_files projectx.cpp)

# This depends on SimbodyConfig.cmake being located somewhere predictable
# on your machine. If you have installed it somewhere that CMake won't be
# able to guess, you'll need to tell find_package where to look.
find_package(Simbody REQUIRED)

include_directories(${Simbody_INCLUDE_DIR})
link_directories(${Simbody_LIB_DIR})

add_executable(projectx ${my_source_files})
target_link_libraries(projectx ${Simbody_LIBRARIES})

Any suggestions would be greatly welcomed. You'll note that the comment about placing SimbodyConfig.cmake predictable has been heeded, since it can be found in /usr/local/ and again it works with the CMake GUI outside of CLion (version 3.3.0, CLion ships with Version 3.2.0).

1
  • Can you get the output from CLion's Cmake configure run? Or have a look into CmakeFiles/CMakeError.log to get some insights.
    – usr1234567
    Nov 5, 2015 at 5:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.