Closed Greeley closed 2 years ago
Changing my wxWidgets CMakeLists.txt to the one provided in issue #7 fails later with this error. Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES wxWidgets_INCLUDE_DIRS)
Changes CMakeLists.txt in /src to this.
cmake_minimum_required(VERSION 3.6 FATAL_ERROR)
set(CMAKE_C_COMPILER "/Library/Developer/CommandLineTools/usr/bin/c")
set(CMAKE_CXX_COMPILER "/Library/Developer/CommandLineTools/usr/bin/c++")
project(wx_cmake_template_core LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(__STDC_WANT_LIB_EXT1__)
# hack for buggy CMake's FindwxWidgets script
if (DEFINED ENV_WX_CONFIG)
set (ENV{WX_CONFIG} ${ENV_WX_CONFIG})
endif()
set(wxWidgets_USE_DEBUG 1)
set(wxWidgets_USE_UNICODE 1)
set(wxWidgets_USE_UNIVERSAL 0)
set(wxWidgets_USE_STATIC 1)
#set(wxWidgets_CONFIG_OPTIONS --toolkit=base --prefix=/usr)
find_package(wxWidgets COMPONENTS core base REQUIRED)
set(SRCS main.cpp)
if (APPLE)
# create bundle on apple compiles
add_executable(main MACOSX_BUNDLE ${SRCS} )
# Set a custom plist file for the app bundle - needed for Mac OS Retina display
set_target_properties(main PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
else()
# the WIN32 is needed for Windows in order for it to look for WinMain
# instead of the main function. This is ignored on other systems,
# so it works on all platforms
add_executable(main WIN32 ${SRCS})
endif()
target_link_libraries(main PRIVATE ${wxWidgets_LIBRARIES})
This is the new error that I get. Which is the error I was getting before I switched to using this project as a base. So I got nowhere.
[build] [ 81%] Performing configure step for 'Culinoire_core'
[build] loading initial cache file /Users/Greeley/Workspace/Cppspace/Culinoire/build/subprojects/tmp/Culinoire_core/Culinoire_core-cache-.cmake
[build] -- Configuring done
[build] -- Generating done
[build] -- Build files have been written to: /Users/Greeley/Workspace/Cppspace/Culinoire/build/subprojects/Build/Culinoire_core
[build] [ 87%] Performing build step for 'Culinoire_core'
[build] [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o
[build] /Users/Greeley/Workspace/Cppspace/Culinoire/src/main.cpp:3:10: fatal error: 'wx/wxprec.h' file not found
[build] #include <wx/wxprec.h>
[build] ^~~~~~~~~~~~~
[build] 1 error generated.
[build] make[5]: *** [CMakeFiles/main.dir/main.cpp.o] Error 1
[build] make[4]: *** [CMakeFiles/main.dir/all] Error 2
[build] make[3]: *** [all] Error 2
[build] make[2]: *** [subprojects/Stamp/Culinoire_core/Culinoire_core-build] Error 2
[build] make[1]: *** [CMakeFiles/Culinoire_core.dir/all] Error 2
[build] make: *** [all] Error 2
[build] Build finished with exit code 2
[cpptools] The build configurations generated do not contain the active build configuration. Using "" for CMAKE_BUILD_TYPE instead of "Debug" to ensure that IntelliSense configurations can be found
Any thoughts/ideas are greatly appreciated.
Second error is caused by the fact I forgot to put include(${wxWidgets_USE_FILE})
in the src/CMakeLists.txt.
And that is caused by the fact I absolutely loathe video tutorials, my attention span just cannot handle them.
Anyway; excellent work, great tutorial in all.
Thank you.
Downloading and doing
cmake --build build
after the configure command provides a memset_s undeclared error.Downloading wxWidgets and performing
cd ~/wxWidgets && mkdir buildOSX && cd buildOSX && ./configure --enable-debug && make -j3 && cd samples/minimal && make && open minimal.app
builds and launches minimal.app just fine.But even after building it that way I can't seem to figure out how to use it that way.