Ok.
I already do it and work it.
But i have another problem (i think that is the last). I need add two framework to binary execute(sndfile and freetype). I can compile without it and it generate the binary, but when execute i got error that sndfile and freetype is not linked.
So to solve, i add the sndfile and freetype framework and made a new cmakelists. But if i put:
target_link_libraries(${PROJECT_NAME} ${EXTRA_TARGET_LINK_LIBRARIES} ${SFML_LIBRARIES} ${SNDFILE_LIBRARY} ${FREETYPE_LIBRARY})
The final command to link is:
Linking CXX executable sfml-project.app/Contents/MacOS/sfml-project
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_link_script CMakeFiles/sfml-project.dir/link.txt --verbose=1
/usr/bin/c++ -g -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/sfml-project.dir/main.cpp.o CMakeFiles/sfml-project.dir/Engine.cpp.o CMakeFiles/sfml-project.dir/Util.cpp.o CMakeFiles/sfml-project.dir/ResourcePath.mm.o -o sfml-project.app/Contents/MacOS/sfml-project -F/Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/freetype/mac/lib -framework Foundation ../library/sfml/mac/lib/libsfml-audio.dylib ../library/sfml/mac/lib/libsfml-graphics.dylib ../library/sfml/mac/lib/libsfml-network.dylib ../library/sfml/mac/lib/libsfml-system.dylib ../library/sfml/mac/lib/libsfml-window.dylib -framework sndfile -framework freetype
ld: framework not found sndfile
In red you see that cmake only add a -F command to freetype.
So, if i remove freetype from target_link_libraries, like this:
target_link_libraries(${PROJECT_NAME} ${EXTRA_TARGET_LINK_LIBRARIES} ${SFML_LIBRARIES} ${SNDFILE_LIBRARY})
I get:
Linking CXX executable sfml-project.app/Contents/MacOS/sfml-project
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_link_script CMakeFiles/sfml-project.dir/link.txt --verbose=1
/usr/bin/c++ -g -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/sfml-project.dir/main.cpp.o CMakeFiles/sfml-project.dir/Engine.cpp.o CMakeFiles/sfml-project.dir/Util.cpp.o CMakeFiles/sfml-project.dir/ResourcePath.mm.o -o sfml-project.app/Contents/MacOS/sfml-project -F/Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/sndfile/mac/lib -framework Foundation ../library/sfml/mac/lib/libsfml-audio.dylib ../library/sfml/mac/lib/libsfml-graphics.dylib ../library/sfml/mac/lib/libsfml-network.dylib ../library/sfml/mac/lib/libsfml-system.dylib ../library/sfml/mac/lib/libsfml-window.dylib -framework sndfile
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E copy_directory /Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/sfml/mac/lib /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/sfml-project.app/Contents/Frameworks
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E copy_directory /Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/sndfile/mac/lib /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/sfml-project.app/Contents/Frameworks
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E copy_directory /Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/freetype/mac/lib /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/sfml-project.app/Contents/Frameworks
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E make_directory /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/sfml-project.app/Contents/Resources/js
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E copy_directory /Users/paulo/Documents/workspaces/cpp/sfml-cmake/resources /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/sfml-project.app/Contents/Resources
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_progress_report /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles 1 2 3 4
[100%] Built target sfml-project
As you see, the -F command is to sndfile and the compilation was done.
So, how i can add parameter to sndfile and freetype framework path?