feat(Cmake): Rewrite build and use inherited dependencies (#1652)

This commit is contained in:
Kargatum
2019-04-02 03:41:08 +07:00
committed by Francesco Borzì
parent 0f174eff01
commit eae9affec9
48 changed files with 6336 additions and 1178 deletions

View File

@@ -9,28 +9,33 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
file(GLOB_RECURSE sources *.cpp *.h)
CollectSourceFiles(
${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE_SOURCES)
set(include_Dirs
${CMAKE_SOURCE_DIR}/deps/libmpq
)
if( WIN32 )
set(include_Dirs
${include_Dirs}
${CMAKE_SOURCE_DIR}/deps/libmpq/win
)
endif()
include_directories(${include_Dirs})
add_executable(vmap4extractor ${sources})
add_executable(vmap4extractor ${PRIVATE_SOURCES})
target_link_libraries(vmap4extractor
mpq
${BZIP2_LIBRARIES}
${ZLIB_LIBRARIES}
)
PUBLIC
mpq)
# Group sources
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
CollectIncludeDirectories(
${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC_INCLUDES)
target_include_directories(vmap4extractor
PUBLIC
${PUBLIC_INCLUDES}
PRIVATE
${CMAKE_CURRENT_BINARY_DIR})
set_target_properties(vmap4extractor
PROPERTIES
FOLDER
"tools")
if( UNIX )
install(TARGETS vmap4extractor DESTINATION bin)