I have been trying to create a deb for LLVM libc++ 3.4 on a Ubuntu 12.04LTS 64bit box tonight. I would like to first create a deb that just consists of just /usr/lib64/libc++.a
without any headers. Yes, I know per Debian library packaging guide, I should include the file in a *-dev
package, But being new to cmake
and cpack
, I would like to get there incrementally.
So, I first changed the libcxx-3.4/lib/CMakeLists.txt
and added an if check (see line 14 and 18)
$ cat CMakeLists.txt
1 if (NOT LIBCXX_INSTALL_SUPPORT_HEADERS)
2 set(LIBCXX_SUPPORT_HEADER_PATTERN PATTERN "support" EXCLUDE)
3 endif()
4
5 file(COPY .
6 DESTINATION "${CMAKE_BINARY_DIR}/include/c++/v1"
7 FILES_MATCHING
8 PATTERN "*"
9 PATTERN "CMakeLists.txt" EXCLUDE
10 PATTERN ".svn" EXCLUDE
11 ${LIBCXX_SUPPORT_HEADER_PATTERN}
12 )
13
14 if (${LIBCXX_ENABLE_SHARED} MATCHES "ON")
15 install(DIRECTORY "${CMAKE_BINARY_DIR}/include/c++/v1/"
16 DESTINATION include/c++/v1/
17 )
18 endif()
Then, at in the build
subdirectory, I issued a
CC=clang CXX=clang++ cmake -j2 -G "Unix Makefiles" -DLIBCXX_CXX_ABI=libcxxabi -DLIBCXX_LIBCXXABI_INCLUDE_PATHS="../libcxxabi/include" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ../libcxx -DLIBCXX_ENABLE_SHARED=OFF
The created deb
still consists of all headers. If I commented out lines 14 to 18, then no headers were included in the package. I am puzzled by this. A variable defined for the parent CMakeLists.txt
should be picked up by a child CMakeLists.txt
. What did I miss? I would appreciate a hint or two.