Skip to content

Commit

Permalink
bugfix, CMAKE_CXX_FLAGS. append not replace.
Browse files Browse the repository at this point in the history
  • Loading branch information
yssource committed Jun 23, 2021
1 parent 8254156 commit 1e5480d
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ set(CMAKE_VERBOSE_MAKEFILE TRUE)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Produce compile_commands.json
set(CMAKE_CXX_STANDARD 17)
if (MSVC)
set(CMAKE_CXX_FLAGS "/DUNICODE /D_UNICODE")
set(CMAKE_CXX_FLAGS_DEBUG "/DEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "/O3 /DQT_NO_DEBUG /DTF_NO_DEBUG")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DUNICODE /D_UNICODE")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}/DEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O3 /DQT_NO_DEBUG /DTF_NO_DEBUG")
else()
set(CMAKE_CXX_FLAGS "-Wall -W -D_REENTRANT")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DQT_NO_DEBUG -DTF_NO_DEBUG")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -W -D_REENTRANT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DQT_NO_DEBUG -DTF_NO_DEBUG")
endif()

# Auto generate moc files
Expand All @@ -31,13 +31,11 @@ if(CMAKE_VERSION VERSION_LESS "3.7.0")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif()

find_package(Qt5 REQUIRED Core Network Sql Xml Qml)
find_package(Qt5 COMPONENTS Core Network Sql Xml Qml REQUIRED CONFIG)
find_package(pybind11 REQUIRED)
# add_subdirectory(pybind11)
add_subdirectory(binding)

get_target_property(QtCore_location Qt5::Core LOCATION)
get_filename_component(QtCore_libdir ${QtCore_location} DIRECTORY)

enable_testing()
message(status ${CONAN_LIBS})

0 comments on commit 1e5480d

Please sign in to comment.