+7  A: 

First of all use

FIND_PACKAGE(Boost REQUIRED)

rather than

  FIND_PACKAGE(Boost)

This way cmake will give you a nice error message if it doesn't find it, long before any compilations are started. If it fails set the environment variable BOOST_ROOT to /opt/local (which is the install prefix). Additionally you will have to link in the filesystem library, so you want

FIND_PACKAGE(Boost COMPONENTS filesystem REQUIRED)

for later use of

target_link_libraries(mytarget ${Boost_FILESYSTEM_LIBRARY})

Enter

cmake --help-module FindBoost

at the shell to get the docs for the Boost find module in your cmake installation.

PS: An example

The CMakeLists.txt

cmake_minimum_required(VERSION 2.6)
project(Foo)

find_package(Boost COMPONENTS filesystem REQUIRED)

include_directories(${Boost_INCLUDE_DIRS})
add_executable(foo main.cpp)
target_link_libraries(foo 
  ${Boost_FILESYSTEM_LIBRARY}
)

main.cpp

#include <boost/filesystem.hpp>
#include <vector>
#include <string>
#include <cstdio>
#include <cstddef>

namespace fs = boost::filesystem;
using namespace std;

int main(int argc, char** argv)
{
  vector<string> args(argv+1, argv+argc);
  if(args.empty())
  {
    printf("usage: ./foo SOME_PATH\n");
    return EXIT_FAILURE;
  }

  fs::path path(args.front());

  if(fs::exists(path))
    printf("%s exists\n", path.string().c_str());
  else
    printf("%s doesn't exist\n", path.string().c_str());

  return EXIT_SUCCESS;
}
Maik Beckmann
Boost_INCLUDE_DIRS: /opt/local/include
Janusz
Please run $ make VERBOSE=1 and show us the line where the file which fails is compiled
Maik Beckmann
Please use http://pastebin.ca/ to send us a link to a full log of your actions :)
Maik Beckmann
added the output from make. It seems that /opt/local/include isn't mentioned during the compiler call
Janusz
A: 

Have you tried including filesystem.hpp without the "boost/" part?

scvalex
All headers files in boost do their includes like #include <boost/...>, so if <boost/filesystem.hpp> doesn't work, nothing works!
Maik Beckmann
yes didnt work either
Janusz