mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-12-25 10:01:38 +08:00
first test CMakeLists.txt
This commit is contained in:
parent
5f62722d38
commit
04aaa01333
18
common_compilersettings.cmake
Normal file
18
common_compilersettings.cmake
Normal file
@ -0,0 +1,18 @@
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
|
||||
# configure compiler
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED on)
|
||||
|
||||
if(MINGW)
|
||||
# COMPILER-SETTINGS FOR MINGW
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
|
||||
elseif(MSVC)
|
||||
# COMPILER-SETTINGS FOR MS VISUAL C++
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
|
||||
# To enable M_PI, M_E,...
|
||||
add_definitions(/D_USE_MATH_DEFINES)
|
||||
# To fix error: C2338: va_start argument must not
|
||||
# have reference type and must not be parenthesized
|
||||
add_definitions(/D_CRT_NO_VA_START_VALIDATION)
|
||||
endif()
|
1
common_include.cmake
Normal file
1
common_include.cmake
Normal file
@ -0,0 +1 @@
|
||||
cmake_minimum_required(VERSION 3.1)
|
16
lib/jkqtcommon/CMakeLists.txt
Normal file
16
lib/jkqtcommon/CMakeLists.txt
Normal file
@ -0,0 +1,16 @@
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
# common definitions
|
||||
include(../../common_include.cmake)
|
||||
|
||||
set(SOURCE
|
||||
${SOURCE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/jkqtptools.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
set(HEADERS
|
||||
${HEADERS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/jkqtptools.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/jkqtp_imexport.h
|
||||
PARENT_SCOPE
|
||||
)
|
15
lib/jkqtmathtext/CMakeLists.txt
Normal file
15
lib/jkqtmathtext/CMakeLists.txt
Normal file
@ -0,0 +1,15 @@
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
# common definitions
|
||||
include(../../common_include.cmake)
|
||||
|
||||
set(SOURCE
|
||||
${SOURCE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/jkqtmathtext.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
set(HEADERS
|
||||
${HEADERS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/jkqtmathtext.h
|
||||
PARENT_SCOPE
|
||||
)
|
44
staticlib/jkqtmathtextlib/CMakeLists.txt
Normal file
44
staticlib/jkqtmathtextlib/CMakeLists.txt
Normal file
@ -0,0 +1,44 @@
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
# common definitions
|
||||
include(../../common_include.cmake)
|
||||
|
||||
|
||||
IF(CMAKE_BUILD_TYPE MATCHES RELEASE)
|
||||
SET(LIB_NAME libjkqtmathtext_static)
|
||||
ELSE()
|
||||
SET(LIB_NAME libjkqtmathtext_static_debug)
|
||||
ENDIF(CMAKE_BUILD_TYPE MATCHES RELEASE)
|
||||
|
||||
|
||||
# configure compiler
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../common_compilersettings.cmake)
|
||||
|
||||
|
||||
|
||||
|
||||
# Find the QtWidgets library
|
||||
find_package(Qt5 COMPONENTS Core Gui PrintSupport CONFIG REQUIRED)
|
||||
# Find includes in corresponding build directories
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
# Instruct CMake to run moc automatically when needed
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
# Create code from a list of Qt designer ui files
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
||||
|
||||
# All build libraries are moved to this directory
|
||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
|
||||
message(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../lib/jkqtcommon/)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../lib/jkqtmathtext/)
|
||||
|
||||
# define output library and properties
|
||||
ADD_LIBRARY(${LIB_NAME} ${SOURCES} ${HEADERS})
|
||||
INSTALL(TARGETS ${LIB_NAME} DESTINATION bin)
|
||||
|
||||
# define target
|
||||
target_link_libraries(${LIB_NAME} Qt5::Core Qt5::Widgets Qt5::PrintSupport)
|
||||
#target_compile_features(${LIB_NAME} PUBLIC cxx_std_11)
|
||||
target_include_directories(${LIB_NAME} PUBLIC "../../lib/jkqtmathtext/")
|
||||
#export(TARGETS ${LIB_NAME})
|
Loading…
Reference in New Issue
Block a user