chore: finish basic CMake build scripts
This commit is contained in:
@@ -12,12 +12,12 @@ if (WIN32)
|
||||
add_library(SQLite3 INTERFACE IMPORTED)
|
||||
add_library(SQLite3::SQLite3 ALIAS SQLite3)
|
||||
# Setup header files
|
||||
set_target_properties(VirtoolsSDK PROPERTIES
|
||||
set_target_properties(SQLite3 PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${SQLITE_AMALGAMATION_PATH}"
|
||||
)
|
||||
# Setup lib files
|
||||
set_target_properties(VirtoolsSDK PROPERTIES
|
||||
set_target_properties(SQLite3 PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES
|
||||
"${SQLITE_DLL_PATH}/sqlite3.lib"
|
||||
)
|
||||
|
||||
@@ -105,12 +105,18 @@ INTERFACE_LINK_LIBRARIES
|
||||
"$<$<STREQUAL:${MATERIALIZER_BUILD_TYPE},plugin>:${VIRTOOLS_LIB_PATH}/InterfaceControls.lib>"
|
||||
"$<$<STREQUAL:${MATERIALIZER_BUILD_TYPE},plugin>:${VIRTOOLS_LIB_PATH}/CKControls.lib>"
|
||||
)
|
||||
# Setup build macros
|
||||
set_target_properties(VirtoolsSDK PROPERTIES
|
||||
INTERFACE_COMPILE_DEFINITIONS
|
||||
# Setup compile macros
|
||||
target_compile_definitions(VirtoolsSDK
|
||||
INTERFACE
|
||||
# Virtools version macro
|
||||
"VIRTOOLS_${VIRTOOLS_VERSION}"
|
||||
# Virtools 5.0 standalone mode need an extra macro
|
||||
"$<$<AND:$<STREQUAL:${MATERIALIZER_BUILD_TYPE},plugin>,$<STREQUAL:${VIRTOOLS_VERSION},50>>:VIRTOOLS_USER_SDK"
|
||||
"$<$<AND:$<STREQUAL:${MATERIALIZER_BUILD_TYPE},plugin>,$<STREQUAL:${VIRTOOLS_VERSION},50>>:VIRTOOLS_USER_SDK>"
|
||||
)
|
||||
# Setup compiler options
|
||||
target_compile_options(VirtoolsSDK
|
||||
INTERFACE
|
||||
# Permissive mode ordered.
|
||||
"/permissive"
|
||||
)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ PRIVATE
|
||||
)
|
||||
# Setup header files
|
||||
target_sources(VSWDecorator
|
||||
PUBLIC
|
||||
PRIVATE
|
||||
FILE_SET HEADERS
|
||||
FILES
|
||||
# Headers
|
||||
@@ -17,6 +17,16 @@ FILES
|
||||
target_include_directories(VSWDecorator
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
YYCCommonplace
|
||||
SQLite3::SQLite3
|
||||
VSWShared
|
||||
)
|
||||
# Setup linked library
|
||||
target_link_libraries(VSWDecorator
|
||||
PRIVATE
|
||||
YYCCommonplace
|
||||
SQLite3::SQLite3
|
||||
VSWShared
|
||||
)
|
||||
# Setup C++ standard
|
||||
set_target_properties(VSWDecorator
|
||||
|
||||
@@ -7,24 +7,37 @@ if (VSW_MATERIALIZER_BUILD_TYPE STREQUAL "plugin")
|
||||
else ()
|
||||
add_executable(VSWMaterializer "")
|
||||
endif ()
|
||||
# Setup static library sources
|
||||
# Setup source files
|
||||
target_sources(VSWMaterializer
|
||||
PRIVATE
|
||||
# Sources
|
||||
main.cpp
|
||||
)
|
||||
# Setup header files
|
||||
target_sources(VSWMaterializer
|
||||
PUBLIC
|
||||
PRIVATE
|
||||
FILE_SET HEADERS
|
||||
FILES
|
||||
# Headers
|
||||
stdafx.hpp
|
||||
resources.h
|
||||
resource.h
|
||||
)
|
||||
# Setup header infomations
|
||||
target_include_directories(VSWMaterializer
|
||||
PUBLIC
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
YYCCommonplace
|
||||
SQLite3::SQLite3
|
||||
VirtoolsSDK
|
||||
VSWShared
|
||||
)
|
||||
# Setup linked library
|
||||
target_link_libraries(VSWMaterializer
|
||||
PRIVATE
|
||||
YYCCommonplace
|
||||
SQLite3::SQLite3
|
||||
VirtoolsSDK
|
||||
VSWShared
|
||||
)
|
||||
# Setup C++ standard (we require C++ 17 because Virtools can hold more higher C++ standard)
|
||||
set_target_properties(VSWMaterializer
|
||||
@@ -36,8 +49,8 @@ PROPERTIES
|
||||
# MSVC specific correction
|
||||
target_compile_definitions(VSWMaterializer
|
||||
PRIVATE
|
||||
$<$<CXX_COMPILER_ID:MSVC>:UNICODE>
|
||||
$<$<CXX_COMPILER_ID:MSVC>:_UNICODE>
|
||||
$<$<CXX_COMPILER_ID:MSVC>:MBCS>
|
||||
$<$<CXX_COMPILER_ID:MSVC>:_MBCS>
|
||||
)
|
||||
target_compile_options(VSWMaterializer
|
||||
PRIVATE
|
||||
|
||||
10
script/build.bat
Normal file
10
script/build.bat
Normal file
@@ -0,0 +1,10 @@
|
||||
MKDIR bin
|
||||
CD bin
|
||||
|
||||
cmake -G "Visual Studio 16 2019" -A Win32 -DVSW_BUILD_MATERIALIZER=ON -DVSW_BUILD_DECORATOR=OFF -DMATERIALIZER_BUILD_TYPE=plugin -DVIRTOOLS_VERSION=50 -DVIRTOOLS_PATH="E:\Virtools\Virtools Dev 5.0" -DSQLITE_AMALGAMATION_PATH="D:\CppLib\SQLite\sqlite-amalgamation-3450300" -DSQLITE_DLL_PATH="D:\CppLib\SQLite\sqlite-dll-win-x86-3450300" -DYYCC_PATH="J:\YYCCommonplace\bin\install\Win32_Debug" ../..
|
||||
cmake --build . --config Debug
|
||||
cmake -G "Visual Studio 16 2019" -A Win32 -DVSW_BUILD_MATERIALIZER=OFF -DVSW_BUILD_DECORATOR=ON -DSQLITE_AMALGAMATION_PATH="D:\CppLib\SQLite\sqlite-amalgamation-3450300" -DSQLITE_DLL_PATH="D:\CppLib\SQLite\sqlite-dll-win-x86-3450300" -DYYCC_PATH="J:\YYCCommonplace\bin\install\Win32_Debug" ../..
|
||||
cmake --build . --config Debug
|
||||
|
||||
CD ..
|
||||
ECHO Build Done!
|
||||
@@ -4,6 +4,7 @@ add_library(VSWShared STATIC "")
|
||||
target_sources(VSWShared
|
||||
PRIVATE
|
||||
# Sources
|
||||
DataTypes.cpp
|
||||
)
|
||||
# Setup header files
|
||||
target_sources(VSWShared
|
||||
|
||||
0
shared/DataTypes.cpp
Normal file
0
shared/DataTypes.cpp
Normal file
Reference in New Issue
Block a user