{"action":"created","issue":{"url":"https://api.github.com/repos/simbody/simbody/issues/424","labels_url":"https://api.github.com/repos/simbody/simbody/issues/424/labels{/name}","comments_url":"https://api.github.com/repos/simbody/simbody/issues/424/comments","events_url":"https://api.github.com/repos/simbody/simbody/issues/424/events","html_url":"https://github.com/simbody/simbody/issues/424","id":100182690,"number":424,"title":"Trouble building with cmake (native and via IDE) in OS X Yosemite (10.10.4)","user":{"login":"ndhir","id":5817673,"avatar_url":"https://avatars.githubusercontent.com/u/5817673?v=3","gravatar_id":"","url":"https://api.github.com/users/ndhir","html_url":"https://github.com/ndhir","followers_url":"https://api.github.com/users/ndhir/followers","following_url":"https://api.github.com/users/ndhir/following{/other_user}","gists_url":"https://api.github.com/users/ndhir/gists{/gist_id}","starred_url":"https://api.github.com/users/ndhir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndhir/subscriptions","organizations_url":"https://api.github.com/users/ndhir/orgs","repos_url":"https://api.github.com/users/ndhir/repos","events_url":"https://api.github.com/users/ndhir/events{/privacy}","received_events_url":"https://api.github.com/users/ndhir/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-08-10T22:26:40Z","updated_at":"2015-08-12T19:18:19Z","closed_at":"2015-08-12T18:58:31Z","body":"Greetings, \r\n\r\nI've been experimenting a bit with the install options now available with simbody. I ended up trying with the install version via `brew install simbody`. Running that alone should, if my understanding is correct, take care of the full installation process.\r\n\r\nI tried running the basic pendulum example \r\n\r\n```cpp\r\n// Simulate and visualise a 2-link chain:\r\n#include \"Simbody.h\"\r\n\r\nusing namespace SimTK;\r\nusing std::cout; using std::endl;\r\n\r\nclass PositionReporter : public PeriodicEventReporter {\r\npublic:\r\n    PositionReporter(const MultibodySystem& system, const MobilizedBody& body, Real interval) :\r\n        PeriodicEventReporter(interval), system(system), body(body) {\r\n    }\r\n\r\n    // Show x-y position of the pendulum weight as a function of time.\r\n    void handleEvent(const State& state) const {\r\n        system.realize(state, Stage::Position);\r\n        Vec3 pos = body.getBodyOriginLocation(state);\r\n        std::cout<<state.getTime()<<\"\\t\"<<pos[0]<<\"\\t\"<<pos[1]<<std::endl;\r\n    }\r\nprivate:\r\n    const MultibodySystem& system;\r\n    const MobilizedBody& body;\r\n};\r\n\r\nint main() {\r\ntry{// If anything goes wrong, an exception will be thrown.\r\n\r\n    // Define the system.\r\n    MultibodySystem system;\r\n    SimbodyMatterSubsystem matter(system);\r\n    GeneralForceSubsystem forces(system);\r\n    Force::Gravity gravity(forces, matter, -YAxis, 9.8);\r\n\r\n    // Describe mass and visualization properties for a generic body.\r\n    Body::Rigid bodyInfo(MassProperties(1.0, Vec3(0), UnitInertia(1)));\r\n    bodyInfo.addDecoration(Transform(), DecorativeSphere(0.1));\r\n\r\n    // Create the moving (mobilized) bodies of the pendulum.\r\n    MobilizedBody::Pin pendulum1(\r\n        matter.Ground(), \r\n        Transform(Vec3(0)),\r\n        bodyInfo,\r\n        Transform(Vec3(0, 1.0, 0)));\r\n\r\n    // MobilizedBody::Pin pendulum2(\r\n    //     pendulum1, \r\n    //     Transform(Vec3(0)),\r\n    //     bodyInfo, \r\n    //     Transform(Vec3(0, 0.5, 0)));\r\n\r\n    // Set up visualization.\r\n    Visualizer viz(system);\r\n    system.addEventReporter(new Visualizer::Reporter(viz, 0.01));\r\n\r\n    // Add event reporter\r\n    system.addEventReporter(new PositionReporter(system, pendulum1, 0.5));\r\n\r\n    // Initialize the system and state.\r\n    State state = system.realizeTopology();\r\n    pendulum1.setRate(state, 1.5); // The initial angular velocity of pendulum: ms^-1\r\n\r\n    // Simulate for n seconds.\r\n    RungeKuttaMersonIntegrator integ(system);\r\n    TimeStepper ts(system, integ);\r\n    ts.initialize(state);\r\n    ts.stepTo(50.0);\r\n} \r\ncatch (const std::exception& e) {\r\n    std::cout << \"ERROR: \" << e.what() << std::endl;\r\n    return 1;\r\n} \r\ncatch (...) {\r\n    std::cout << \"UNKNOWN EXCEPTION\\n\";\r\n    return 1;\r\n}\r\n    return 0;\r\n}\r\n```\r\n\r\nusing both CLion and stand-alone CMake 3.3.0 with simbody 3.5.3. I am consistently running into troubles with, what I believe, is the `SimbodyConfig.cmake` file.\r\n\r\nCLion returns as such:\r\n\r\n```\r\nError:The following variables are used in this project, but they are set to NOTFOUND.\r\nPlease set them or make sure they are set and tested correctly in the CMake files:\r\nSimbody_INCLUDE_DIR\r\n   used as include directory in directory /Users/path/to/project/files/Pendulum\r\n```\r\n\r\nSimiliarly the cmake-gui comes up with something similar:\r\n\r\n```\r\nThe C compiler identification is AppleClang 6.1.0.6020053\r\nThe CXX compiler identification is AppleClang 6.1.0.6020053\r\nCheck for working C compiler using: Xcode\r\nCheck for working C compiler using: Xcode -- works\r\nDetecting C compiler ABI info\r\nDetecting C compiler ABI info - done\r\nDetecting C compile features\r\nDetecting C compile features - done\r\nCheck for working CXX compiler using: Xcode\r\nCheck for working CXX compiler using: Xcode -- works\r\nDetecting CXX compiler ABI info\r\nDetecting CXX compiler ABI info - done\r\nDetecting CXX compile features\r\nDetecting CXX compile features - done\r\n/usr/local;/Developer\r\nCMake Error at /Applications/CMake.app/Contents/share/cmake-3.3/Modules/FindPackageHandleStandardArgs.cmake:148 (message):\r\n  Could NOT find Simbody (missing: Simbody_INCLUDE_DIR)\r\nCall Stack (most recent call first):\r\n  /Applications/CMake.app/Contents/share/cmake-3.3/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)\r\n  cmake/FindSimbody.cmake:271 (find_package_handle_standard_args)\r\n  CMakeLists.txt:18 (find_package)\r\n\r\n\r\nConfiguring incomplete, errors occurred!\r\nSee also \"/Users/path/to/project/files/Pendulum/build/CMakeFiles/CMakeOutput.log\".\r\n```\r\n\r\nMy `CMakeLists.txt` looks as such:\r\n\r\n```\r\n# CMakeLists.txt for making a Simbody-using executable.\r\n# This shows how to use the provided SimbodyConfig.cmake to locate a Simbody\r\n# installation on your machine so you can use it from your own code.\r\n\r\ncmake_minimum_required(VERSION 2.8)\r\nproject(Pendulum)\r\n\r\n# Main source (and) header files\r\nset(my_source_files Pendulum.cpp)\r\n#set(my_header_files myexe.h)\r\n\r\n# This depends on SimbodyConfig.cmake being located somewhere predictable\r\n# on your machine. If you have installed it somewhere that CMake won't be\r\n# able to guess, you'll need to tell find_package where to look.\r\nlist(APPEND CMAKE_MODULE_PATH \"${CMAKE_SOURCE_DIR}/cmake\")\r\nfind_package(Simbody REQUIRED)\r\n\r\ninclude_directories(${Simbody_INCLUDE_DIR})\r\nlink_directories(${Simbody_LIB_DIR})\r\n\r\nadd_executable(Pendulum ${my_source_files})\r\ntarget_link_libraries(Pendulum ${Simbody_LIBRARIES})\r\n```"},"comment":{"url":"https://api.github.com/repos/simbody/simbody/issues/comments/130416612","html_url":"https://github.com/simbody/simbody/issues/424#issuecomment-130416612","issue_url":"https://api.github.com/repos/simbody/simbody/issues/424","id":130416612,"user":{"login":"chrisdembia","id":846001,"avatar_url":"https://avatars.githubusercontent.com/u/846001?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdembia","html_url":"https://github.com/chrisdembia","followers_url":"https://api.github.com/users/chrisdembia/followers","following_url":"https://api.github.com/users/chrisdembia/following{/other_user}","gists_url":"https://api.github.com/users/chrisdembia/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdembia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdembia/subscriptions","organizations_url":"https://api.github.com/users/chrisdembia/orgs","repos_url":"https://api.github.com/users/chrisdembia/repos","events_url":"https://api.github.com/users/chrisdembia/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdembia/received_events","type":"User","site_admin":false},"created_at":"2015-08-12T19:18:19Z","updated_at":"2015-08-12T19:18:19Z","body":"I've had some trouble with using cmake in CLion. I don't like how they try to manage cmake for you...I especially don't like that they don't really let you choose the build directory."}}