Fedora Linux Support Community & Resources Center
  #1  
Old 6th July 2009, 02:20 AM
dulsi Offline
Registered User
 
Join Date: Jul 2009
Posts: 10
cmake and mingw32

I created a simple hello world program with cmake. I created a Toolchain file for mingw32. It compiled in linux and the mingw32 fine. I modified the program to use SDL. It compiled under linux but failed to work with mingw32. Is there a standard Toolchain file that make this work. Here is the Toolchain file:

Code:
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)

# which compilers to use for C and C++
SET(CMAKE_C_COMPILER i686-pc-mingw32-gcc)
SET(CMAKE_CXX_COMPILER i686-pc-mingw32-g++)

# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH  /usr/i686-pc-mingw32 )

# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search 
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
(I also tried /usr/i686-pc-mingw32/sys-root/mingw/ as the root path.)

Here is the CMakeLists.txt file:

Code:
Find_Package(SDL REQUIRED)

if (NOT SDL_FOUND)
 message(FATAL_ERROR "SDL not found!")
endif (NOT SDL_FOUND)

include_directories(include ${SDL_INCLUDE_DIR})

link_libraries(
  ${SDL_LIBRARY}
)
add_executable(hello hello.cpp)
Reply With Quote
Reply

Tags
cmake, mingw32

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross compile (mingw32) link error RedFedora Programming & Packaging 0 6th September 2009 06:44 PM
gcc cross compiler for target i386-pc-mingw32 early-ehlinger Programming & Packaging 8 14th February 2008 09:10 PM
Creating cmake projects with KDevelop rracasanu Programming & Packaging 3 13th June 2007 08:28 PM
CMake Complitric Using Fedora 2 30th August 2005 03:04 AM


Current GMT-time: 06:19 (Saturday, 25-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat