Hi everyone,<div><br></div><div>This is my first post in the mailing list as well as recent CMake user :) However, my CMake experience has not been smooth on OS X especially when it comes to finding frameworks. My CMakeList.txt fails to find "boost.framework" located at /Users/Me/myproject/framework/boost.framework. boost.framework is a framework containing Boost C++ headers and library. The framework was created with this <a href="https://github.com/davidandreoletti/boostoniphone-generic">script</a> and targets iOS Device and iOS Simulator into a single universal binary. The boost.framework works fine when imported into an Xcode project targeting iOS.</div>
<div><br></div><div>When I execute CMake, the output is:</div><div><br></div><div><div>BOOST_INCLUDE_DIR is BOOST_INCLUDE_DIR-NOTFOUND</div><div>BOOST_LIBRARY is BOOST_LIBRARY-NOTFOUND</div><div>-- Could NOT find BOOSTFramework (missing: BOOST_LIBRARY BOOST_INCLUDE_DIR) </div>
</div><div><br></div><div>Here is the relevant part of the CMakeLists.txt:</div><div>--------------------------------------------------------------------</div><div><br></div><div>set(CROSS_PLATFORM_BOOST_FRAMEWORK_DIR /Users/Me/myproject/framework)</div>
<div><div>set(ENV{BOOST_ROOT} ${CROSS_PLATFORM_BOOST_FRAMEWORK_DIR})</div><div>set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CROSS_PLATFORM_BOOST_FRAMEWORK_DIR})</div>
<div>find_package(BoostFramework REQUIRED)</div><div>IF (BOOSTFramework_FOUND)</div><div> include_directories(${BOOST_INCLUDE_DIR})</div><div> target_link_libraries(testrunner boost)</div><div>ENDIF()</div></div><div>
<br></div><div>Here is the FindBoostFramework.cmake file :</div><div>--------------------------------------------------------------------</div><div><br></div><div>set(BOOSTFRAMEWORK_ROOT $ENV{BOOST_ROOT})</div><div><div>if (APPLE)</div>
<div> #</div><div> # Frameworks only exist on Apple's OSes</div><div> #</div><div> find_library(</div><div> BOOST_LIBRARY </div><div> NAMES boost</div><div> PATHS ${BOOSTFRAMEWORK_ROOT}</div><div> NO_DEFAULT_PATH)</div>
<div><br></div><div> find_path(BOOST_INCLUDE_DIR </div><div> NAMES boost/config.hpp config.hpp</div><div> PATHS PATHS ${BOOSTFRAMEWORK_ROOT}</div><div> )</div><div><br></div><div> message("BOOST_INCLUDE_DIR is ${BOOST_INCLUDE_DIR}")</div>
<div> message("BOOST_LIBRARY is ${BOOST_LIBRARY}")</div><div><br></div><div> # Check if Boost is considered found</div><div> #set(BOOST_FOUND "NO")</div><div> if (NOT "${BOOST_INCLUDE_DIR}" STREQUAL "BOOST_INCLUDE_DIR-NOTFOUND" AND DEFINED BOOST_LIBRARY)</div>
<div> SET(BOOST_boost_LIBRARY "-framework boost" CACHE STRING "Boost framework for OSX") </div><div> #set(BOOST_FOUND "YES")</div><div> endif()</div><div><br></div><div> # handle the QUIETLY and REQUIRED arguments and set BOOSTFRAMEWORK_FOUND to TRUE if</div>
<div> # all listed variables are TRUE</div><div> include(FindPackageHandleStandardArgs)</div><div> find_package_handle_standard_args(</div><div> BOOSTFramework</div><div> DEFAULT_MSG</div><div> BOOST_LIBRARY</div>
<div> BOOST_INCLUDE_DIR)</div><div><br></div><div> mark_as_advanced(BOOST_INCLUDE_DIR BOOST_LIBRARY)</div><div>endif (APPLE)</div></div><div><br></div><div>My environment:</div><div>------------------------</div><div>
OS: OS X 10.8</div><div>Xcode 4.4</div><div>Cmake: Tried on both CMake 2.8.8 and CMake 2.8.9</div><div><br></div><div>FYI: I tried to load the OpenGL framework (located at /System/Library/Frameworks/OpenGL.framework) to check whether CMake was finding this "standard" framework but it does NOT either.</div>
<div><br></div><div>Can anyone shed some light on this ?</div><div><br></div><div>Regards,</div><div><br></div><div>David</div><div><br></div>
<div><br></div>