cmake: include_subdirectory(src) and include_subdirectory(tests)

This commit is contained in:
c9s 2014-05-15 00:47:52 +08:00
parent 1140f78d56
commit 8168861af1
4 changed files with 20 additions and 4 deletions

View file

@ -15,7 +15,7 @@ SET(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH} ${CMAKE_MODULE_PATH}
) )
include_directories(. ${INCLUDE_DIRECTORIES} /opt/local/include) include_directories(. "${PROJECT_SOURCE_DIR}/include" ${INCLUDE_DIRECTORIES} /opt/local/include)
link_directories(${LINK_DIRECTORIES} /opt/local/lib) link_directories(${LINK_DIRECTORIES} /opt/local/lib)
@ -45,13 +45,12 @@ set(LIBS ${LIBS} ${PCRE_LIBRARIES} ${Judy_LIBRARIES} r3)
enable_testing() enable_testing()
# set (CMAKE_CXX_FLAGS "-std=c++0x -arch x86_64 -stdlib=libc++ -g3 -Wall -O0") # set (CMAKE_CXX_FLAGS "-std=c++0x -arch x86_64 -stdlib=libc++ -g3 -Wall -O0")
# add_subdirectory(src) add_subdirectory(src)
add_subdirectory(tests) add_subdirectory(tests)
add_test(test_tree ${CMAKE_CURRENT_BINARY_DIR}/test_tree) add_test(test_tree ${CMAKE_CURRENT_BINARY_DIR}/test_tree)
add_library(r3 main.c)
# add_executable(alphablue-gui main.cc cv.cc) add_executable(demo demo.c)
# target_link_libraries(alphablue-gui ${OpenCV_LIBS} ${GFlags_LIBS} ${GLog_LIBS} ${Boost_LIBS}) # target_link_libraries(alphablue-gui ${OpenCV_LIBS} ${GFlags_LIBS} ${GLog_LIBS} ${Boost_LIBS})
# install(TARGETS alphablue-gui DESTINATION bin) # install(TARGETS alphablue-gui DESTINATION bin)

7
demo.c Normal file
View file

@ -0,0 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
return 0;
}

9
src/CMakeLists.txt Normal file
View file

@ -0,0 +1,9 @@
include_directories("${PROJECT_SOURCE_DIR}/include")
# install(TARGETS swiftnav-static DESTINATION lib${LIB_SUFFIX})
set(libr3_SRCS node.c)
# add_library(r3 STATIC ${libr3_SRCS})
add_library(r3 SHARED ${libr3_SRCS})
# target_link_libraries(r3 cblas)
# install(FILES ${libswiftnav_HEADERS} DESTINATION include/libswiftnav)

1
src/node.c Normal file
View file

@ -0,0 +1 @@