[CMake] The find_xxx family and VS

Micha Renner Micha.Renner at t-online.de
Tue Jun 15 08:12:38 EDT 2010


It seems, that CMake can detect the MSVC specific headers and libraries
only, if it runs within Visual Studio.

For example:
FIND_FILE(STD_FILE stdio.h),
FIND_PATH(STD_PATH stdio.h) or
FIND_LIBRARY(LIB_PATH comctl32)

results in "NOT-FOUND", if CMake is run outside the IDE with an empty
Build-Directory. 

This means the first run of the compiler/linker always fails, since
CMake regenerates the solution-/config-files only if there is a change
in the script/config files inside VS.

This always leads to complex instructions for third-party users who just
want to build the programs/libraries, like this.
"After you have build the solution files with cmake-gui:
- open VS, 
- open the project
- open the "Top-level"-CMakeList.txt file
- Hit a space in an empty line
- Rebuild the project.

Is there a better foolproof method to solve this.

Micha




More information about the CMake mailing list