I wrote the CMakeLists.txt
file with the following file structure on Linux
-main
--include
--bin
--lib
----SRC
------CMakeLists.txt
------dir1
--------CMakeLists.txt
------dir2
--------CMakeLists.txt
dir1/CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
set(HOME "/workspace/main")
set(INCLUDE "${HOME}/include")
set(LIB "${HOME}/lib")
set(LIBRARY_OUTPUT_PATH "${HOME}/lib")
set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_CXX_COMPILER "g++")
set(CMAKE_C_FLAGS_DEBUG "xxx")
set(CMAKE_CXX_FLAGS_DEBUG "xxx")
include_directories(${INCLUDE} ${INCLUDE}/AR ${INCLUDE}/linux-x86_64)
add_library(video STATIC video.c video2.c)
dir2
directory CMakeLists.txt similar content
SRC/CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
add_subdirectory(dir1)
add_subdirectory(dir2)
My question is: How to write CMakeLists.txt
in order to facilitate the transplant on Linux
programs to Windows
?