Hello.
I have still a lot to learn.
Finally, I was able to compile the application.
Greetings.
############### The contents of the file CMakeLists.txt ###############
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
if (NOT CMAKE_VERSION VERSION_LESS 3.1) # THIS MUST STAY AT THE TOP OF
THE FILE
cmake_policy(VERSION 3.1) # Doing this prevents multiple, very
verbose warnings about policy CMP0053 not being set
endif()
if (CMAKE_CURRENT_LIST_DIR) # since cmake 2.8.3
set( CL_SRC_ROOT ${CMAKE_CURRENT_LIST_DIR})
message( "-- CL_SRC_ROOT ${CMAKE_CURRENT_LIST_DIR}")
else()
set( CL_SRC_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) # which seems to be
the same, at least in this situation
message( "-- CL_SRC_ROOT ${CMAKE_CURRENT_SOURCE_DIR}")
endif()
#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
"${CMAKE_SOURCE_DIR}/cmake/Modules/")
#message( "-- CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}")
project(sample CXX)
message("************** Projekt: ${PROJECT_NAME} **************")
set(SRC main.cpp)
INCLUDE(InstallRequiredSystemLibraries)
#set( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
# ${Mingw_Path}/libarchive-13.dll
# ${Mingw_Path}/libbz2-1.dll
# ${Mingw_Path}/libexpat-1.dll
# ${Mingw_Path}/libiconv-2.dll
# ${Mingw_Path}/libjpeg-8.dll
# ${Mingw_Path}/liblzma-5.dll
# ${Mingw_Path}/liblzo2-2.dll
# ${Mingw_Path}/libnettle-6-2.dll
# ${Mingw_Path}/libpng16-16.dll
# ${Mingw_Path}/libtiff-5.dll
# ${Mingw_Path}/libwinpthread-1.dll
# ${Mingw_Path}/libzip-4.dll
# ${Mingw_Path}/wxbase30u_gcc_custom.dll
# ${Mingw_Path}/wxmsw30u_core_gcc_custom.dll
#)
# ${Mingw_Path}/zlib1.dll)
set(Mingw_Path /d/msys64/mingw64/bin)
message("-- Mingw_Path ${Mingw_Path}")
# set ( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
# ${Mingw_Path}/libgcc_s_seh-1.dll
# ${Mingw_Path}/libstdc++-6.dll
# ${Mingw_Path}/wxbase30u_gcc_custom.dll
# ${Mingw_Path}/wxmsw30u_core_gcc_custom.dll
# ${Mingw_Path}/wxbase30u_net_gcc_custom.dll
# ${Mingw_Path}/wxbase30u_xml_gcc_custom.dll
# ${Mingw_Path}/wxmsw30u_adv_gcc_custom.dll
# ${Mingw_Path}/wxmsw30u_aui_gcc_custom.dll
# ${Mingw_Path}/wxmsw30u_gl_gcc_custom.dll
# ${Mingw_Path}/wxmsw30u_html_gcc_custom.dll
# ${Mingw_Path}/wxmsw30u_propgrid_gcc_custom.dll
# ${Mingw_Path}/wxmsw30u_qa_gcc_custom.dll
# ${Mingw_Path}/wxmsw30u_ribbon_gcc_custom.dll
# ${Mingw_Path}/wxmsw30u_richtext_gcc_custom.dll
# ${Mingw_Path}/wxmsw30u_stc_gcc_custom.dll
# ${Mingw_Path}/wxmswxmsw30u_xrc_gcc_custom.dll
# )
message("-- CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}")
if( MINGW AND USE_WX_GRAPHICS_CONTEXT )
find_package( GdiPlus )
check_find_package_result( GDI_PLUS_FOUND "GDI+" )
endif()
message("-- wxWidgets_CONFIGURATION is set to mswu")
set(wxWidgets_CONFIGURATION mswu)
message("-- CMAKE_BUILD_TYPE Release")
set(CMAKE_BUILD_TYPE Release)
#include(${wxWidgets_USE_FILE})
#include_directories(${LIBZIP_INCLUDE_DIRS})
#include_directories(${LIBARCHIVE_INCLUDE_DIRS})
set (WX_INCLUDE_DIR /d/msys64/mingw64/include/wx-3.0)
message("-- WX_INCLUDE_DIR = ${WX_INCLUDE_DIR} ")
include_directories(${WX_INCLUDE_DIR})
#D:\msys64\mingw64\lib\wx\include\msw-unicode-3.0
set (WX_INCLUDE_LIB_DIR /d/msys64/mingw64/lib/wx/include/msw-unicode-3.0)
message("-- WX_INCLUDE_LIB_DIR = ${WX_INCLUDE_LIB_DIR} ")
include_directories(${WX_INCLUDE_LIB_DIR})
set (MINGW64_LIB_DIR_INCLUDE /d/msys64/mingw64/lib)
message("-- MINGW64_LIB_DIR_INCLUDE = ${MINGW64_LIB_DIR_INCLUDE} ")
link_directories(${WX_INCLUDE_LIB_DIR})
## MN
#set (WX_CORE_DLL_DIR_INCLUDE /d/msys64/mingw64/bin)
#message("-- WX_CORE_DLL_DIR_INCLUDE = ${WX_CORE_DLL_DIR_INCLUDE} ")
#link_directories(${WX_CORE_DLL_DIR_INCLUDE})
#target_link_libraries(${PROJECT_NAME} ${wxWidgets_LIBRARIES} )
#link_directories(${CMAKE_SOURCE_ROOT}/lib)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations") #
Avoid very multiple warnings spam due to deprecated wx methods
set(BUILD_DIRECTORY ${CMAKE_BINARY_DIR})
message( "-- BUILD_DIRECTORY is set to ${BUILD_DIRECTORY}")
#execute_process(COMMAND uname -s OUTPUT_VARIABLE OS_NAME
OUTPUT_STRIP_TRAILING_WHITESPACE)
set (OS_NAME "WIN")
message("-- OS name ${OS_NAME}")
#if (WITH_WXPATH)
# set(ENV{PATH} ${WITH_WXPATH}:$ENV{PATH})
#endif()
#unset(WITH_WXPATH CACHE)
## Set the libraries outout directory
set( CL_BIN_DIR bin)
set( CL_LIB_DIR lib)
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/${CL_LIB_DIR}" )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/${CL_BIN_DIR}" )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/${CL_LIB_DIR}" )
set( CL_LIBPATH "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}")
message("-- Executables will be written into
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
message("-- Shared Objects will be written into
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") ## Optimize
set(CMAKE_EXE_LINKER_FLAGS "-s") ## Strip binary
message("-- Adding -DNDEBUG to definitions")
add_definitions(-DNDEBUG)
message("-- Adding -DWX_COMPATIBILITY to definitions")
add_definitions( -DWX_COMPATIBILITY )
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ARCH 64)
set(ARCH_NAME x86_64)
endif()
message("-- ARCH ${ARCH}")
message("-- ARCH_NAME ${ARCH_NAME}")
set( wxWidgets_CONFIG_OPTIONS ${wxWidgets_CONFIG_OPTIONS} --static=no )
message("-- wxWidgets_CONFIG_OPTIONS ${wxWidgets_CONFIG_OPTIONS}")
set( CL_WX_CONFIG wx-config )
message("-- CL_WX_CONFIG ${CL_WX_CONFIG}")
execute_process(COMMAND which ${CL_WX_CONFIG} OUTPUT_VARIABLE WX_TOOL
OUTPUT_STRIP_TRAILING_WHITESPACE)
message("-- OUTPUT_VARIABLE WX_TOOL ${WX_TOOL}")
message("-- OUTPUT_VARIABLE OUTPUT_STRIP_TRAILING_WHITESPACE
${OUTPUT_STRIP_TRAILING_WHITESPACE}")
execute_process(COMMAND sh ${WX_TOOL} --debug=no --rescomp
OUTPUT_VARIABLE WX_RC_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
message("-- OUTPUT_VARIABLE OUTPUT_STRIP_TRAILING_WHITESPACE
${OUTPUT_STRIP_TRAILING_WHITESPACE}")
message("-- OUTPUT_VARIABLE WX_RC_FLAGS ${WX_RC_FLAGS}")
string(REGEX REPLACE "windres" "" WX_RC_FLAGS ${WX_RC_FLAGS})
set (CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} ${WX_RC_FLAGS}")
add_definitions(-D__WXMSW__)
execute_process(COMMAND sh ${WX_TOOL} --version OUTPUT_VARIABLE
WX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
string(SUBSTRING "${WX_VERSION}" "0" "1" wxMAJOR_VERSION)
string(SUBSTRING "${WX_VERSION}" "2" "1" wxMINOR_VERSION)
string(SUBSTRING "${WX_VERSION}" "4" "1" wxRELEASE_NUMBER)
if ( wxMAJOR_VERSION LESS 3 )
message(FATAL_ERROR
"\nI'm afraid your wxWidgets version is too old.\nBuilding CodeLite
requires at least wxWidgets-3.0.0"
)
endif()
message("-- wx-config used is: ${WX_TOOL}")
message("-- wxWidgets version is: ${WX_VERSION}")
message("-- Building in Release mode")
set ( DEBUG_BUILD 0 )
set(CMAKE_INSTALL_DO_STRIP TRUE)
message("-- CMAKE_INSTALL_DO_STRIP is " ${CMAKE_INSTALL_DO_STRIP})
set( CL_INSTALL_LIBDIR "lib" )
include (GNUInstallDirs) # defines CMAKE_INSTALL_LIBDIR to lib or lib64
or whatever. Available since cmake 2.8.8
set( CL_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR} )
#add_executable(${PROJECT_NAME} ${SRC} )
#SET(wxWidgets_USE_LIBS)
# FIND_PACKAGE(wxWidgets)
# IF(wxWidgets_FOUND)
# INCLUDE("${wxWidgets_USE_FILE}")
#ADD_EXECUTABLE(MyTest WIN32 main.cpp)
ADD_EXECUTABLE(MyTest WIN32 main.cpp)
# and for each of your dependant executable/library targets:
# TARGET_LINK_LIBRARIES(MyTest ${wxWidgets_LIBRARIES})
#TARGET_LINK_LIBRARIES(MyTest CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
TARGET_LINK_LIBRARIES(MyTest libwx_mswu_core-3.0.dll.a
libwx_baseu-3.0.dll.a )
# ELSE(wxWidgets_FOUND)
# For convenience. When we cannot continue, inform the user
# MESSAGE("wxWidgets not found!")
# ENDIF(wxWidgets_FOUND)
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Msys2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/msys2-users