|
|
|
@@ -2,34 +2,11 @@ cmake_minimum_required (VERSION 3.15) |
|
|
|
|
|
|
|
project (sww) |
|
|
|
|
|
|
|
# For IDEs |
|
|
|
# When using IDE to open this cmake project, it will never to append the |
|
|
|
# argument `CMAKE_MODULE_PATH`, so we must set it in the CMakeLists.txt file |
|
|
|
# before including the cmake modules of admake. |
|
|
|
if (NOT DEFINED CMAKE_MODULE_PATH) |
|
|
|
execute_process (COMMAND admake dirs -c |
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE |
|
|
|
RESULT_VARIABLE _ADMAKE_CODE |
|
|
|
OUTPUT_VARIABLE _ADMAKE_CMAKE_DIR |
|
|
|
ERROR_VARIABLE _ADMAKE_ERROR) |
|
|
|
if (NOT _ADMAKE_CODE EQUAL "0") |
|
|
|
message (FATAL_ERROR "Failed to append cmake modules of admake: ${_ADMAKE_ERROR}") |
|
|
|
else () |
|
|
|
set (CMAKE_MODULE_PATH "${_ADMAKE_CMAKE_DIR}") |
|
|
|
endif () |
|
|
|
|
|
|
|
set (IN_IDE ON) |
|
|
|
endif () |
|
|
|
|
|
|
|
# Disable sanitizer by default, otherwise the canvas of the window will be filled with |
|
|
|
# abnormal data(on the top). |
|
|
|
set (ADMAKE_DISABLE_ADDRESS_SANITIZER ON) |
|
|
|
|
|
|
|
include (admake) |
|
|
|
|
|
|
|
if (IN_IDE) |
|
|
|
add_compile_definitions (${ADMAKE_OS_DEF}) |
|
|
|
endif () |
|
|
|
include (CMakeListsPub) |
|
|
|
|
|
|
|
set (TARGET_NAME ${CMAKE_PROJECT_NAME}) |
|
|
|
|
|
|
|
|