CMake on Linux: missing wxWidgets_LIBRARIES - cmake

I'm compiling a program from sources, which uses wxWidgets on Linux.
I have set the following variables in CMakeLists.txt:
SET(wxWidgets_ROOT_DIR ~/Downloads/wxWidgets-3.1.3)
SET(wxWidgets_LIBRARIES ~/Downloads/wxWidgets-3.1.3/lib)
SET(wxWidgets_LIB_DIR ~/Downloads/wxWidgets-3.1.3/lib)
SET(wxWidgets_INCLUDE_DIRS ~/Downloads/wxWidgets-3.1.3/include/wx)
#SET(wxWidgets_VERSION_STRING "3.1.3")
SET(wxWidgets_CONFIGURATION mswu)
SET(WX_ROOT_DIR ~/Downloads/wxWidgets-3.1.3)
And get an error:
Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES)
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.10/Modules/FindwxWidgets.cmake:953 (find_package_handle_standard_args)
CMakeLists.txt:173 (FIND_PACKAGE)
CMakeLists.txt:173 contains the following:
FIND_PACKAGE(wxWidgets REQUIRED base core aui xrc html xml adv gl net qa)
Any idea what I need to do?

Related

OpenSSL missing dependancy, won't compile

While trying to use Cmake on windows 10, it is not possible as OpenSSL wasn't found in my system even though I have it downloaded and installed.
CMake Error at C:/Program Files/CMake/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find OpenSSL (missing: OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
src/cmake/macros/FindOpenSSL.cmake:184 (find_package_handle_standard_args)
CMakeLists.txt:92 (find_package)
I'm not familiar with Cmake, especially not as well on managing software like this for windows 10 (Because it's not meant for win10) but help would be appreciated!
Expected results: Azeroath core to compile and load normally
Outcome results: Azeroath core didn't compile at all
Make sure your using correct version, it has to be full installer and "NOT" light version. Also check your using x86 or x64 (dont mix DLL).
This is where i get mine for windows https://slproweb.com/products/Win32OpenSSL.html

include library to clion project

I'm trying to include wxWidgets library in my project.
I'm working on Ubuntu 16.04. You can get wxWidgets from the repository (already compiled) and just include it by modifying a cmake file (included in CLion). It works fine doing just that.
However, I need to modify the sources and this means that I have to compile the library myself.
I followed the instructions from this file:
https://github.com/wxWidgets/wxWidgets/blob/v3.1.0/docs/gtk/install.txt
Now Cmake can't find the library.
What may be missing?
EDIT:
The part of CMake regarding wxWidgets :
find_package(wxWidgets 3.1.0 COMPONENTS core base media REQUIRED)
include(${wxWidgets_USE_FILE})
target_link_libraries(projectName ${wxWidgets_LIBRARIES})
Error:
CMake Error at /home/usrName/Clion/clion-2017.2/bin/cmake/share/cmake-
3.8/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find wxWidgets: Found unsuitable version "3.0.2", but required is
at least "3.1.0" (found
-L/usr/lib/x86_64-linux-gnu;-pthread;;;-lwx_gtk2u_core-3.0;-lwx_baseu-3.0;-
lwx_gtk2u_media-3.0)
Call Stack (most recent call first):
/home/usrName/Clion/clion-2017.2/bin/cmake/share/cmake-
3.8/Modules/FindPackageHandleStandardArgs.cmake:375 (_FPHSA_FAILURE_MESSAGE)
/home/usrName/Clion/clion-2017.2/bin/cmake/share/cmake-
3.8/Modules/FindwxWidgets.cmake:931 (find_package_handle_standard_args)
CMakeLists.txt:18 (find_package)

Error with CMake to generate ITK Module VTKGlue

I want to generate makefiles for ITK module VTKGlue but I have a message error:
CMake Error at Modules/Bridge/VtkGlue/itk-module-init.cmake:7
(find_package): Could not find a configuration file for package
"VTK" that is compatible with requested version "".
The following configuration files were considered but not accepted:
C:/ITK/bin/VTK/VTKConfig.cmake, version: 6.2.0 (64bit)
Call Stack (most recent call first):
CMake/ITKModuleEnablement.cmake:315 (include) CMakeLists.txt:364
(include)
The content of Modules/Bridge/VtkGlue/itk-module-init.cmake is :
#
Find the packages required by this module
#
Needed VTK version set(VERSION_MIN "5.10.0")
Look for VTK find_package(VTK NO_MODULE REQUIRED COMPONENTS vtkCommonCore)
What should I do?
Thanks
The solution is to rebuild VTK...
It has been built with the generator VS, whereas ITK is built with the generator Eclipse CDT.

Pkgconfig cant find a package

I am using pkgconfig in cmake to link to an external library. Even though there exists a exteral_package.pc file (with apparently correct information), cmake is throwing me an error.
The CMakeLists file looks something like this:
project(juicer)
set(VERSION 1.0)
# Find packages
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
find_package(Tracter REQUIRED)
And the FindTracter file looks like this:
find_package(PkgConfig)
pkg_check_modules(TRACTER REQUIRED tracter)
Error:
-- checking for module 'tracter'
-- package 'tracter' not found
CMake Error at /usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:279 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:333 (_pkg_check_modules_internal)
cmake/FindTracter.cmake:10 (pkg_check_modules)
CMakeLists.txt:22 (find_package)
I am new to using CMake and your help is very much appreciated.
Thanks
Akshat

CMake with SDL causing errors

I've been trying to use CMake with a project I'm doing in SDL, but am running into some problems. My sdl folder for the libraries etc is located at C:\SDL\SDL-1.2.14. The error states:
Could NOT find SDL (missing: SDL_LIBRARY SDL_INCLUDE_DIR) Could NOT find SDLIMAGE (missing: SDLIMAGE_LIBRARY SDLIMAGE_INCLUDE_DIR) CMake Error at C:/Program Files (x86)/CMake
2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (MESSAGE): Could NOT find SDL (missing: SDL_LIBRARY SDL_INCLUDE_DIR) Call Stack (most recent call first): C:/Program Files (x86)/CMake
2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:288 (_FPHSA_FAILURE_MESSAGE) C:/Program Files (x86)/CMake
2.8/share/cmake-2.8/Modules/FindSDL.cmake:172 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:10 (Find_Package)
Here is my CMakeLists.txt file.
Project(SDLExample)
Include(FindSDL)
Include(FindSDL_image)
set(
SOURCES
example.cpp
)
Find_Package(SDL REQUIRED)
Find_Package(SDL_image REQUIRED)
if(NOT SDL_FOUND)
message( FATAL ERROR "SDL not found!")
endif(NOT SDL_FOUND)
link_libraries(
${SDL_LIBRARY}
${SDLIMAGE_LIBRARY}
SDLmain
)
add_executable(
Example
WIN32
MACOSX_BUNDLE
{$SOURCES}
)
Any ideas?
Edit: I got it to work now by editing fields for the SDL paths in the Windows GUI. The problem is of course I can't find a way to 'backport' this back into the cmake file, so I'd have to re-edit them each time, the generated VS10 file loaded into visual studio, but none of the include paths etc for SDL were correctly loaded into the project, so it won't compile saying it does not know where SDL.h is.
You dont need to include the Find<Lib> files. find_package( <Lib> ) finds and uses those files automatically.
If you are on Windows, I think you need to set the SDLDIR environment variable to the folder where the SDL /lib and /include folders are located.