cmake_minimum_required (VERSION 2.4) project (freeze) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin) set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}) add_definitions(-DUNICODE -D_UNICODE) SET( CMAKE_EXE_LINKER_FLAGS "-mwindows" ) find_package( GDIPLUS ) set(CMAKE_REQUIRED_DEFINITIONS -DGDIPLUS_LOWERCASE=${GDIPLUS_LOWERCASE}) set(CMAKE_REQUIRED_INCLUDES ${GDIPLUS_INCLUDE_DIR}) set(CMAKE_REQUIRED_LIBRARIES ${GDIPLUS_LIBRARY}) #find_library(GDIPLUS gdiplus) #add_library(gdiplus SHARED) add_definitions(${GDIPLUS_DEFINITIONS}) link_directories(${GDIPLUS_INCLUDE_DIR}) link_libraries(${GDIPLUS_LIBRARIES}) include_directories("${PROJECT_SOURCE_DIR} ${GDIPLUS_INCLUDE_DIR}") add_executable (freeze src/main.cpp src/resource.rc) target_link_libraries(freeze ${GDIPLUS}) # mkdir build && cd build # rm -r CMakeCache.txt CMakeFiles/ # cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain-cross-mingw32-linux.cmake ../ # make