57 lines
1.4 KiB
CMake
57 lines
1.4 KiB
CMake
cmake_minimum_required(VERSION 3.8)
|
|
include(ExternalProject)
|
|
include(FetchContent)
|
|
|
|
project(speciesgen VERSION 6.0.0)
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
|
if (NOT CMAKE_BUILD_TYPE)
|
|
set(CMAKE_BUILD_TYPE "Release")
|
|
endif()
|
|
|
|
# For clang-tidy
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
set(SOURCE_LIST
|
|
"src/speciesgen.cpp"
|
|
"src/error.cpp"
|
|
"src/gui/main_panel.cpp"
|
|
"src/gui/stages_panel.cpp"
|
|
"src/starbound/metadata.cpp"
|
|
"src/starbound/item.cpp"
|
|
"src/starbound/frames.cpp"
|
|
"src/starpounds/weightstage.cpp"
|
|
"src/starpounds/species.cpp"
|
|
"src/starpounds/types.cpp"
|
|
)
|
|
|
|
if (NOT MSVC AND NOT WIN32)
|
|
add_executable(speciesgen
|
|
${SOURCE_LIST}
|
|
)
|
|
else()
|
|
add_executable(speciesgen WIN32
|
|
${SOURCE_LIST}
|
|
#"resources/resource.rc"
|
|
)
|
|
endif()
|
|
|
|
find_package(wxWidgets 3.1.5 REQUIRED COMPONENTS core base)
|
|
include(${wxWidgets_USE_FILE})
|
|
include_directories("include" "thirdparty/magic_enum/include" "thirdparty/cereal/include")
|
|
target_link_libraries(speciesgen PRIVATE ${wxWidgets_LIBRARIES})
|
|
|
|
add_definitions(-DSPECIESGEN_VERSION="${CMAKE_PROJECT_VERSION}")
|
|
|
|
if (NOT CMAKE_BUILD_TYPE STREQUAL "DEBUG")
|
|
message(STATUS "Build type is RELEASE")
|
|
add_definitions(-DwxDEBUG_LEVEL=0 -D_ITERATOR_DEBUG_LEVEL=0)
|
|
else()
|
|
message(STATUS "Build type is DEBUG")
|
|
add_compile_options(-g -O0 -gdwarf-2)
|
|
endif()
|
|
|
|
if (CMAKE_VERSION VERSION_GREATER 3.12)
|
|
set_property(TARGET speciesgen PROPERTY CXX_STANDARD 17)
|
|
endif()
|