Fails miserably on Win32 (XP), Win7 64, Win Server 2008 64 too.  You&#39;ll find as I have that the &quot;find whatevers&quot; are not all that they are cracked up to be.  CUDA is another example.  find_package should really be named attempt_to_find_package_and_when_you_can&#39;t_simply_tell_me_the_vars_to_set( package_name )<br>
<br>I have found that FindWhatevers do not allow for a ordered specification of search directories of where the build spec developer believes them to be on their system.  If you look into these you will see a set of predefined search directories that when things change are not up to date such as C:\\Program Files\\MATLAB\\R2010a, C:\\Program Files\\MATLAB\\R2009b, etc install dirs.<br>
<br>I have been doing the following:<br><br>--snip matlab_config.cmake--<br>macro( matlab_config )<br><br><br>    <br>    message( &quot;MATLAB_INCLUDE_DIR = ${MATLAB_INCLUDE_DIR}&quot; )<br>    #MATLAB_LIBRARIES<br>    #MATLAB_MEX_LIBRARY<br>
    #MATLAB_MX_LIBRARY<br>    #MATLAB_ENG_LIBRARY<br>    <br>    if( BUILD_64BIT )    <br>        set( LIB_DIR win64 )<br>        message( &quot;BUILDING FOR 64 bit Windows&quot; ) <br>    <br>    else(BUILD_64BIT)<br>        set( LIB_DIR win32 )<br>
        message( &quot;BUILDING FOR 32 bit Windows&quot; ) <br>        <br>    endif(BUILD_64BIT)<br>    <br>    SET( MATLAB_ROOT_DIR &quot;C:\\Program Files\\MATLAB\\R2010a&quot; CACHE STRING &quot;&quot; )<br>    SET( MATLAB_INCLUDE_DIR &quot;${MATLAB_ROOT_DIR}\\extern\\include&quot; CACHE STRING &quot;&quot; FORCE )<br>
    <br>    find_library(MATLAB_LIB_DIR libmx.lib PATHS ${MATLAB_ROOT_DIR} ${MATLAB_ROOT_DIR}/extern/lib/${LIB_DIR}/microsoft )<br>    message(&quot;MATLAB_LIB_DIR = ${MATLAB_ROOT_DIR}/extern/lib/${LIB_DIR}/microsoft&quot; )<br>
    message( &quot;MATLAB_LIB_DIR = ${MATLAB_LIB_DIR}&quot; )<br>    message( &quot;matlab lib dir = ${MATLAB_ROOT_DIR}/extern/lib/${LIB_DIR}&quot; )<br>    <br>    <br>    SET( MATLAB_LIBRARIES ${MATLAB_ROOT_DIR}/bin/${LIB_DIR} CACHE STRING &quot;&quot; FORCE )<br>
    SET( MATLAB_MEX_LIBRARY ${MATLAB_ROOT_DIR}/extern/lib/${LIB_DIR}/microsoft CACHE STRING &quot;&quot; FORCE )<br>    SET( MATLAB_MX_LIBRARY ${MATLAB_ROOT_DIR}/extern/lib/${LIB_DIR}/microsoft CACHE STRING &quot;&quot; FORCE )<br>
    SET( MATLAB_ENG_LIBRARY ${MATLAB_ROOT_DIR}/extern/lib/${LIB_DIR}/microsoft CACHE STRING &quot;&quot; FORCE )<br>    <br>    INCLUDE_DIRECTORIES( ${MATLAB_INCLUDE_DIR} )<br><br>endmacro()<br><br><br>--end snip--<br><br>