Bug 509940 - Cmake can't build sdl program with mingw32
Cmake can't build sdl program with mingw32
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: cmake (Show other bugs)
12
All Linux
low Severity medium
: ---
: ---
Assigned To: Orion Poplawski
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-06 21:22 EDT by Dennis Payne
Modified: 2010-12-05 01:44 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-12-05 01:44:56 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Simple cmake example using SDL (836 bytes, application/x-compressed-tar)
2009-07-06 21:22 EDT, Dennis Payne
no flags Details

  None (edit)
Description Dennis Payne 2009-07-06 21:22:41 EDT
Created attachment 350708 [details]
Simple cmake example using SDL

Description of problem:
When attempting to build an SDL program with mingw32, cmake fails to find the SDL library.  It's possible that I haven't configured the toolchain file properly but asking on the cmake mailing list suggests that no configuration will work.

Version-Release number of selected component (if applicable):


How reproducible:
Attached is a simple hello world program that fails to build the makefile with mingw.

Steps to Reproduce:
1. Extract files
2. cmake -DCMAKE_TOOLCHAIN_FILE=./Toolchain-mingw32.cmake .
  
Actual results:
CMake Error at CMakeLists.txt:4 (message):
  SDL not found!


Expected results:
Makefile properly created
Comment 1 Erik van Pienbroek 2009-07-17 06:17:02 EDT
Are you sure you have the package mingw32-SDL installed?
Comment 2 Dennis Payne 2009-07-17 09:30:49 EDT
mingw32-sdl is installed.  Here is part of rpm -qi mingw32-SDL.

Name        : mingw32-SDL                  Relocations: (not relocatable)
Version     : 1.2.13                            Vendor: Fedora Project

If you look at FindSDL.cmake, you will see the FIND_PATH for SDL.h.  It is search a bunch of paths but nothing that can be found from the root path /usr/i686-pc-mingw32.  The cmake mailing list suggested adding /usr/i686-pc-mingw32/sys-root/mingw to the root path but the FIND_PATH in FindSDL.cmake isn't looking in /include/SDL so it still doesn't find it.  It was mentioned that the FindSDL.cmake is using an old way to look for the appropriate include files.  Not sure what the current suggested practice is.
Comment 3 Paolo Bonzini 2009-07-26 10:47:55 EDT
You should use FindPkgConfig.cmake.  However, you will hit bugs 513924 and 513925.

Actually, I'd bet that cmake does not look for i686-pc-mingw32-pkg-config (only pkg-config), so even fixing 513925 would not help you; you would have to hack something to use cross-compilation search paths (as hinted in bug 513925).  Call it the revenge of the autotools. ;-)
Comment 4 Richard W.M. Jones 2009-07-26 14:00:36 EDT
(In reply to comment #3)
> Actually, I'd bet that cmake does not look for i686-pc-mingw32-pkg-config (only
> pkg-config), so even fixing 513925 would not help you; you would have to hack
> something to use cross-compilation search paths (as hinted in bug 513925). 
> Call it the revenge of the autotools. ;-)  

No, cmake works perfectly well.  We build several packages using
cmake just fine.
Comment 5 Paolo Bonzini 2009-07-26 16:13:21 EDT
Maybe using mingw32-cmake?  Erik mentioned it but I didn't find it in my installation.

As I wrote extensively in 513925, the need for special commands instead of "./configure --host=... && make" (or the cmake equivalent) is always the sign of a bug (either in the program's build system, or in Fedora).
Comment 6 Erik van Pienbroek 2009-07-26 17:59:36 EDT
mingw32-cmake is only available in mingw32-filesystem-51-1.fc12 (or higher) so only rawhide
Comment 7 Orion Poplawski 2009-10-14 12:10:52 EDT
I really have no clue about this.  Have you asked on the cmake mailing list?  

I'm going to close this for now, feel free to reopen if you feel Fedora needs to make a distribution specific change to cmake.
Comment 8 Dennis Payne 2009-11-17 23:04:11 EST
Installed fedora 12 in virtual-machine.  Installed mingw32 files including mingw32-SDL and mingw32-filesystem.  My original test still failed.  Ran "mingw32-cmake ." which also failed.

-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/i686-pc-mingw32-gcc
-- Check for working C compiler: /usr/bin/i686-pc-mingw32-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/i686-pc-mingw32-g++
-- Check for working CXX compiler: /usr/bin/i686-pc-mingw32-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 2.6)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
SDL_INCLUDE_DIR
   used as include directory in directory /home/dulsi/test

-- Configuring incomplete, errors occurred!

I did ask on the cmake list back when I reported this bug.  They pointed me to the FindSDL cmake rules which explained why it would work.  It would never look in the appropriate directory.  I had hoped mingw32-cmake was built in a way that allowed it to work but it appears to not be the case.
Comment 9 Bug Zapper 2010-04-27 11:31:12 EDT
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 10 Dennis Payne 2010-05-25 21:59:25 EDT
The problem exists in Fedora 12.  Haven't had a chance to test Fedora 13 yet.
Comment 11 Bug Zapper 2010-11-04 06:51:20 EDT
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 12 Bug Zapper 2010-12-05 01:44:56 EST
Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.