CMake generates the files normally, but when running make I get a preprocessor error from wx/defs.h saying "No Target! You should use wx-config program for compilation flags!"
After that, every error I get is related to GTK.
I would've assumed that CMake would add all required libraries.
Here's just a portion of all the errors:
Code: Select all
In file included from /usr/local/include/wx-3.1/wx/cursor.h:57:0,
from /usr/local/include/wx-3.1/wx/event.h:21,
from /usr/local/include/wx-3.1/wx/wx.h:24,
from /home/midnightas/cpp/XXXXX/include/XXXXX.h:4,
from /home/midnightas/cpp/XXXXX/src/XXXXX.cpp:1:
/usr/local/include/wx-3.1/wx/gtk/cursor.h:43:5: error: ‘GdkCursor’ does not name a type
GdkCursor *GetCursor() const;
^
In file included from /usr/local/include/wx-3.1/wx/colour.h:213:0,
from /usr/local/include/wx-3.1/wx/window.h:24,
from /usr/local/include/wx-3.1/wx/wx.h:38,
from /home/midnightas/cpp/XXXXX/include/XXXXX.h:4,
from /home/midnightas/cpp/XXXXX/src/XXXXX.cpp:1:
/usr/local/include/wx-3.1/wx/gtk/colour.h:26:20: error: ‘GdkColor’ does not name a type
wxColour(const GdkColor& gdkColor);
^
/usr/local/include/wx-3.1/wx/gtk/colour.h:48:11: error: ‘GdkColor’ does not name a type
const GdkColor *GetColor() const;
Code: Select all
cmake_minimum_required(VERSION 3.5)
project(XXXXX)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_STANDARD 11)
find_package(wxWidgets 3.1 REQUIRED core base gl)
find_package(CURL REQUIRED)
file(GLOB_RECURSE SOURCES
src/*.cpp
include/*.h
)
add_executable(xxxxx ${SOURCES})
include_directories(${CURL_INCLUDE_DIRS} ${wxWidgets_INCLUDE_DIRS} "${PROJECT_SOURCE_DIR}/include")
target_link_libraries(xxxxx ${CURL_LIBRARIES} ${wxWidgets_LIBRARIES})