[CMake] FLTKConfig.cmake on Microsoft Windows

Julia Jacobson julia.jacobson at arcor.de
Thu Dec 30 05:01:31 EST 2010


With your help, everything seems to work now.
My final subdirectory src/CMakeLists.txt looks like this:

SET(FLTK_DIR "C:/Program Files/fltk-1.1.9/")
SET(FLTK_BASE_LIBRARY "C:/Program Files/fltk-1.1.9/lib/")
SET(FLTK_FORMS_LIBRARY "C:/Program Files/fltk-1.1.9/lib/")
SET(FLTK_GL_LIBRARY "C:/Program Files/fltk-1.1.9/lib/")
SET(FLTK_IMAGES_LIBRARY "C:/Program Files/fltk-1.1.9/lib/")
SET(FLTK_INCLUDE_DIR "C:/Program Files/fltk-1.1.9/include/")
SET(FLTK_SKIP_FLUID TRUE)
FIND_PACKAGE(FLTK REQUIRED)
if( FLTK_FOUND )
include_directories( ${FLTK_INCLUDE_DIR} )
add_executable( hello main.cpp )
target_link_libraries( hello ${FLTK_LIBRARIES} )
else( FLTK_FOUND )
message(FATAL_ERROR "Could not find FLTK")
endif( FLTK_FOUND )

What grieves me is that the CMake code I had prepared in linux looked 
really nice (without any absolute paths and so on), but the file for 
Windows doesn't.
Truth be told, what's the point of using CMake here instead of a 
Makefile? Simply rewriting the build script doesn't cause that more work 
either.
Would it help to add the FLTK directory to the Windows PATH variable?

> Am Mittwoch, den 29.12.2010, 20:03 +0100 schrieb Julia Jacobson:
>> Thanks for your answer. The file FindFLTK.cmake exists within my CMake
>> installation, but I still get an error message:
>> "CMake Error at C:/Program Files/CMake
>> 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91
>> (MESSAGE):
>> Could NOT find FLTK (missing: FLTK_LIBRARIES FLTK_FLUID_EXECUTABLE)"
>> This is probably due to the fact that I haven't indicated anywhere where
>> to find my FLTK installation (i.e. C:\Program Files\fltk-1.1.10).
>>
> Actually the module file (here FindFLTK) should find the libraries on
> any platforms, but in this case...
>
> Before FIND_PACKAGE(FLTK REQUIRED) insert:
>
> SET(FLTK_DIR "C:/Program Files/fltk-1.1.10") # NO backslash!
>
> If you did not install "fluid")
> SET(FLTK_SKIP_FLUID TRUE)
>
> FIND_PACKAGE(...
>
> Micha


More information about the CMake mailing list