Skip to content

Instantly share code, notes, and snippets.

@kenkit
Created June 20, 2021 20:04
Show Gist options
  • Save kenkit/4635b596fa30b3ad93da7c372985e44d to your computer and use it in GitHub Desktop.
Save kenkit/4635b596fa30b3ad93da7c372985e44d to your computer and use it in GitHub Desktop.
CMakelists.txt
cmake_minimum_required(VERSION 2.6)
project (qtapp)
cmake_policy(SET CMP0020 NEW)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# declaring files in your project
# specify which version you need
set(SOURCES
${PROJECT_SOURCE_DIR}/main.cpp
${PROJECT_SOURCE_DIR}/mainwindow.cpp
${PROJECT_SOURCE_DIR}/mainwindow.h
)
if(NOT Boost_FOUND)
if(MSVC)
set(Boost_USE_STATIC_LIBS ON)
else()
set(Boost_USE_STATIC_LIBS OFF)
endif()
set(Boost_USE_MULTITHREADED ON)
find_package(Boost COMPONENTS thread)
endif()
set(TOTAL_INCLUDES
${Boost_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}
../
../encryption/
../google/
../wssocket/
../web_funcs/
../utilities/
../anime/
../aria2_plugin/
../7z_plugin/
../json/include
)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt4 4.8.7 COMPONENTS QtCore QtGui QtXml )
include_directories(${TOTAL_INCLUDES} ../)
if(ENABLE_QTAPP_LOCAL_TESTING)
add_definitions(-DENABLE_QTAPP_LOCAL_TESTING=1)
add_executable(qtapp ${SOURCES} ${PROJECT_SOURCE_DIR}/myapp.rc )
else()
add_executable(qtapp WIN32 ${SOURCES} ${PROJECT_SOURCE_DIR}/myapp.rc)
endif()
link_directories(
${CRASH_PAD_DIR}/lib_md
)
target_link_libraries(qtapp Qt4::QtCore Qt4::QtGui Qt4::QtXml client util base ${Boost_FILESYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_CHRONO_LIBRARY}
${Boost_TIMER_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_LOG_LIBRARY}
${Boost_LOG_SETUP_LIBRARY}
${Boost_ATOMIC_LIBRARY}
${Boost_LOCALE_LIBRARY}
${Boost_REGEX_LIBRARY}
clog
registry
time_manager
protpb
protobuf::libprotoc protobuf::libprotobuf protobuf::libprotobuf-lite
)
target_include_directories(qtapp PRIVATE
${CRASH_PAD_DIR}/include/mini_chromium
${CRASH_PAD_DIR}/include
)
#add_dependencies(WebPlugin libcurl)
#add_dependencies(qtapp AlwaysCheckGit)
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment