2022-11-11 09:04:24 -05:00
cmake_minimum_required ( VERSION 3.16 )
set ( CMAKE_CXX_STANDARD 20 )
if ( NOT CMAKE_BUILD_TYPE STREQUAL "Release" )
set ( CMAKE_BUILD_TYPE "Debug" )
message ( "Building debug" )
else ( )
message ( "Building release" )
endif ( )
project ( SpecProject )
set ( SPECPROJECT_BINARY_DIR ${ CMAKE_CURRENT_SOURCE_DIR } /../bin )
2022-11-11 20:00:46 -05:00
set ( SPECTER_CONFIG_PATH ${ CMAKE_CURRENT_SOURCE_DIR } /../lib/cmake )
2022-11-11 09:04:24 -05:00
2022-11-11 20:00:46 -05:00
#Use this to find Specter and its libraries. Specify the path to the Specter/lib & Specter/lib/cmake dir after the PATHS keyword (handles windows/linux usecases)
find_package ( Specter REQUIRED PATHS ../lib ../lib/cmake )
2022-11-11 09:04:24 -05:00
2022-06-20 21:10:10 -04:00
add_executable ( SpecProject )
2022-11-11 09:04:24 -05:00
target_include_directories ( SpecProject PUBLIC
2022-06-20 21:10:10 -04:00
. / s r c
)
target_sources ( SpecProject PRIVATE
. / s r c / m a i n . c p p
. / s r c / M a s s M a p . c p p
. / s r c / M a s s M a p . h
. / s r c / S P S A n a l y s i s S t a g e . c p p
. / s r c / S P S A n a l y s i s S t a g e . h
. / s r c / S P S I n p u t L a y e r . c p p
. / s r c / S P S I n p u t L a y e r . h
)
2022-11-11 09:04:24 -05:00
target_link_libraries ( SpecProject PRIVATE Specter::Specter )
2022-06-20 21:10:10 -04:00
2022-11-11 09:04:24 -05:00
set_target_properties ( SpecProject PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${ SPECPROJECT_BINARY_DIR } )
2022-06-20 21:10:10 -04:00
2022-11-11 09:04:24 -05:00
if ( NOT EXISTS "${SPECPROJECT_BINARY_DIR}/Assets" )
2022-11-11 20:00:46 -05:00
if ( MSVC )
add_custom_command ( TARGET SpecProject
P O S T _ B U I L D C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ d i r e c t o r y
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / A s s e t s
$ { S P E C P R O J E C T _ B I N A R Y _ D I R } / A s s e t s
)
else ( )
add_custom_command ( TARGET SpecProject
P O S T _ B U I L D C O M M A N D $ { C M A K E _ C O M M A N D } - E c r e a t e _ s y m l i n k
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / A s s e t s
$ { S P E C P R O J E C T _ B I N A R Y _ D I R } / A s s e t s
)
endif ( )
2022-11-11 09:04:24 -05:00
endif ( )