Hello.
I moved the source files to a shorter directory.
I changed the contents of the file CMakeLists.txt and Makefile has been
generated successfully.
The command make returns the result:
$ make
Scanning dependencies of target sample2
[50%] Building CXX object CMakeFiles / sample2.dir / main.cpp.o
D: /Devel/wx/sample/main.cpp: 4: 23: fatal error: wx / wxprec.h: No such
file or directory
#include <wx / wxprec.h>
^
compilation terminated.
make [2]: *** [CMakeFiles / sample2.dir / build.make: 63: CMakeFiles /
sample2.dir / main.cpp.o] Error 1
make [1]: *** [CMakeFiles / Makefile2: 68: CMakeFiles / sample2.dir /
all] Error 2
make: *** [Makefile: 84: all] Error 2
############ The file CMakeLists.txt #################
cmake_minimum_required(VERSION 2.6)
project(sample2 CXX)
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}")
## 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)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ARCH 64)
set(ARCH_NAME x86_64)
endif()
message("-- ARCH ${ARCH}")
message("-- ARCH_NAME ${ARCH_NAME}")
add_definitions( -DWX_COMPATIBILITY )
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)
execute_process(COMMAND sh ${WX_TOOL} --debug=no --rescomp
OUTPUT_VARIABLE WX_RC_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
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}")
set(SRC main.cpp)
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 ( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
${Mingw_Path}/libgcc_s_seh-1.dll
${Mingw_Path}/libstdc++-6.dll)
add_executable(${PROJECT_NAME} ${SRC} )
set(wxWidgets_CONFIGURATION mswu)
#find_package(wxWidgets COMPONENTS core base REQUIRED)
#include(${wxWidgets_USE_FILE})
#target_link_libraries(${PROJECT_NAME} ${wxWidgets_LIBRARIES})
#install( PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION . )
#install( TARGETS ${PROJECT_NAME} RUNTIME DESTINATION . )
------------------------------------------------------------------------------
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