CMake not finding 3.0.0 and ugly graphics with 2.8.12 Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Tapsa
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2011 5:52 pm
Location: Helsinki

CMake not finding 3.0.0 and ugly graphics with 2.8.12

Post by Tapsa » Fri Dec 13, 2013 3:16 pm

Why the same CMakeLists.txt can find wxWidgets 2.8.12 but not 3.0.0?
Also why I get the fancy graphics only with 3.0.0. but not with 2.8.12?
I used to get the fancy graphics with 2.8.12 when I used an earlier MinGW compiler, but now I get something like Win 95 graphics with the latest gcc 4.8.2 using posix and sjlj. I had to add CXXFLAGS+=-fpermissive for the wxWidgets 2.8.12 to even compile.

Code: Select all

cd buildD/
cmake -j4 -DCMAKE_EXE_LINKER_FLAGS="-static-libstdc++ -static-libgcc -static" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE:STRING=Debug -DwxWidgets_ROOT_DIR:PATH="C:\Cpp\wxWidgets" -DBOOST_LIBRARYDIR:PATH="C:\Cpp\Boost\lib" -DBOOST_INCLUDEDIR:PATH="C:\Cpp\Boost\include" -DZLIB_LIBRARY:FILEPATH="C:\Cpp\zlib\libz.a" -DZLIB_INCLUDE_DIR:PATH="C:\Cpp\zlib" ../
mingw32-make
PAUSE
CMakeLists.txt with unrelated parts removed:

Code: Select all

find_package(wxWidgets COMPONENTS adv core base REQUIRED)

include("${wxWidgets_USE_FILE}")

set(AGE_SRC Main.cpp
	...
	Resources.rc
	)

add_executable(AdvancedGenieEditor3 WIN32 ${AGE_SRC})

target_link_libraries(AdvancedGenieEditor3 ${wxWidgets_LIBRARIES} genieutils)

User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: CMake not finding 3.0.0 and ugly graphics with 2.8.12

Post by eranon » Fri Dec 13, 2013 5:11 pm

I don't use CMake, but maybe a useful link for you (in case) : http://wiki.wxwidgets.org/CMake
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]

Tapsa
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2011 5:52 pm
Location: Helsinki

Re: CMake not finding 3.0.0 and ugly graphics with 2.8.12

Post by Tapsa » Sat Dec 14, 2013 4:49 pm

I browsed that link with not much success, BUT I solved CMake not finding 3.0.0 by modifying FindwxWidgets.cmake to look for 3.0 libs.
Also by quick look it seems like some really annoying graphics bugs were fixed in 3.0.0!
It's hard to believe the graphic glitches got fixed, but so it seems so far...

User avatar
doublemax
Moderator
Moderator
Posts: 15068
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: CMake not finding 3.0.0 and ugly graphics with 2.8.12

Post by doublemax » Sat Dec 14, 2013 5:13 pm

The "ugly graphics" you're describing are most likely caused by a missing manifest file in the executable.
Use the source, Luke!

Tapsa
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2011 5:52 pm
Location: Helsinki

Re: CMake not finding 3.0.0 and ugly graphics with 2.8.12

Post by Tapsa » Sat Dec 14, 2013 5:45 pm

From wxWidgets 2.5, the XP manifest is included in wx/msw/wx.rc and so your application will be themed automatically so long as you include wx.rc in your own .rc file.
This isn't true with MinGW 4.8.2, but now that wxWidgets 3 seems to work (nice graphics), perhaps I'll ditch the old wxWidgets 2.8.12.

User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: CMake not finding 3.0.0 and ugly graphics with 2.8.12

Post by eranon » Mon Dec 23, 2013 12:32 pm

However, if you want to be sure about manifest whatever be the wxWidgets version, you can just :

Code: Select all

#define wxUSE_NO_MANIFEST 1
in your .rc file, then add your own manifest explicitely at post-build stage using mt.exe.
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]

Post Reply